//获取表单数据
        public ActionResult GetData()
        {
            if (Request["billType"] == null)//是否有单据类型
            {
                return(Content("没有单据类型!"));
            }
            int billtype = 0;

            switch (Request["billType"])
            {
            case "1":
            case "LoadingCostReceiveList": billtype = 1; break;

            case "2":
            case "LoadingCostGiveList": billtype = 2; break;

            case "3":
            case "LaborReceiveList": billtype = 3; break;
            }
            string str = Request.Params["LoadingExpensesBillId"];//单号

            //如果新单据 没有数据
            if (string.IsNullOrEmpty(str))
            {
                return(Json(new LoadingExpensesBill()));//返回一个新建的空对象
            }
            //如果有数据
            Guid LoadingExpensesBillId = new Guid(Request["LoadingExpensesBillId"]);                                                                             //单据编号
            LoadingExpensesBill bill   = LoadingExpensesBillService.LoadEntities(t => t.Id == LoadingExpensesBillId && t.BillType == billtype).FirstOrDefault(); //获取表单

            return(Json(bill));
        }
        public ActionResult GetBillDetail(LoadingAndLaborQueryView A, List <LaborAndLoading3QueryConditions> Businesstype, List <LaborAndLoading3QueryConditions> LodingType, List <LaborAndLoading3QueryConditions> Warehouseid, int billType)
        {
            if (billType == 0)//是否有单据类型
            {
                return(Content("没有单据类型!"));
            }
            LoadingExpensesBill bill = LoadingExpensesBillService.GetData(A, billType, Session["Power"].ToString().Trim(), Businesstype, LodingType, Warehouseid);

            return(Json(bill));
        }
        //保存表单数据
        public ActionResult SaveData(LoadingExpensesBill LoadingExpensesBill, int billType)
        {
            if (billType == 0)//是否有单据类型
            {
                return(Content("没有单据类型!"));
            }
            //参数对象可以对应接受数据
            LoadingExpensesBill.MakePerson = Session["UserName"].ToString();                    //保存制单人
            string result = LoadingExpensesBillService.SaveData(LoadingExpensesBill, billType); //保存数据

            return(Content(result.ToString()));
        }