/Web/UserControls/AddClient.ascx.cs
C# | 41 lines | 37 code | 4 blank | 0 comment | 0 complexity | 181718f4284de4964c235f9d5b5009da MD5 | raw file
- using System;
- using System.Collections;
- using System.Configuration;
- using System.Data;
- using System.Data.Linq;
- using System.Linq;
- using System.Web;
- using System.Web.Security;
- using System.Web.UI;
- using System.Web.UI.HtmlControls;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- using System.Xml.Linq;
- using DAL;
- public partial class UserControls_AddClient : System.Web.UI.UserControl
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- }
- protected void btnAddClient_Click(object sender, EventArgs e)
- {
- InvoicingDataContext db = new InvoicingDataContext();
- ClientDetail client = new ClientDetail
- {
- name = this.txtName.Text,
- email = this.txtEmail.Text,
- telephone = Convert.ToInt32(this.txtTelephone.Text),
- address_line1 = this.txtAddress1.Text,
- address_line2 = this.txtAddress2.Text,
- city = this.txtCity.Text,
- county = this.txtCounty.Text,
- post_code = this.txtPostCode.Text
- };
- db.ClientDetails.InsertOnSubmit(client);
- db.SubmitChanges();
- }
- }