Пример #1
0
        public ActionResult Edit(string id)
        {
            var userName       = MmsHelper.GetUserName();
            var currentProject = MmsHelper.GetCurrentProject();
            var data           = new CheckApiController().GetEditMaster(id);
            var codeService    = new sys_codeService();

            var model = new
            {
                form       = data.form,
                scrollKeys = data.scrollKeys,
                urls       = MmsHelper.GetEditUrls("check"),
                resx       = MmsHelper.GetEditResx("盘点单"),
                dataSource = new
                {
                    measureUnit    = codeService.GetMeasureUnitListByType(),
                    warehouseItems = new mms_warehouseService().GetWarehouseItems(currentProject),
                    yearItems      = codeService.GetYearItems(),
                    monthItems     = codeService.GetMonthItems()
                },
                defaultForm = new mms_check().Extend(new
                {
                    BillNo   = id,
                    BillDate = DateTime.Now,
                    DoPerson = userName,
                    Years    = DateTime.Now.Year,
                    Months   = DateTime.Now.Month
                }),
                defaultRow = new
                {
                    BookNum         = 0,
                    BookMoney       = 0,
                    ActualNum       = 0,
                    ActualUnitPrice = 0,
                    OperateNum      = 0,
                    OperateMoney    = 0
                },
                setting = new
                {
                    postFormKeys   = new string[] { "BillNo" },
                    postListFields = new string[] { "BillNo", "RowId", "MaterialCode", "Unit", "BookNum", "BookMoney", "ActualNum", "ActualUnitPrice", "OperateNum", "OperateMoney", "Remark" }
                }
            };

            return(View(model));
        }