Esempio n. 1
0
 public string Add(Customer customer)
 {
     CustomerDao dao = new CustomerDao();
     customer.Enabled = 1;
     customer.IsDeleted = 0;
     return dao.Add(customer);
 }
Esempio n. 2
0
 public string Add(Customer form)
 {
     UserBLL userbll = new UserBLL();
     string userid = userbll.GetCurrentUser().User.ID;
     form.Creator = form.LastUpdator = userid;
     return bll.Add(form);
 }
Esempio n. 3
0
 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;
 }
Esempio n. 4
0
 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);
 }