protected void Bind() { if (id != 0) { if (Tools.TryParseMethod(id.ToString()) != 0) { BannerCustomerInfo info = bcsBLL.GetDataById(id); txtcompanyname.Text = info.bcs_company_name; txtcompanytype.Text = info.bcs_company_type; txtCompanyPhone.Text = info.bcs_company_phone; txtCompanyfax.Text = info.bcs_fax; txtContact.Text = info.bcs_note; rbSex.SelectedValue = info.bcs_sex; txtMail.Text = info.bcs_mail; txtname.Text = info.bcs_name; txtPhone.Text = info.bcs_phone; address1.City = info.bcs_city; address1.Area = info.bcs_area; address1.CodeId = info.bcs_code; address1.Address = info.bcs_address; txtCreatedate.Text = info.bcs_ts.ToString("yyyy/MM/dd"); txtEditdate.Text = info.bcs_editdate.ToString("yyyy/MM/dd"); } } }
protected void btnSubmit_Click(object sender, EventArgs e) { BannerCustomerInfo info = new BannerCustomerInfo(); info.bcs_company_name = txtcompanyname.Text; info.bcs_company_type = txtcompanytype.Text; info.bcs_company_phone = txtCompanyPhone.Text; info.bcs_name = txtname.Text; info.bcs_sex = rbSex.SelectedValue; info.bcs_phone = txtPhone.Text; info.bcs_mail = txtMail.Text; info.bcs_note = txtContact.Text; info.bcs_fax = txtCompanyfax.Text; info.bcs_city = address1.City; info.bcs_area = address1.Area; info.bcs_code = address1.CodeId; info.bcs_address = address1.Address; info.bcs_key = "BC" + DateTime.Now.ToString("yyyyMMddhhmm") + string.Format("{00000:00000}", bcsBLL.GetAll().Count + 1); info.bcs_ts = DateTime.Now; info.bcs_editdate = DateTime.Now; if (bcsBLL.Insert(info) > 0) { Response.Redirect("List.aspx?header=" + Getmessage("30009")); } }
public BannerCustomerInfo GetDataById(int bcs_id) { BannerCustomerInfo info = new BannerCustomerInfo(); IDataReader reader = db.GetDataById(bcs_id).CreateDataReader(); if (reader.Read()) { info = BannerCustomerInfo.Populate(reader); } return(info); }
public List <BannerCustomerInfo> GetAll() { List <BannerCustomerInfo> infos = new List <BannerCustomerInfo>(); IDataReader reader = db.GetData().CreateDataReader(); while (reader.Read()) { infos.Add(BannerCustomerInfo.Populate(reader)); } return(infos); }
protected void btnSubmit_Click(object sender, EventArgs e) { BannerCustomerInfo info = bcsBLL.GetDataById(id); info.bcs_company_name = txtcompanyname.Text; info.bcs_company_type = txtcompanytype.Text; info.bcs_company_phone = txtCompanyPhone.Text; info.bcs_fax = txtCompanyfax.Text; info.bcs_name = txtname.Text; info.bcs_mail = txtMail.Text; info.bcs_phone = txtPhone.Text; info.bcs_sex = rbSex.SelectedValue; info.bcs_note = txtContact.Text; info.bcs_editdate = DateTime.Now; if (bcsBLL.Update(info) > 0) { Response.Redirect("List.aspx?header=" + Getmessage("30014")); } }
protected void Bind() { if (id != 0) { if (Tools.TryParseMethod(id.ToString()) != 0) { BannerCustomerInfo info = bcsBLL.GetDataById(id); lbNumber.Text = info.bcs_key; lbCompanyname.Text = info.bcs_company_name; lbType.Text = info.bcs_company_type; lbCompanyPhone.Text = info.bcs_company_phone; lbfax.Text = info.bcs_fax; lbname.Text = info.bcs_name; lbSex.Text = info.bcs_sex; lbPhone.Text = info.bcs_phone; lbMail.Text = info.bcs_mail; lbAddress.Text = info.bcs_city + info.bcs_code + info.bcs_area + info.bcs_address; litNote.Text = info.bcs_note; lbts.Text = info.bcs_ts.ToString("yyyy/MM/dd hh:mm"); lbEdit.Text = info.bcs_editdate.ToString("yyyy/MM/dd hh:mm"); } } }
public int Update(BannerCustomerInfo info) { return(db.Update(info.bcs_key, info.bcs_company_name, info.bcs_company_type, info.bcs_company_phone, info.bcs_name, info.bcs_sex, info.bcs_phone, info.bcs_mail, info.bcs_fax, info.bcs_address, info.bcs_note, info.bcs_ts, info.bcs_editdate, info.bcs_city, info.bcs_area, info.bcs_code, info.bcs_id)); }