public ActionResult Index(RawItemMasterViewModel RIMViewModel, string value) { // Search RIMViewModel = RawItemMasterManager.SearchSingleRawItem(value); RIMViewModel.HasSearched = true; RIMViewModel.RawItemMasterList = RawItemMasterManager.GetRawItems("ALL"); return(View(RIMViewModel)); }
public ActionResult Index(MenuRecipeViewModel MRViewModel, string value) { MRViewModel = MenuRecipeManager.SearchMenuRecipe(value); MRViewModel.MenuItemList = MenuRecipeManager.SearchMenuItem("ALL"); MRViewModel.RawItemList = RawItemMasterManager.GetRawItems("ALL"); MRViewModel.HasSearched = true; return(View(MRViewModel)); }
public ItemGroupViewModel() { ItemList = new List <Item>(); StoreList = new List <Item>(); AllStoreList = new StoreProfileManager().SearchStores("ALL"); MenuItemList = MenuItemMasterManager.SearchMenuItems("ALL"); RawItemList = RawItemMasterManager.GetRawItems("ALL"); RecipeList = MenuRecipeManager.SearchMenuItem("ALL"); GroupList = new List <ItemGroupViewModel>(); }
public static List <RawItem> GetFilteredRawItem() { using (CFMMCDEntities db = new CFMMCDEntities()) { List <RawItem> RIList = RawItemMasterManager.GetRawItems("ALL"); List <ITMGRP> IGRows = db.ITMGRPs.ToList(); foreach (var v in IGRows) { RIList.RemoveAll(o => o.RIMRIC.Equals(v.Item_Code.ToString())); } return(RIList); } }
public SCMRecipeViewModel() { RIMRIC = new List <string>(); RIMRID = new List <string>(); CSMSFQ = new List <string>(); RIMCPR = new List <string>(); CSMCWC = new List <string>(); StoAtt = new List <string>(); CSMID = new List <string>(); RIMRIC.Add(""); RIMRID.Add(""); CSMSFQ.Add(""); RIMCPR.Add(""); CSMCWC.Add(""); StoAtt.Add(""); CSMID.Add(""); RawItemList = new List <SCMRawItem>(); AllRawItems = RawItemMasterManager.GetRawItems("ALL"); //* }
/* * Default method. * TempData is used to store the ViewModel after a Search action. */ public ActionResult Index(string id) { // Validate log in and user access UserAccessSession UASession = (UserAccessSession)Session["UserAccess"]; if (UASession == null || !UASession.RIM) { return(RedirectToAction("Login", "Account")); } // Set NavBar Links accordingly Session["CurrentPage"] = new CurrentPageSession("RIM", "HOME", "LOG"); // SearchItemSelected is assigned value at DisplaySearchResult RawItemMasterViewModel RIMViewModel = new RawItemMasterViewModel(); if (id != null) { RIMViewModel = RawItemMasterManager.SearchSingleRawItem(id); } RIMViewModel.RawItemMasterList = RawItemMasterManager.GetRawItems("ALL"); return(View(RIMViewModel)); }
// GET: MenuRecipe public ActionResult Index(string id) { UserAccessSession UASession = (UserAccessSession)Session["UserAccess"]; if (UASession == null || !UASession.MER) { return(RedirectToAction("Login", "Account")); } // Set NavBar Links accordingly Session["CurrentPage"] = new CurrentPageSession("MER", "HOME", "LOG"); // SearchItemSelected is assigned value at DisplaySearchResult MenuRecipeViewModel MRViewModel = new MenuRecipeViewModel(); if (id != null) { MRViewModel = MenuRecipeManager.SearchMenuRecipe(id); MRViewModel.HasSearched = true; } MRViewModel.MenuItemList = MenuRecipeManager.SearchMenuItem("ALL"); MRViewModel.RawItemList = RawItemMasterManager.GetRawItems("ALL"); return(View(MRViewModel)); }
public ActionResult UpdateDelete(RawItemMasterViewModel RIMViewModel, string command) { UserSession user = (UserSession)Session["User"]; string PageAction = ""; bool result = false; if (Request.Files.Count > 0) { HttpPostedFileBase file = Request.Files["FileUploaded"]; if ((file != null) && (file.ContentLength > 0) && !string.IsNullOrEmpty(file.FileName)) { ReportViewModel report = RawItemMasterManager.ImportExcel(file.InputStream, user.Username); PageAction = "Import"; result = report.Result; if (!result) { if (report.ErrorLevel == 2) { PageAction = report.Message + ": Import partially"; } else { PageAction = report.Message + ": Import"; } } else { PageAction = report.Message + ": Import"; } } } if (command == null && !(RIMViewModel.SwitchItem == null)) { result = RawItemMasterManager.SwitchRawItem(RIMViewModel.RIMRIC, RIMViewModel.SwitchItem, user.Username); PageAction = "Switch"; } if (command == "Save") { result = RawItemMasterManager.UpdateRawItem(RIMViewModel, user.Username); PageAction = "Update"; if (!RIMViewModel.HasSearched) { PageAction = "Create"; } } else if (command == "Delete") { result = RawItemMasterManager.DeleteRawItem(RIMViewModel); PageAction = "Delete"; } if (result) { TempData["SuccessMessage"] = PageAction + " successful"; if (PageAction.Equals("Switch") || PageAction.Equals("Update") || PageAction.Equals("Create")) { new AuditLogManager().Audit(user.Username, DateTime.Now, "Raw Item Master", PageAction, RIMViewModel.RIMRIC, RIMViewModel.RIMRID); } if (RIMViewModel.RIMRIC != null && !RIMViewModel.RIMRIC.Equals("") && !PageAction.Equals("Delete")) { return(RedirectToAction("Index", new { id = RIMViewModel.RIMRIC })); } } else { TempData["ErrorMessage"] = PageAction + " failed"; } return(RedirectToAction("Index")); }