public ActionResult Index() { SupplierViewModel _supplierViewModel = new SupplierViewModel(); _supplierViewModel.Suppliers = _supplierManager.GetAll(); return(View(_supplierViewModel)); }
public ActionResult ListAdd(int id) { Expression <Func <InStorage, bool> > where = i => i.Id == id; var s = instorage.GetByWhere(where).SingleOrDefault(); //供应商 var gys = GonYinShang.GetAll(); gys.Insert(0, new Supplier() { Id = 9999, SupplierName = "请选择供应商" }); ViewBag.SupplierId = new SelectList(gys, "Id", "SupplierName", s.SupplierId); //退货类型 var type = returnOrderType.GetAll(); type.Insert(0, new ReturnOrderType() { Id = 9999, ReturnTypeName = "请选择退货类型" }); ViewBag.ReturnTypeId = new SelectList(type, "Id", "ReturnTypeName"); //产品 var product_1 = product.GetAll(); product_1.Insert(0, new Product() { Id = 9999, ProductName = "请选择产品" }); ViewBag.Product = new SelectList(product_1, "Id", "ProductName"); return(View(s)); }
public ActionResult AddPurchase() { PurchaseViewModel purchaseViewModel = new PurchaseViewModel(); purchaseViewModel.SupplierSelectListItems = _supplierManager.GetAll().Select(c => new SelectListItem { Value = c.Id.ToString(), Text = c.Name }).ToList(); purchaseViewModel.CategorySelectListItems = _categoryManager.GetAll().Select(c => new SelectListItem { Value = c.Id.ToString(), Text = c.Name }).ToList(); ViewBag.Category = purchaseViewModel.CategorySelectListItems; //purchaseViewModel.ProductSelectListItems = _productManager.GetAll().Select(c => new SelectListItem // { // Value = c.Id.ToString(), // Text = c.Name // }).ToList(); //if(purchaseViewModel.ProductSelectListItems) return(View(purchaseViewModel)); }
public ActionResult Add() { PurchaseViewModel purchaseViewModel = new PurchaseViewModel(); purchaseViewModel.PurchaseDetails = purchaseDetails; purchaseViewModel.SupplierSelectListItems = _supplierManager.GetAll() .Select(c => new SelectListItem() { Value = c.Id.ToString(), Text = c.Name }).ToList(); purchaseViewModel.CategorySelectListItems = _categoryManager.GetAll() .Select(c => new SelectListItem() { Value = c.Id.ToString(), Text = c.Name }).ToList(); purchaseViewModel.ProductSelectListItems = _productManager.GetAll() .Select(c => new SelectListItem() { Value = c.Id.ToString(), Text = c.Name }).ToList(); ViewBag.itemCategoryID = purchaseViewModel.CategorySelectListItems; ViewBag.itemProductID = purchaseViewModel.ProductSelectListItems; return(View(purchaseViewModel)); }
public ActionResult Add() { SupplierViewModel supplierViewModel = new SupplierViewModel(); supplierViewModel.Suppliers = _supplierManager.GetAll(); return(View(supplierViewModel)); }
public ActionResult Add() { _purchaseViewModel.SupplierSelectListItems = _supplierManager .GetAll() .Select(c => new SelectListItem() { Value = c.Id.ToString(), Text = c.Name }).ToList(); ViewBag.Supplier = _purchaseViewModel.SupplierSelectListItems; _purchaseViewModel.CategorySelectListItems = _categoryManager .GetAll() .Select(c => new SelectListItem() { Value = c.Id.ToString(), Text = c.Name }).ToList(); ViewBag.Category = _purchaseViewModel.CategorySelectListItems; //var ProductSelectListItems = _productManager // .GetAll() // .Select(c => new SelectListItem() // { // Value = c.Id.ToString(), // Text = c.Name // }).ToList(); return(View()); }
public ActionResult Show() { SupplierModelView supplierVm = new SupplierModelView(); supplierVm.Suppliers = supplierManager.GetAll(); return(View(supplierVm)); }
public ActionResult Add() { SupplierViewModel viewModel = new SupplierViewModel(); viewModel.Suppliers = _manager.GetAll(); return(View(viewModel)); }
public ActionResult Details(SupplierVM supplierVM, HttpPostedFileBase image) { Supplier supplier = new Supplier(); supplier = Mapper.Map <Supplier>(supplierVM); var suppliers = _supplierManager.GetAll(); return(View(supplierVM)); }
public ActionResult InsertPurchaseProduct() { var suppliers = _supplierManager.GetAll(); ViewBag.Suppliers = new SelectList(suppliers, "Id", "Name"); var products = _productManager.GetProducts(); ViewBag.Products = new SelectList(products, "ProductId", "ProductName"); return(View()); }
public ActionResult Show() { SupplierView supplierView = new SupplierView { Suppliers = _supplierManager.GetAll() }; ViewBag.Show = "Show"; ViewBag.ActionName = "Add"; return(View(supplierView)); }
public ActionResult PurchaseIn() { var model = new PurchaseViewModel(); model.Categories = _categoryManager.GetAll(); model.Suppliers = _supplierManager.GetAll(); ViewBag.ProductDropDown = new SelectListItem[] { new SelectListItem() { Value = "", Text = "Select..." } }; return(View(model)); }
private void btnSearch_Click(object sender, EventArgs e) { var result = _manager.GetAll(); gvSuppliers.AutoGenerateColumns = false; gvSuppliers.DataSource = result; }
public ActionResult Create() { string code = _purchaseManager.GetLastPurchaseCode(); string year = DateTime.Parse(DateTime.Now.ToString()).Year.ToString(); if (code == null) { code = year + "-0001"; } else { string[] afterSplit = code.Split('-'); string serialNo = afterSplit[afterSplit.Length - 1]; int number = int.Parse(serialNo); code = year + "-" + (++number).ToString("D" + serialNo.Length); } PurchaseDetailsViewModel model = new PurchaseDetailsViewModel { Suppliers = _supplierManager.GetAll(), Categories = _categoryManager.GetAll(), //PurchaseDetail = new PurchaseDetail(), Code = code }; return(View(model)); }
public ActionResult ViewSupplier(Supplier supplier) { SupplierManager _supplierManager = new SupplierManager(); ModelState.Clear(); return(View(_supplierManager.GetAll())); }
private void InitRecord() { Cursor.Current = Cursors.WaitCursor; supplierBindingSource.DataSource = SupplierManager.GetAll(); categoryBindingSource.DataSource = CategoryManager.GetAll(); drugTypeBindingSource.DataSource = DrugTypeManager.GetAll(); Cursor.Current = Cursors.Default; }
public ActionResult Add() { PurchaseViewModel purchasevm = new PurchaseViewModel(); purchasevm.SupplierList = _supplierManager.GetAll().Select(c => new SelectListItem() { Value = c.ID.ToString(), Text = c.Name }); purchasevm.ProductList = _productManager.GetAll().Select(c => new SelectListItem() { Value = c.ID.ToString(), Text = c.Name }); return(View(purchasevm)); }
public ActionResult Entry() { PurchaseViewModel purchaseViewModel = new PurchaseViewModel(); purchaseViewModel.SupplierSelectListItems = _supplierManager.GetAll().Select(c => new SelectListItem() { Value = c.Id.ToString(), Text = c.Name }); purchaseViewModel.ProductSelectListItems = _productManager.GetAll().Select(c => new SelectListItem() { Value = c.Id.ToString(), Text = c.Name }); return(View(purchaseViewModel)); }
/// <summary> /// 入库管理 /// </summary> /// <returns></returns> // GET: InStorages public ActionResult List() { //供应商 var gys = GonYinShang.GetAll(); gys.Insert(0, new Supplier() { Id = 99999999, SupplierName = "请选择供应商" }); ViewBag.SupplierId = new SelectList(gys, "Id", "SupplierName"); //单据类型 var lty = inStorageType.GetAll(); lty.Insert(0, new InStorageType() { Id = 9999, InSTypeName = "请选择入库单类型" }); ViewBag.InSTypeId = new SelectList(lty, "Id", "InSTypeName"); return(View()); }
private void InitRecord() { Cursor.Current = Cursors.WaitCursor; supplierBindingSource.DataSource = SupplierManager.GetAll(); categoryBindingSource.DataSource = CategoryManager.GetAll(); unitBindingSource.DataSource = UnitManager.GetAll(); drugTypeBindingSource.DataSource = DrugTypeManager.GetAll(); packingBindingSource.DataSource = PackingManager.GetAll(); _listProducts = ProductManager.GetAll(); productBindingSource.DataSource = _listProducts; Cursor.Current = Cursors.Default; }
// GET: Supplier public ActionResult Index(string search) { SupplierListViewModel model = new SupplierListViewModel(); model.Suppliers = _supplierManager.GetAll(); if (!String.IsNullOrEmpty(search)) { model.Suppliers = _supplierManager.Search(search); } model.Search = search; return(View(model)); }
public ActionResult AddPurchase() { PurchaseViewModel purchaseViewModel = new PurchaseViewModel(); PurchaseDetailsViewModel purchaseDetailsViewModel = new PurchaseDetailsViewModel(); purchaseViewModel.SupplierSelectListItems = _supplierManager .GetAll() .Select(c => new SelectListItem() { Value = c.Id.ToString(), Text = c.Name }).ToList(); purchaseDetailsViewModel.CategorySelectListItems = _categoryManager .GetAll() .Select(c => new SelectListItem() { Value = c.Id.ToString(), Text = c.Name }).ToList(); ViewBag.CategoryId = purchaseDetailsViewModel.CategorySelectListItems; purchaseViewModel.Purchases = _purchaseManager.GetAllPurchase(); return(View(purchaseViewModel)); }
public ActionResult Add() { purchaseVM.Suppliers = supplierManager.GetAll(); purchaseVM.Products = productManager.GetAll(); return(View(purchaseVM)); //purchaseVm.SupplierSelectListItem = supplierManager.GetAll() // .Select(c => new SelectListItem() // { // Value = c.Id.ToString(), // Text = c.SupplierName // }) // .ToList(); //purchaseVm.ProductSelectListItem = productManager.GetAll() // .Select(c => new SelectListItem() // { // Value = c.Id.ToString(), // Text = c.ProductName // }) // .ToList(); //return View(purchaseVm); }
private void FillComboBox(PurchaseModelView purchaseModelView) { purchaseModelView.CategorySelectListItems = _categoryManager.GetAll() .Select(c => new SelectListItem() { Value = c.Id.ToString(), Text = c.Name }).ToList(); purchaseModelView.SupplierSelectListItems = _supplierManager.GetAll() .Select(c => new SelectListItem() { Value = c.Id.ToString(), Text = c.Name }).ToList(); purchaseModelView.ProductSelectListItems = new List <SelectListItem>(); }
// GET: Home public ActionResult Index() { HomeView homeView = new HomeView(); var CategoryNumber = _categoryManager.GetAll().Count(); var ProductNumber = _productManager.GetAll().ToList().Count(); var CustomerNumber = _customerManager.GetAll().ToList().Count(); var SupplierNumber = _supplierManager.GetAll().ToList().Count(); ViewBag.CatNumber = CategoryNumber; ViewBag.ProNumber = ProductNumber; ViewBag.CusNumber = CustomerNumber; ViewBag.SupNumber = SupplierNumber; return(View()); //return View(homeView); }
// GET: Supplier public ActionResult Index() { var suppliers = _supplierManager.GetAll(); List <SupplierViewModel> supplierVm = new List <SupplierViewModel>(); foreach (var supplierPersion in suppliers) { var supplier = new SupplierViewModel(); supplier.Id = supplierPersion.Id; supplier.Name = supplierPersion.Name; supplier.Code = supplierPersion.Code; supplier.Contact = supplierPersion.Contact; supplier.ContactPerson = supplierPersion.ContactPerson; supplier.Address = supplierPersion.Address; supplier.Image = supplierPersion.Image; supplierVm.Add(supplier); } return(View(supplierVm)); }
private void PurchaseInitialize() { aPurchaseView.PurchaseInfo = new PurchaseInfo { Date = DateTime.Today }; aPurchaseView.CategorySelectListItems = _categoryManager .GetAll() .Select(c => new SelectListItem() { Value = c.Id.ToString(), Text = c.Name } ).ToList(); aPurchaseView.SupplierSelectListItems = _supplierManager .GetAll() .Select(s => new SelectListItem() { Value = s.Id.ToString(), Text = s.Name } ).ToList(); }
public ActionResult Show() { _supplierVM.Suppliers = _supplierManager.GetAll(); return(View(_supplierVM)); }
public ActionResult Add() { _supplier.Suppliers = _supplierManager.GetAll(); return(View(_supplier)); }
static void Main(string[] args) { SupplierManager _supplierManager = new SupplierManager(); Console.WriteLine("----------Supplier----------"); Console.WriteLine("--Save=>Press(1)--Delete=>Press(2)--Update=>Press(3)--ShowAll=>Press(4)--ShowById=>Press(5)"); int save = 1; int delete = 2; int update = 3; int showAll = 4; int showById = 5; int check = Convert.ToInt32(Console.ReadLine()); Supplier _supplier = new Supplier() { //Code = Console.ReadLine(), //Name = Console.ReadLine(), //Address = Console.ReadLine(), //Email = Console.ReadLine(), //Person = Console.ReadLine(), //PersonContact = Console.ReadLine(), //Code = "001", //Name = "Rakib", //Address = "Dhaka", //Email = "*****@*****.**", //Person = "Ibrahimn", //PersonContact = "0147852368" }; if (save == check) { Console.WriteLine("---Enter Code---"); _supplier.Code = Console.ReadLine(); Console.WriteLine("---Enter Name---"); _supplier.Name = Console.ReadLine(); Console.WriteLine("---Enter Address---"); _supplier.Address = Console.ReadLine(); Console.WriteLine("---Enter Email---"); _supplier.Email = Console.ReadLine(); Console.WriteLine("---Enter Person---"); _supplier.Person = Console.ReadLine(); Console.WriteLine("---Enter Person Contact---"); _supplier.PersonContact = Console.ReadLine(); if (_supplierManager.Add(_supplier)) { Console.WriteLine("Supplier Data Save Successfully !!"); } else { Console.WriteLine("Not Save!!"); } Console.ReadKey(); } else if (delete == check) { Console.WriteLine("---Enter Id Which Row Do You Want To delete ---"); int deleteById = Convert.ToInt32(Console.ReadLine()); if (_supplierManager.Delete(deleteById)) { Console.WriteLine("Delete Successfully !!"); } else { Console.WriteLine("Not Delete!!"); } Console.ReadKey(); } else if (update == check) { Console.WriteLine("---Enter Id Which Row Do You Want To Update ---"); int updateById = Convert.ToInt32(Console.ReadLine()); _supplier.Id = updateById; Console.WriteLine("---Enter Code---"); _supplier.Code = Console.ReadLine(); Console.WriteLine("---Enter Name---"); _supplier.Name = Console.ReadLine(); Console.WriteLine("---Enter Address---"); _supplier.Address = Console.ReadLine(); Console.WriteLine("---Enter Email---"); _supplier.Email = Console.ReadLine(); Console.WriteLine("---Enter Person---"); _supplier.Person = Console.ReadLine(); Console.WriteLine("---Enter Person Contact---"); _supplier.PersonContact = Console.ReadLine(); if (_supplierManager.Update(_supplier)) { Console.WriteLine("Supplier Data Update Successfully !!"); } else { Console.WriteLine("Not Update!!"); } Console.ReadKey(); } else if (showAll == check) { var suppliers = _supplierManager.GetAll(); foreach (Supplier supplier in suppliers) { Console.WriteLine("------------------------------------------------------------"); Console.WriteLine(supplier.Code + " " + supplier.Name + " " + supplier.Email + " " + supplier.Person + " " + supplier.PersonContact); } Console.ReadKey(); } else if (showById == check) { Console.WriteLine("---Enter Id Which Row Do You Want To Show ---"); int updateById = Convert.ToInt32(Console.ReadLine()); var supplier = _supplierManager.GetById(updateById); Console.WriteLine(supplier.Code + " " + supplier.Name + " " + supplier.Address + " " + supplier.Email + " " + supplier.Person + " " + supplier.PersonContact); Console.WriteLine(); Console.ReadKey(); } }