private CuCustomerEntity PrepareFormData() { //TODO:需要校验参数的合法性 txtCuId.Text.InitValidation("编号").NotEmpty().ShorterThan(25); txtCuName.Text.InitValidation("姓名").NotEmpty().ShorterThan(25); txtDistrict.Text.InitValidation("地区").NotEmpty().ShorterThan(25); txtAddress.Text.InitValidation("地址").ShorterThan(250); txtRemark.Text.InitValidation("备注").ShorterThan(1000); var entity = new CuCustomerEntity(); entity.CuId = txtCuId.Text; entity.CuName = txtCuName.Text; entity.District = txtDistrict.Text; entity.Address = txtAddress.Text; entity.Remark = txtRemark.Text; entity.ActivityFlag = rEnabled.Checked; return entity; }
public void AddNewCuCustomer(CuCustomerEntity entity) { entity.DeleteFlag = false; entity.Insert(); }
public void UpdateCuCustomer(CuCustomerEntity entity) { entity.Update(); }
public void DeleteCuCustomer(string cuId) { CuCustomerEntity entity = new CuCustomerEntity() {CuId = cuId, DeleteFlag = true}; entity.Update(); }