protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Maticsoft.BLL.ComPany combll = new Maticsoft.BLL.ComPany(); int maxid = combll.GetMaxId() - 1; Maticsoft.Model.ComPany commodel = combll.GetModel(maxid); lblComPanyContent.Text = commodel.comconten; } }
private void bind() { Maticsoft.BLL.ComPany companybll = new Maticsoft.BLL.ComPany(); int maxid = companybll.GetMaxId() - 1; Maticsoft.Model.ComPany companymodel = companybll.GetModel(maxid); lblComEmail.Text = companymodel.ComEmail; lblComFax.Text = companymodel.ComFax; lblCompanyNames.Text = companymodel.CompanyNames; lblComPhoto.Text = companymodel.ComPhoto; lblFanren.Text = companymodel.Fanren; }
private void ShowInfo(int CompanyID) { Maticsoft.BLL.ComPany bll = new Maticsoft.BLL.ComPany(); Maticsoft.Model.ComPany model = bll.GetModel(CompanyID); this.lblCompanyID.Text = model.CompanyID.ToString(); this.txtCompanyNames.Text = model.CompanyNames; this.txtCompanyType.Text = model.CompanyType; this.txtComAddress.Text = model.ComAddress; this.txtComFax.Text = model.ComFax; this.txtComPhoto.Text = model.ComPhoto; this.txtComEmail.Text = model.ComEmail; this.txtQQ.Text = model.QQ; this.txtComwangzhi.Text = model.Comwangzhi; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Maticsoft.BLL.ComPany companybll = new Maticsoft.BLL.ComPany(); Maticsoft.Model.ComPany companymodel = companybll.GetModel(1); lblComAddress.Text = companymodel.ComAddress; lblComEmail.Text = companymodel.ComEmail; lblComFax.Text = companymodel.ComFax; lblCompanyNames.Text = companymodel.CompanyNames; lblComPhoto.Text = companymodel.ComPhoto; lblComwangzhi.Text = companymodel.Comwangzhi; lblqq.Text = companymodel.QQ; } }
private void bind() { Maticsoft.BLL.ComPany combll = new Maticsoft.BLL.ComPany(); Maticsoft.Model.ComPany commodel = combll.GetModel(1); txtcomfaren.Text = commodel.Fanren.ToString(); txtcomfax.Text = commodel.ComFax; txtcompanyname.Text = commodel.CompanyNames; txtcompanytype.Text = commodel.CompanyType; txtcomphoto.Text = commodel.ComPhoto; txtcomwangzhi.Text = commodel.Comwangzhi; txtcontent.Text = commodel.comconten; txtEmail.Text = commodel.ComEmail; txtqq.Text = commodel.QQ; txtcomaddress.Text = commodel.ComAddress; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["usename"] != null) { if (Session["usename"].ToString() != "") { Maticsoft.BLL.ComPany companybll = new Maticsoft.BLL.ComPany(); Maticsoft.Model.ComPany companymodel = companybll.GetModel(1); if (companymodel.CompanyNames == "") { btnadd.Visible = true; btnupadel.Visible = false; } else { btnadd.Visible = false; btnupadel.Visible = true; bind(); } } else { Response.Redirect("login.aspx"); Response.End(); } } else { Response.Redirect("login.aspx"); Response.End(); } } }
protected void btnadd_Click(object sender, EventArgs e) { Maticsoft.BLL.ComPany companybll = new Maticsoft.BLL.ComPany(); Maticsoft.Model.ComPany commodel = new Maticsoft.Model.ComPany(); if (txtcompanyname.Text.Trim() == "") { lblconname.Text = "请填写公司名称"; return; } lblconname.Text = ""; commodel.CompanyNames = txtcompanyname.Text.Trim(); if (txtcompanytype.Text.Trim() == "") { lbltype.Text = "请填写公司类型"; return; } lbltype.Text = ""; commodel.CompanyType = txtcompanytype.Text.Trim(); if (txtcomaddress.Text.Trim() == "") { lbladdress.Text = "请填写公司地址"; return; } lbladdress.Text = ""; commodel.ComAddress = txtcomaddress.Text.Trim(); if (txtcomfax.Text.Trim() == "") { lblfax.Text = "请填写公司传真"; return; } lblfax.Text = ""; commodel.ComFax = txtcomfax.Text.Trim(); if (txtcomfaren.Text.Trim() == "") { lblfanren.Text = "请填写公司法人代表"; return; } lblfanren.Text = ""; commodel.Fanren = txtcomfaren.Text.Trim(); if (txtcomphoto.Text.Trim() == "") { lblphoto.Text = "请填写公司电话"; return; } lblphoto.Text = ""; commodel.ComPhoto = txtcomphoto.Text.Trim(); if (txtEmail.Text.Trim() == "") { lblemail.Text = "请填写公司邮箱"; return; } lblemail.Text = ""; commodel.ComEmail = txtEmail.Text.Trim(); if (txtqq.Text.Trim() == "") { lblqq.Text = "请填写公司qq或MSN"; return; } lblqq.Text = ""; commodel.QQ = txtqq.Text.Trim(); if (txtcomwangzhi.Text.Trim() == "") { lblwangzhi.Text = "请填写公司网址"; return; } lblwangzhi.Text = ""; commodel.Comwangzhi = txtcomwangzhi.Text.Trim(); if (txtcontent.Text.Trim() == "") { lblcomcontent.Text = "请填写公司简介"; } lblcomcontent.Text = ""; commodel.comconten = txtcontent.Text.Trim(); companybll.Add(commodel); Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('信息添加成功....')</script>"); txtcomaddress.Text = string.Empty; txtcomfaren.Text = string.Empty; txtcomfax.Text = string.Empty; txtcompanyname.Text = string.Empty; txtcompanytype.Text = string.Empty; txtcomphoto.Text = string.Empty; txtcomwangzhi.Text = string.Empty; txtcontent.Text = string.Empty; txtEmail.Text = string.Empty; txtqq.Text = string.Empty; }
public void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtCompanyNames.Text.Trim().Length == 0) { strErr += "CompanyNames不能为空!\\n"; } if (this.txtCompanyType.Text.Trim().Length == 0) { strErr += "CompanyType不能为空!\\n"; } if (this.txtComAddress.Text.Trim().Length == 0) { strErr += "ComAddress不能为空!\\n"; } if (this.txtComFax.Text.Trim().Length == 0) { strErr += "ComFax不能为空!\\n"; } if (this.txtComPhoto.Text.Trim().Length == 0) { strErr += "ComPhoto不能为空!\\n"; } if (this.txtComEmail.Text.Trim().Length == 0) { strErr += "ComEmail不能为空!\\n"; } if (this.txtQQ.Text.Trim().Length == 0) { strErr += "QQ不能为空!\\n"; } if (this.txtComwangzhi.Text.Trim().Length == 0) { strErr += "Comwangzhi不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } int CompanyID = int.Parse(this.lblCompanyID.Text); string CompanyNames = this.txtCompanyNames.Text; string CompanyType = this.txtCompanyType.Text; string ComAddress = this.txtComAddress.Text; string ComFax = this.txtComFax.Text; string ComPhoto = this.txtComPhoto.Text; string ComEmail = this.txtComEmail.Text; string QQ = this.txtQQ.Text; string Comwangzhi = this.txtComwangzhi.Text; Maticsoft.Model.ComPany model = new Maticsoft.Model.ComPany(); model.CompanyID = CompanyID; model.CompanyNames = CompanyNames; model.CompanyType = CompanyType; model.ComAddress = ComAddress; model.ComFax = ComFax; model.ComPhoto = ComPhoto; model.ComEmail = ComEmail; model.QQ = QQ; model.Comwangzhi = Comwangzhi; Maticsoft.BLL.ComPany bll = new Maticsoft.BLL.ComPany(); bll.Update(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx"); }