//保存表单数据 public ActionResult SaveData(OtherInput OtherInput) { //参数对象可以对应接受数据 OtherInput.MakePerson = Session["UserName"].ToString(); //保存制单人 string result = OtherInputService.SaveData(OtherInput); //保存数据 return(Content(result.ToString())); }
/// <summary> /// 弃审 /// </summary> /// <param name="billCode"></param> /// <returns></returns> public ActionResult GiveupExamine(string billCode) { string res = ""; if (string.IsNullOrEmpty(billCode)) { res = "参数错误"; } else { res = OtherInputService.GiveupExamine(Guid.Parse(billCode), Session["UserName"].ToString()); } return(Content(res)); }
/// <summary> /// 审核表单 /// </summary> /// <returns></returns> public ActionResult Examine() { string res = ""; string OtherInputId = Request.Params["OtherInputId"]; if (string.IsNullOrEmpty(OtherInputId)) { res = "参数错误"; } else { res = OtherInputService.Examine(Guid.Parse(OtherInputId), Session["UserName"].ToString()); } return(Content(res)); }
//获取表单数据 public ActionResult GetData() { string str = Request.Params["OtherInputId"];//单号 //如果新单据 没有数据 if (string.IsNullOrEmpty(str)) { return(Json(new OtherInput()));//返回一个新建的空对象 } //如果有数据 Guid OtherInputId = new Guid(Request["OtherInputId"]); //单据编号 OtherInput bill = OtherInputService.LoadEntities(t => t.Id == OtherInputId).FirstOrDefault(); //获取表单 return(Json(bill)); }
public ActionResult SearchBills(string billType, int pageIndex, int pageSize, string timestart, string timeend, string BillState, string DepartmentId, int?WarehouseId, string BillCode, string LBBillCode) { int totalCount = 0; //总记录数 switch (billType) { case "TransferBill": Expression <Func <TransferBill, bool> > exp1 = TransferBillSearchCondition(timestart, timeend, BillState, DepartmentId, WarehouseId, BillCode, LBBillCode); List <TransferBill> res1 = TransferBillService.LoadPageEntities(exp1.Expand(), a => a.BillCode, pageIndex, pageSize, false, out totalCount).ToList(); return(Json(new { data = res1, totalCount = totalCount })); case "BackInput": Expression <Func <BackInput, bool> > exp2 = BackInputSearchCondition(timestart, timeend, BillState, DepartmentId, WarehouseId, BillCode, LBBillCode); List <BackInput> res2 = BackInputService.LoadPageEntities(exp2.Expand(), a => a.BillCode, pageIndex, pageSize, false, out totalCount).ToList(); return(Json(new { data = res2, totalCount = totalCount })); case "GiveBill": case "GiveBackBill": Expression <Func <GiveBill, bool> > exp3 = GiveBillSearchCondition(timestart, timeend, BillState, DepartmentId, WarehouseId, BillCode, LBBillCode); List <GiveBill> res3 = GiveBillService.LoadPageEntities(exp3.Expand(), a => a.BillCode, pageIndex, pageSize, false, out totalCount).ToList(); return(Json(new { data = res3, totalCount = totalCount })); case "TaskBill": Expression <Func <TaskBill, bool> > exp4 = TaskBillSearchCondition(timestart, timeend, BillState, DepartmentId, WarehouseId, BillCode); List <TaskBill> res4 = TaskBillService.LoadPageEntities(exp4.Expand(), a => a.BillCode, pageIndex, pageSize, false, out totalCount).ToList(); return(Json(new { data = res4, totalCount = totalCount })); case "BackOutput": Expression <Func <BackOutput, bool> > exp5 = BackOutputSearchCondition(timestart, timeend, BillState, DepartmentId, WarehouseId, BillCode, LBBillCode); List <BackOutput> res5 = BackOutputService.LoadPageEntities(exp5.Expand(), a => a.BillCode, pageIndex, pageSize, false, out totalCount).ToList(); return(Json(new { data = res5, totalCount = totalCount })); case "OtherInput": Expression <Func <OtherInput, bool> > exp6 = OtherInputSearchCondition(timestart, timeend, BillState, DepartmentId, WarehouseId, BillCode); List <OtherInput> res6 = OtherInputService.LoadPageEntities(exp6.Expand(), a => a.BillCode, pageIndex, pageSize, false, out totalCount).ToList(); return(Json(new { data = res6, totalCount = totalCount })); case "OtherOutput": Expression <Func <OtherOutput, bool> > exp7 = OtherOutputSearchCondition(timestart, timeend, BillState, DepartmentId, WarehouseId, BillCode); List <OtherOutput> res7 = OtherOutputService.LoadPageEntities(exp7.Expand(), a => a.BillCode, pageIndex, pageSize, false, out totalCount).ToList(); return(Json(new { data = res7, totalCount = totalCount })); case "DIYBill": Expression <Func <DIYBill, bool> > exp8 = DIYBillSearchCondition(timestart, timeend, BillState, DepartmentId, WarehouseId, BillCode); List <DIYBill> res8 = DIYBillService.LoadPageEntities(exp8.Expand(), a => a.BillCode, pageIndex, pageSize, false, out totalCount).ToList(); return(Json(new { data = res8, totalCount = totalCount })); case "CheckBill": Expression <Func <CheckBill, bool> > exp9 = CheckBillSearchCondition(timestart, timeend, BillState, DepartmentId, WarehouseId, BillCode); List <CheckBill> res9 = CheckBillService.LoadPageEntities(exp9.Expand(), a => a.BillCode, pageIndex, pageSize, false, out totalCount).ToList(); return(Json(new { data = res9, totalCount = totalCount })); case "LocationChange": Expression <Func <LocationChange, bool> > exp10 = LocationChangeSearchCondition(timestart, timeend, BillState, DepartmentId, WarehouseId, BillCode); List <LocationChange> res10 = LocationChangeService.LoadPageEntities(exp10.Expand(), a => a.BillCode, pageIndex, pageSize, false, out totalCount).ToList(); return(Json(new { data = res10, totalCount = totalCount })); } return(Content("参数错误")); }
/// <summary> /// 删除订单 /// </summary> /// <param name="billCode">单号</param> /// <returns></returns> public ActionResult DeleteBill(Guid BillId) { return(Content(OtherInputService.DeleteBill(BillId))); }