//详细列表 //VIEW: /Pay/QueryInsuranceDetail public ActionResult QueryInsuranceDetail(int importId) { List <InsuranceDetailInfo> list = new Manager.PayManager().QueryInsuranceDetail(importId); JsonResult jsonResult = Json(list); return(jsonResult); }
public ActionResult SaveTemplateMsg(int id, string temps) { string msg = string.Empty; //查询公司模版是否已经存在 Models.TemplateInfo ti = new Models.TemplateInfo(); ti = new Manager.PayManager().GetTemplateByCompanyId(id); if (ti.TemplateId != 0) { msg = "该公司已有模版"; return(Json(msg)); } int[] tempArr = null; if (!string.IsNullOrEmpty(temps)) { string strTemp = temps; string[] strArr = strTemp.Split(','); tempArr = new int[strArr.Length]; for (int i = 0; i < strArr.Length; i++) { tempArr[i] = Convert.ToInt32(strArr[i]); } } if (new Manager.PayManager().SaveTemplateMsg(id, tempArr)) { msg = "保存成功"; } else { msg = "保存失败"; } return(Json(msg)); }
public ActionResult GetPayDetail(int cmpid, int payid) { List <PayDetailInfo> list = new Manager.PayManager().GetPayDetail(cmpid, payid); JsonResult jsonResult = Json(list); return(jsonResult); }
//查询发放列表 //VIEW:/Pay/QueryPayList public ActionResult QueryPayList(string query) { List <Payment> list = new Manager.PayManager().QueryPayList(query); JsonResult jsonResult = Json(list); return(jsonResult); }
//获取所有模板列表 //VIEW: /Pay/GetTemplateList public ActionResult GetTemplateList() { List <Models.TemplateInfo> list = new Manager.PayManager().GetTemplateList(); JsonResult jsonResult = Json(list); return(jsonResult); }
public ActionResult ImportPay() { if (Request.Files.Count == 0) { Object o = new { success = false, data = "上传失败,请选择需要上传的EXCEL" }; JsonResult r = Json(o, JsonRequestBehavior.AllowGet); return(r); } string message = string.Empty; string fileName = System.IO.Path.GetFileNameWithoutExtension(Request.Files[0].FileName); IExcel excel = ExcelFactory.CreateDefault(); DataSet ds = excel.Read(Request.Files[0].InputStream); DataTable dt = ds.Tables[0]; bool pass = new Manager.PayManager().ImportPaymentData(dt, fileName, ref message); Object result = new { success = pass, data = message }; JsonResult jsonResult = Json(result, JsonRequestBehavior.AllowGet); return(jsonResult); }
public ActionResult QueryImportorPayList(string query) { List <InsuranceInfo> list = new Manager.PayManager().QueryImportorPaymentList(query); JsonResult jsonResult = Json(list); return(jsonResult); }
public ActionResult ImportorPayDetailTable(int importorId) { DataTable dataTable = new Manager.PayManager().GetImportorDetail(importorId); String json = Newtonsoft.Json.JsonConvert.SerializeObject(dataTable); ContentResult jsonResult = Content(json); return(jsonResult); }
public ActionResult QueryTemplate(string id) { int tempId = int.Parse(id); Models.TemplateInfo temp = new Manager.PayManager().GetTemplate(tempId); JsonResult jsonResult = Json(temp); return(jsonResult); }
/// <summary> /// 获取数据库中存在的模版列表 /// </summary> /// <returns></returns> public ActionResult GetTemplateByTable(string id) { int tempId = int.Parse(id); int[] itemp = new Manager.PayManager().GetTemplateByTable(tempId); string[] stemp = itemp.Select(i => i.ToString()).ToArray(); string strtemp = string.Join(",", stemp); return(Json(strtemp)); }
public ActionResult ImportorEditor() { HttpFileCollection files = System.Web.HttpContext.Current.Request.Files; string outmsg = string.Empty; bool success = false; if (files.Count > 0) { for (int i = 0; i < files.Count; i++) { HttpPostedFile file1 = files[i]; Stream stream = file1.InputStream; DataTable dt = new DataTable(); string fileName = System.IO.Path.GetFileNameWithoutExtension(file1.FileName); string fileType = System.IO.Path.GetExtension(file1.FileName).ToLower(); switch (fileType) { case ".csv": CsvFileParser cfp = new CsvFileParser(); dt = cfp.TryParse(stream, out outmsg); break; case ".xls": case ".xlsx": success = false; //outmsg = "文件:" + fileName + "的文件格式接口待开发!<br />"; IExcel excel = ExcelFactory.CreateDefault(); DataSet ds = excel.Read(stream); dt = ds.Tables[0]; break; default: success = false; outmsg += "文件:" + fileName + "格式不支持!<br />"; break; } success = new Manager.PayManager().ImportInsurance(dt, fileName, ref outmsg); } } else { outmsg += "未获取到文件,请重试!<br />"; } if (success) { outmsg = "上传成功!<br />" + outmsg; } else { outmsg = "上传失败!<br />" + outmsg; } return(Json(outmsg)); }
public ActionResult RefreshTable(int id) { List <PayTableConfig> list = GetTableColumns(); HashSet <int> temp = new Manager.PayManager().QueryTemplateDetail(id); if (temp.Count > 0) { for (int i = list.Count - 1; i >= 0; i--) { if (list[i].IsDynamic == true) { if (list[i].Subnode.Count > 0) { for (int n = list[i].Subnode.Count - 1; n >= 0; n--) { if (!temp.Contains(list[i].Subnode[n].ItemId)) { list[i].Subnode.RemoveAt(n); } } } else { if (!temp.Contains(list[i].ItemId)) { list.RemoveAt(i); } } } } } list = list.Where(i => i.IsLastStage == false && i.Subnode.Count > 0 || i.IsLastStage == true && i.Subnode.Count == 0).ToList(); JsonResult jsonResult = Json(list); return(jsonResult); }
// //VIEW: Pay/GetPayDetailByPayId public ActionResult GetPayDetailByPayId(int id) { Payment pay = new Manager.PayManager().GetPayDetailByPayId(id); return(Json(pay)); }