protected void Page_Load(object sender, EventArgs e) { if (Session["ONUM"] != null && Session["CNAME"] != null && !IsPostBack) { lblONum.Text = Session["ONUM"].ToString(); lblCName.Text = Session["CNAME"].ToString(); lblCNum.Text = Session["CNUM"].ToString(); Cnum = Session["CNUM"].ToString(); orderNum = lblONum.Text; try { CsReceipt recept = new CsReceipt(orderNum, reTable, toTable); ConnectionClass.DisplayReceipt(recept); GridView1.DataSource = recept.ReceiptTable; GridView1.DataBind(); CsCustomer thisCustomer = new CsCustomer(Cnum, CFname, CLname, CAddress, Ccity, Cprovince, CPcode, CPhone, CEmail, CNote, CRDate, Clv); ConnectionClass.GetCustomerDetail(thisCustomer); lblCEmail.Text = thisCustomer.cEmail; lblOrderDate.Text = recept.TotalTable.Rows[0][4].ToString(); lblTQty.Text = recept.TotalTable.Rows[0][0].ToString(); lblTAmt.Text = recept.TotalTable.Rows[0][1].ToString(); lblTTax.Text = recept.TotalTable.Rows[0][2].ToString(); lblGTotal.Text = recept.TotalTable.Rows[0][3].ToString(); } catch { ClientScript.RegisterStartupScript(GetType(), "message", "<script>alert('error');</script>"); } finally { } } else { //ClientScript.RegisterStartupScript(GetType(), "message", "<script>alert('No Order');</script>"); } }
protected void Page_Load(object sender, EventArgs e) { if (Session["customerNum"] != null && !IsPostBack) { cnumlbl.Text = Session["customerNum"].ToString(); cnum = cnumlbl.Text; DisableTextBoxes(Page); try { CsCustomer thatCustomer = new CsCustomer(cnum, firstName, lastName, address, city, province, postalCode, phonenumber, emailAddress, notes, registerDate, levels); ConnectionClass.GetCustomerDetail(thatCustomer); fnamebox.Text = thatCustomer.cFirstName; lnamebox.Text = thatCustomer.cLastName; addressbox.Text = thatCustomer.cAddress; citybox.Text = thatCustomer.cCity; emailbox.Text = thatCustomer.cEmail; phonebox.Text = thatCustomer.cPhone; pcodebox.Text = thatCustomer.cPostalCode; notebox.Text = thatCustomer.cNote; provincelist.SelectedItem.Text = thatCustomer.cProvince; //provincelist.Enabled = false; } catch { ClientScript.RegisterStartupScript(GetType(), "message", "<script>alert('error');</script>"); } finally { } } else if (Session["customerNum"] != null && IsPostBack) { //provincelist.Enabled = true; } }