コード例 #1
0
        public void AddNewSupplier(SuppliersView model, string userId)
        {
            using (var supplier = new SuppliersRepository())
            {
                var supp = new Suppliers
                {
                    SupplierId = model.SupplierId,
                    EmailAddress = model.EmailAddress,
                    PhysicalAddress = model.PhysicalAddress,
                    Status = "Waiting For Approval",
                    SupplierCellNo = model.SupplierCellNo,
                    SupplierLastName = model.SupplierLastName,
                    SupplierName = model.SupplierName,
                    SupplierTelNo = model.SupplierTelNo,
                    UserId = userId,
                    ShortCode = ""
                };
                supplier.Insert(supp);

                //update
                supp.ShortCode = (Guid.NewGuid().ToString().Substring(0, 4) + "-" + supp.SupplierId + "-"
                                  + model.SupplierName.Substring(0, 1) + model.SupplierLastName.Substring(0, 1)).ToUpper();
                supplier.Update(supp);

            }
        }
コード例 #2
0
 public void Update(Suppliers model)
 {
     _suppliersRepository.Update(model);
 }
コード例 #3
0
 public void Insert(Suppliers model)
 {
     _suppliersRepository.Insert(model);
 }
コード例 #4
0
 public void Delete(Suppliers model)
 {
     _suppliersRepository.Delete(model);
 }