protected void btn_sure_Click(object sender, EventArgs e) { Units units = this.AddUnit(); UnitProvider provider = new UnitProvider(); switch (this.OperationFlag) { case Operation.Add: if (this.IsSame() == 1) { break; } if (provider.Insert(units)) { this.Alert("添加成功!!!"); this.TextCancel(); } break; case Operation.Update: if (provider.Update(units)) { this.Alert("修改成功!!!"); this.BindText(); } break; } }