public ActionResult Generate() { var monthYear = DateTime.Now.Month.ToString("D2") + Convert.ToInt32(DateTime.Now.Year.ToString().Substring(2, 2)).ToString("D2"); var productionDateCodes = _iCommonManager.GetProductionDateCodeByMonthYear(monthYear).ToList(); var productionLines = _iCommonManager.GetAllProductionLines().ToList(); ViewBag.ProductionDateCodeId = new SelectList(productionDateCodes, "ProductionDateCodeId", "Code", productionDateCodes.First().ProductionDateCodeId); ViewBag.ProductionLineId = new SelectList(productionLines, "ProductionLineId", "LineNumber"); return(View()); }
public ActionResult PrintBarCode() { //var barcodeList = _iCommonManager.GetAllTestBarcode(); //foreach (string s in barcodeList.Take(Convert.ToInt32(barcode))) //{ // GenerateBarCodeFromaGivenString(Regex.Replace(s, @"\t|\n|\r", "")); //} var monthYear = DateTime.Now.Month.ToString("D2") + Convert.ToInt32(DateTime.Now.Year.ToString().Substring(2, 2)).ToString("D2"); var productionDateCodes = _iCommonManager.GetProductionDateCodeByMonthYear(monthYear).ToList(); var productionLines = _iCommonManager.GetAllProductionLines().ToList(); ViewBag.ProductionDateCodeId = new SelectList(productionDateCodes, "ProductionDateCodeId", "Code", productionDateCodes.First().ProductionDateCodeId); ViewBag.ProductionLineId = new SelectList(productionLines, "ProductionLineId", "LineNumber"); return(View()); }
public ActionResult Generate() { try { var monthYear = DateTime.Now.Month.ToString("D2") + Convert.ToInt32(DateTime.Now.Year.ToString().Substring(2, 2)).ToString("D2"); var productionDateCodes = _iCommonManager.GetAllProductionDateCode().ToList(); var productionLines = _iCommonManager.GetAllProductionLines().ToList(); var courrentCode = _iCommonManager.GetProductionDateCodeByMonthYear(monthYear).ToList().First(); var list = new SelectList(productionDateCodes, "ProductionDateCodeId", "Code", courrentCode.ProductionDateCodeId); ViewBag.ProductionDateCodeId = list; ViewBag.ProductionLineId = new SelectList(productionLines, "ProductionLineId", "LineNumber"); return(View()); } catch (Exception exception) { Log.WriteErrorLog(exception); return(PartialView("_ErrorPartial", exception)); } }