示例#1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         lblErrorMsg.Visible = false;
         lblPassword.Visible = false;
         txtPassword.Visible = false;
         if (Session["CustEmail"] == null || Session["CustFirstName"] == null)
         {
             Session.Clear();
             Response.Redirect("Login.aspx");
         }
         string   CustEmail = Session["CustEmail"].ToString();
         Customer Cust      = CustomerDB.GetAllCustomer(CustEmail);
         txtAddress.Text       = Cust.CustAddress;
         txtBusinessPhone.Text = Cust.CustBusPhone.ToString();
         txtCity.Text          = Cust.CustCity;
         txtCountry.Text       = Cust.CustCountry;
         txtFax.Text           = Cust.CustFax.ToString();
         txtFirstName.Text     = Cust.CustFirstName;
         txtHomePhone.Text     = Cust.CustHomePhone.ToString();
         txtLastName.Text      = Cust.CustLastName;
         txtPostalCode.Text    = Cust.CustPostalCode;
         txtProvince.Text      = Cust.CustProv;
         txtEmail.Text         = Cust.CustEmail;
     }
 }
示例#2
0
 private void frmMain_Load(object sender, EventArgs e)
 {
     try
     {
         customers = CustomerDB.GetAllCustomer();
         customerDataGridView.DataSource = customers;    //bind the gird view to the customers list
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error while loading chustomers data: " + ex.Message, ex.GetType().ToString());
     }
 }