public JsonResult UpdatePNRule() { var nruleid = PnMainVM.GetUniqKey(); var rule_id = Request.Form["rule_id"]; var pnkey = Request.Form["pnkey"]; var whichtest = Request.Form["whichtest"]; var errabbr = Request.Form["errabbr"]; var testcase = Request.Form["testcase"]; var param = Request.Form["param"]; var min = Request.Form["min"]; var max = Request.Form["max"]; var ruleres = Request.Form["ruleres"]; if (string.IsNullOrEmpty(rule_id)) { PnRulesVM.AddRule(pnkey, nruleid, whichtest, errabbr, param, min, max, ruleres, testcase); } else { PnRulesVM.EditRule(pnkey, rule_id, whichtest, errabbr, param, min, max, ruleres, testcase); } var ret = new JsonResult(); ret.Data = new { sucess = true, rid = nruleid }; return(ret); }
public ActionResult SettingScrapRule(string ActivePN, string SearchKey = "") { var pnvmlist = PnMainVM.RetrievePNList(SearchKey); var activepn = GetActivePN(ActivePN, pnvmlist); ViewBag.pnvmlist = pnvmlist; ViewBag.activepn = activepn; var pnsettings = PnMainVM.RetrieveAllPnSetting(activepn); if (pnsettings.Count > 0) { ViewBag.activepnsettings = pnsettings[0]; } ViewBag.ruleresultlist = CreateSelectList(new List <string>(new string[] { SCRAPRESULT.DSCRAP, SCRAPRESULT.ISCRAP, SCRAPRESULT.REWORK }), ""); ViewBag.defreslist = CreateSelectList(new List <string>(new string[] { SCRAPRESULT.DSCRAP, SCRAPRESULT.ISCRAP, SCRAPRESULT.REWORK }), ""); if (ViewBag.activepnsettings != null) { ViewBag.updatedefreslist = CreateSelectList(new List <string>(new string[] { SCRAPRESULT.DSCRAP, SCRAPRESULT.ISCRAP, SCRAPRESULT.REWORK }), ViewBag.activepnsettings.DefaultResult); } return(View()); }
public JsonResult RemovePN() { var pnkey = Request.Form["pnkey"]; PnMainVM.RemovePN(pnkey); var ret = new JsonResult(); ret.Data = new { sucess = true }; return(ret); }
public JsonResult NewPN() { var pn = Request.Form["npn"].ToUpper(); var pj = Request.Form["npro"]; var defres = Request.Form["defres"]; PnMainVM.StoreNewPN(pn, pj, defres); var ret = new JsonResult(); ret.Data = new { sucess = true }; return(ret); }
public JsonResult UpdatePNMainVM() { var pnkey = Request.Form["pnkey"]; var pn = Request.Form["npn"]; var pnpj = Request.Form["npro"]; var defres = Request.Form["defres"]; PnMainVM.UpdatePNPJ(pnkey, pn, pnpj, defres); foreach (string fl in Request.Files) { if (fl != null && Request.Files[fl].ContentLength > 0 && string.Compare(Path.GetExtension(Path.GetFileName(Request.Files[fl].FileName)), ".ini", true) == 0) { string fn = System.IO.Path.GetFileName(Request.Files[fl].FileName); string datestring = DateTime.Now.ToString("yyyyMMdd"); string imgdir = Server.MapPath("~/userfiles") + "\\docs\\" + datestring + "\\"; if (!Directory.Exists(imgdir)) { Directory.CreateDirectory(imgdir); } fn = Path.GetFileNameWithoutExtension(fn) + "-" + DateTime.Now.ToString("yyyyMMddHHmmss") + Path.GetExtension(fn); Request.Files[fl].SaveAs(imgdir + fn); StoreMesTables(imgdir + fn, pnkey); } } var ret = new JsonResult(); ret.Data = new { sucess = true }; return(ret); }