protected void Page_Load(object sender, EventArgs e) { objcustomer = new clsCustomer(); sCOM = new Common(); uname = (String)Session["uname"]; if (uname != null) { txtuname.Text = uname; } else { txtuname.Text = "travelagent"; } if (!Page.IsPostBack) { if (Request.QueryString["action"] == "add") { txtcustcode.Text = sCOM.setAutoID("Customer", "CustCode").ToString(); } else if (Request.QueryString["action"] == "edit") { if (Request.QueryString["ec"] != null) { string ec = (Request.QueryString["ec"].ToString()); objcustomer = objcustomer.GetData(ec); txtcustcode.Text = objcustomer.CustCode.ToString(); txtcustname.Text = objcustomer.CustName; txtuname.Text = objcustomer.UserName; txtaddress.Text = objcustomer.Address; txttphone.Text = objcustomer.Telephone; txtmobile.Text = objcustomer.Mobile; txtemail.Text = objcustomer.Email; } } else { //Error Page } } }