//owner approval
        public void Approve(SuppliersView model)
        {
            using (var supplier = new SuppliersRepository())
            {
                var supp = supplier.GetById(model.SupplierId);
                if (supp != null)
                {
                    supp.SupplierId = model.SupplierId;
                    supp.Status = model.Status;
                    supp.SupplierId = supp.SupplierId;
                    supp.EmailAddress = supp.EmailAddress;
                    supp.PhysicalAddress = supp.PhysicalAddress;
                    supp.ShortCode = supp.ShortCode;
                    supp.SupplierCellNo = supp.SupplierCellNo;
                    supp.SupplierLastName = supp.SupplierLastName;
                    supp.SupplierName = supp.SupplierName;
                    supp.UserId = supp.UserId;
                    supp.SupplierTelNo = model.SupplierTelNo;

                    supplier.Update(supp);
                }
            }
        }
 public SuppliersView GetSupplierById(int id)
 {
     using (var supplier = new SuppliersRepository())
     {
         Suppliers supp = supplier.GetById(id);
         var suppView = new SuppliersView();
         if (supp != null)
         {
             suppView.SupplierId = supp.SupplierId;
             suppView.EmailAddress = supp.EmailAddress;
             suppView.Status = supp.Status;
             suppView.PhysicalAddress = supp.PhysicalAddress;
             suppView.ShortCode = supp.ShortCode;
             suppView.SupplierCellNo = supp.SupplierCellNo;
             suppView.SupplierLastName = supp.SupplierLastName;
             suppView.SupplierName = supp.SupplierName;
             suppView.UserId = supp.UserId;
             suppView.SupplierTelNo = supp.SupplierTelNo;
         }
         return suppView;
     }
 }