public string Add(Customer customer) { CustomerDao dao = new CustomerDao(); customer.Enabled = 1; customer.IsDeleted = 0; return dao.Add(customer); }
public string Add(Customer form) { UserBLL userbll = new UserBLL(); string userid = userbll.GetCurrentUser().User.ID; form.Creator = form.LastUpdator = userid; return bll.Add(form); }
public Customer Save(Customer customer) { CustomerDao customerdao = new CustomerDao(); Customer c = null; if (string.IsNullOrEmpty(customer.ID)) { customer.IsDeleted = 0; customer.Enabled = 1; customerdao.Add(customer); c = customer; } else { c = customerdao.Query(new CustomerQueryForm { ID = customer.ID, IsDeleted = 0, Enabled = 1 }).FirstOrDefault(); if (c == null) { customer.IsDeleted = 0; customer.Enabled = 1; customerdao.Add(customer); c = customer; } else { customerdao.Update(new CustomerUpdateForm { Entity = new Customer { Name = customer.Name, Phone = customer.Phone, IdentityCode = customer.IdentityCode, Remark = customer.Remark, }, CustomerQueryForm = new CustomerQueryForm { ID = c.ID }, }); } } return c; }
public bool Update(Customer form) { UserBLL userbll = new UserBLL(); string userid = userbll.GetCurrentUser().User.ID; form.LastUpdator = userid; CustomerUpdateForm updateform = new CustomerUpdateForm { Entity = form, CustomerQueryForm = new CustomerQueryForm { ID = form.ID }, }; return bll.Update(updateform); }