Ejemplo n.º 1
0
        protected void btn_sure_Click(object sender, EventArgs e)
        {
            Company         company  = this.AddCompany();
            CompanyProvider provider = new CompanyProvider();

            switch (this.OperationFlag)
            {
            case Operation.Add:
                if (this.IsSame() == 1)
                {
                    break;
                }
                if (provider.Insert(company))
                {
                    this.Alert("添加成功!!!");
                    this.TextCancel();
                }
                break;

            case Operation.Update:
                if (provider.Update(company))
                {
                    this.Alert("修改成功!!!");
                    this.BindText();
                }
                break;
            }
        }