public int CreateCustomerOnly(Customer entity)
        {
            string sql = "insert into Customer(code) values(@code) ";

            SqlParameter[] param = new SqlParameter[1];
            param[0] = new SqlParameter("@code", SqlDbType.NVarChar, 50);
            param[0].Value = entity.Code;
            return sqlHelperDao.Create(sql, param);
        }
Esempio n. 2
0
 public void CreateCustomer(Customer entity, User currentUser)
 {
     if (partyDao.LoadParty(entity.Code) == null)
     {
         base.CreateCustomer(entity);
     }
     else
     {
         CreateCustomerOnly(entity);
     }
     Permission permission = new Permission();
     permission.Category = permissionCategoryMgr.LoadPermissionCategory(BusinessConstants.CODE_MASTER_PERMISSION_CATEGORY_TYPE_VALUE_CUSTOMER);
     permission.Code = entity.Code;
     permission.Description = entity.Name;
     permissionMgr.CreatePermission(permission);
     UserPermission userPermission = new UserPermission();
     userPermission.Permission = permission;
     userPermission.User = currentUser;
     userPermissionMgr.CreateUserPermission(userPermission);
 }
 public virtual void DeleteCustomer(Customer entity)
 {
     Delete(entity);
 }
 public virtual void UpdateCustomer(Customer entity)
 {
     Update(entity);
 }
 public virtual void CreateCustomer(Customer entity)
 {
     Create(entity);
 }
Esempio n. 6
0
 public override void CreateCustomer(Customer entity)
 {
     CreateCustomer(entity, userMgr.GetMonitorUser());
 }
Esempio n. 7
0
 public override void DeleteCustomer(Customer customer)
 {
     DeleteCustomer(customer.Code);
 }
Esempio n. 8
0
 public void DeleteCustomer(Customer customer)
 {
     CustomerMgr.DeleteCustomer(customer);
 }
Esempio n. 9
0
 public void UpdateCustomer(Customer customer)
 {
     CustomerMgr.UpdateCustomer(customer);
 }
Esempio n. 10
0
 public void CreateCustomer(Customer customer)
 {
     CustomerMgr.CreateCustomer(customer);
 }
 public virtual void DeleteCustomer(Customer entity)
 {
     entityDao.DeleteCustomer(entity);
 }
 public virtual void UpdateCustomer(Customer entity)
 {
     entityDao.UpdateCustomer(entity);
 }
 public virtual void CreateCustomer(Customer entity)
 {
     entityDao.CreateCustomer(entity);
 }
Esempio n. 14
0
        private object Deserialize(DssImportHistory dssImportHistory)
        {
            Customer customer = new Customer();
            customer.Code = dssImportHistory[1].ToUpper();
            customer.Name = dssImportHistory[2];

            ShipAddress shipAddress = new ShipAddress();
            shipAddress.Code = "S_" + customer.Code.ToUpper();
            shipAddress.Address = dssImportHistory[3];
            shipAddress.ContactPersonName = dssImportHistory[12];
            shipAddress.TelephoneNumber = dssImportHistory[13] + dssImportHistory[14];
            shipAddress.Fax = dssImportHistory[15];
            shipAddress.MobilePhone = dssImportHistory[17] + dssImportHistory[18];
            shipAddress.PostalCode = dssImportHistory[8];
            shipAddress.Party = customer;

            BillAddress billAddress = new BillAddress();
            billAddress.Code = "B_"+customer.Code.ToUpper() ;
            billAddress.Address = dssImportHistory[3];
            billAddress.ContactPersonName = dssImportHistory[12];
            billAddress.TelephoneNumber = dssImportHistory[13] + dssImportHistory[14];
            billAddress.Fax = dssImportHistory[15];
            billAddress.MobilePhone = dssImportHistory[17] + dssImportHistory[18];
            billAddress.PostalCode = dssImportHistory[8];
            billAddress.Party = customer;

            IList<object> list = new List<object>();
            list.Add(customer);
            list.Add(shipAddress);
            list.Add(billAddress);
            return list;
        }