Example #1
0
        //获取表单数据
        public ActionResult GetData()
        {
            string str = Request.Params["DIYBillId"];//单号

            //如果新单据 没有数据
            if (string.IsNullOrEmpty(str))
            {
                DIYBill       billdiy = new DIYBill();
                List <Record> list1   = new List <Record>();
                List <Record> list2   = new List <Record>();
                var           ress    = new {
                    diybill     = billdiy,
                    recordlist1 = list1,
                    recordlist2 = list2
                };
                return(Json(ress));//返回一个新建的空对象
            }
            else
            {
                //如果有数据
                Guid          DIYBillId = new Guid(Request["DIYBillId"]);                                       //单据编号
                DIYBill       bill      = DIYBillService.LoadEntities(t => t.Id == DIYBillId).FirstOrDefault(); //获取表单
                List <Record> list1     = RecordService.LoadEntities(a => a.MainTableId == bill.Id && a.InOrOut == 0).ToList();
                List <Record> list2     = RecordService.LoadEntities(b => b.MainTableId == bill.Id && b.InOrOut == 1).ToList();
                var           ress      = new
                {
                    diybill     = bill,
                    recordlist1 = list1,
                    recordlist2 = list2
                };
                return(Json(ress));
            }
        }
Example #2
0
        //保存表单数据
        public ActionResult SaveData(DIYBill DIYBill, List <Record> recordlist1, List <Record> recordlist2)
        {
            //参数对象可以对应接受数据
            DIYBill.MakePerson = Session["UserName"].ToString();                        //保存制单人
            string result = DIYBillService.SaveData(DIYBill, recordlist1, recordlist2); //保存数据

            return(Content(result.ToString()));
        }
Example #3
0
        /// <summary>
        /// 弃审
        /// </summary>
        /// <param name="billCode"></param>
        /// <returns></returns>

        public ActionResult GiveupExamine(string billCode)
        {
            string res = "";

            if (string.IsNullOrEmpty(billCode))
            {
                res = "参数错误";
            }
            else
            {
                res = DIYBillService.GiveupExamine(Guid.Parse(billCode), Session["UserName"].ToString());
            }
            return(Content(res));
        }
Example #4
0
        /// <summary>
        /// 审核表单
        /// </summary>
        /// <returns></returns>
        public ActionResult Examine()
        {
            string res       = "";
            string DIYBillId = Request.Params["DIYBillId"];

            if (string.IsNullOrEmpty(DIYBillId))
            {
                res = "参数错误";
            }
            else
            {
                res = DIYBillService.Examine(Guid.Parse(DIYBillId), Session["UserName"].ToString());
            }
            return(Content(res));
        }
Example #5
0
 /// <summary>
 /// 删除订单
 /// </summary>
 /// <param name="billCode">单号</param>
 /// <returns></returns>
 public ActionResult DeleteBill(Guid BillId)
 {
     return(Content(DIYBillService.DeleteBill(BillId)));
 }
        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("参数错误"));
        }