public String Save() { String status = null; Dictionary <String, String> pars = new Dictionary <String, String>(Request.Form.Count); for (int i = 0; i < Request.Form.Count; i++) { pars.Add(Request.Form.Keys[i], Request.Form.GetValues(i)[0]); } if ((pars != null) && pars.ContainsKey("cmd")) { switch (pars["cmd"]) { case "save": status = F1Model.Upsert(pars); break; case "delete": status = F1Model.Delete(pars); break; default: break; } } else { status = "Ошибка в формате команды."; } return(status); }
public Object Save() { Object result = null; var rqp = RequestPackage.ParseRequest(Request.InputStream, Request.ContentEncoding); if (rqp != null) { switch (rqp.Command) { case "insert": var dt = F1Model.Insert(rqp); F1Model m = new F1Model(dt); result = PartialView("~/Views/F1/FilteredView.cshtml", m); break; case "update": result = F1Model.Update(rqp); break; case "delete": result = F1Model.Delete(rqp); break; default: break; } } else { result = "Ошибка в формате команды."; } return(result); }
public PartialViewResult GetDataForSelectorWithListBox(String tableName, String filter) { Object dt = F1Model.GetDataForSelectorWithListBox(tableName, filter); PartialViewResult r = PartialView("~/Areas/Agrs/Views/Shared/ListBox1.cshtml", dt); return(r); }
public Object SaveTableV2() { RequestPackage rqp = RequestPackage.ParseRequest(Request.InputStream, Request.ContentEncoding); String msg = F1Model.SaveTableV2(rqp); return(msg);// "Для проверки сохранения надо презагрузить таблицу."; }
public FileContentResult DownloadExcelFile(Guid sessionId, Int32 specId) { F1Model m = new F1Model(sessionId, specId); Byte[] buff = NskdExcel.ToExcel(sessionId, m.Table_dt, m.Head_dt); String fileName = null; try { fileName = (String)m.Head_dt.Rows[0]["номер_извещения_аукциона"]; } catch (Exception) { } if (String.IsNullOrWhiteSpace(fileName)) { fileName = specId.ToString(); } if (String.IsNullOrWhiteSpace(fileName)) { fileName = DateTime.Now.Date.ToString("yyyy-MM-dd HH:mm"); } fileName += ".xlsx"; FileContentResult f = File(buff, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", fileName); return(f); }
public Object Save() { String status = null; var rqp = RequestPackage.ParseRequest(Request.InputStream, Request.ContentEncoding); if (rqp != null) { switch (rqp.Command) { case "save": status = F1Model.Upsert(rqp); break; case "delete": status = F1Model.Delete(rqp); break; default: break; } } else { status = "Ошибка в формате команды."; } return(status); }
public FileContentResult DownloadWordFile(Guid sessionId, Int32 specId) { F1Model m = new F1Model(sessionId, specId); //DataTable dt = TestWord.Db.ПолучитьТабличнуюЧастьСпецификации(cnString, specId); //using (FileStream file = File.Create(@"C:\Temp\TestWord.docx")) //{ MemoryStream ms = new TestWord.GeneratedClass().CreatePackage(m.Table_dt); ms.Position = 0; //ms.CopyTo(file); //} Byte[] buff = ms.ToArray(); String fileName = null; try { fileName = (String)m.Head_dt.Rows[0]["номер_извещения_аукциона"]; } catch (Exception) { } if (String.IsNullOrWhiteSpace(fileName)) { fileName = specId.ToString(); } if (String.IsNullOrWhiteSpace(fileName)) { fileName = DateTime.Now.Date.ToString("yyyy-MM-dd HH:mm"); } fileName += ".docx"; FileContentResult f = File(buff, "application/vnd.openxmlformats-officedocument.wordprocessingml.document", fileName); return(f); }
public Object GetDataForSelectorWithListBox() { var rqp = RequestPackage.ParseRequest(Request.InputStream, Request.ContentEncoding); Object dt = F1Model.GetDataForSelectorWithListBox(rqp); PartialViewResult r = PartialView("~/Views/F1/ListBox1.cshtml", dt); return(r); }
public Object GetDataForDetailSection() { var rqp = RequestPackage.ParseRequest(Request.InputStream, Request.ContentEncoding); F1Model m = new F1Model(rqp["f0"] as String); var view = PartialView("~/Views/F1/Detail.cshtml", m); return(view); }
public Object GetDataForFilteredView() { var rqp = RequestPackage.ParseRequest(Request.InputStream, Request.ContentEncoding); F1Model m = new F1Model(rqp); var view = PartialView("~/Views/F1/FilteredView.cshtml", m); return(view); }
public Object Index() { Object result = null; RequestPackage rqp = RequestPackage.ParseRequest(Request.InputStream, Request.ContentEncoding); if (rqp != null && Int32.TryParse(rqp["specId"] as String, out Int32 specId)) { F1Model m = new F1Model(rqp.SessionId, specId, Request.Url); result = PartialView("~/Areas/Prep/Views/F1/Index.cshtml", m); } return(result); }
public PartialViewResult GetDataForDetailSection() { Dictionary <String, String> fs = new Dictionary <String, String>(Request.Form.Count); for (int i = 0; i < Request.Form.Count; i++) { fs.Add(Request.Form.Keys[i], Request.Form.GetValues(i)[0]); } F1Model m = new F1Model(fs); m.LoadDictionariesAndFillPopups(); return(PartialView("~/Areas/Agrs/Views/F1/Detail.cshtml", m)); }
public Object GetDataForFilteredView() { Object result = null; Dictionary <String, String> fs = new Dictionary <String, String>(Request.Form.Count); for (int i = 0; i < Request.Form.Count; i++) { fs.Add(Request.Form.Keys[i], Request.Form.GetValues(i)[0]); } F1Model m = new F1Model(fs); result = PartialView("~/Areas/Agrs/Views/F1/FilteredView.cshtml", m); return(result); }
public Object Index(String sessionId) { Object v = null; F1Model m = new F1Model(); if (ControllerContext.HttpContext.IsDebuggingEnabled) { v = View("~/Views/F1/Index.cshtml", m); // _ViewStart.cshtml } else { v = PartialView("~/Views/F1/Index.cshtml", m); } return(v); }
public Object Index() { Object result = "FNet.MDVReports.Controllers.F1Controller.Index()"; RequestPackage rqp = RequestPackage.ParseRequest(Request.InputStream, Request.ContentEncoding); try { if (rqp != null) { F1Model m = new F1Model(rqp.SessionId); result = PartialView("~/Views/F1/Index.cshtml", m); } } catch (Exception e) { result += "<br>" + e.Message; } return(result); }
public Object DownloadExcelFile() { Object result = "FNet.MDVReports.Controllers.F1Controller.DownloadExelFile()"; //RequestPackage rqp = RequestPackage.ParseRequest(Request.InputStream, Request.ContentEncoding); try { //if (rqp != null) { F1Model m = new F1Model(new Guid()); Byte[] buff = NskdExcel1.ToExcel(m.Data); String fileName = "MDVReport2 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm") + ".xlsx"; FileContentResult fcr = File(buff, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", fileName); result = fcr; } } catch (Exception e) { result += "<br>" + e.Message; } return(result); }
public String SaveShedule() { F1Model.SaveShedule(Request.Form); return("Сохранено"); }
public Object Index(String sessionId) { F1Model m = new F1Model(sessionId); return(View("~/Areas/Agrs/Views/F1/Index.cshtml", m)); }