Example #1
0
 private void ShowInfo(string compantNo)
 {
     BookShop.BLL.Company   bll   = new BookShop.BLL.Company();
     BookShop.Model.Company model = bll.GetModel(compantNo);
     this.lblcompantNo.Text     = model.compantNo;
     this.lblcompanyName.Text   = model.companyName;
     this.lbladdress.Text       = model.address;
     this.lblzipCode.Text       = model.zipCode;
     this.lblcontactPerson.Text = model.contactPerson;
     this.lbltelephone.Text     = model.telephone;
     this.lblfax.Text           = model.fax;
     this.lblemail.Text         = model.email;
 }
Example #2
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.txtcompanyName.Text.Trim().Length == 0)
            {
                strErr += "companyName不能为空!\\n";
            }
            if (this.txtaddress.Text.Trim().Length == 0)
            {
                strErr += "address不能为空!\\n";
            }
            if (this.txtzipCode.Text.Trim().Length == 0)
            {
                strErr += "zipCode不能为空!\\n";
            }
            if (this.txtcontactPerson.Text.Trim().Length == 0)
            {
                strErr += "contactPerson不能为空!\\n";
            }
            if (this.txttelephone.Text.Trim().Length == 0)
            {
                strErr += "telephone不能为空!\\n";
            }
            if (this.txtfax.Text.Trim().Length == 0)
            {
                strErr += "fax不能为空!\\n";
            }
            if (this.txtemail.Text.Trim().Length == 0)
            {
                strErr += "email不能为空!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            string compantNo     = this.lblcompantNo.Text;
            string companyName   = this.txtcompanyName.Text;
            string address       = this.txtaddress.Text;
            string zipCode       = this.txtzipCode.Text;
            string contactPerson = this.txtcontactPerson.Text;
            string telephone     = this.txttelephone.Text;
            string fax           = this.txtfax.Text;
            string email         = this.txtemail.Text;


            BookShop.Model.Company model = new BookShop.Model.Company();
            model.compantNo     = compantNo;
            model.companyName   = companyName;
            model.address       = address;
            model.zipCode       = zipCode;
            model.contactPerson = contactPerson;
            model.telephone     = telephone;
            model.fax           = fax;
            model.email         = email;

            BookShop.BLL.Company bll = new BookShop.BLL.Company();
            bll.Update(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx");
        }