예제 #1
0
        public ActionResult Edit(string id)
        {
            var userName       = MmsHelper.GetUserName();
            var currentProject = MmsHelper.GetCurrentProject();
            var data           = new ReceiveApiController().GetEditMaster(id);
            var codeService    = new sys_codeService();

            var model = new
            {
                form       = data.form,
                scrollKeys = data.scrollKeys,
                urls       = MmsHelper.GetEditUrls("receive"),
                resx       = MmsHelper.GetEditResx("收料单"),
                dataSource = new
                {
                    measureUnit    = codeService.GetMeasureUnitListByType(),
                    supplyType     = codeService.GetValueTextListByType("SupplyType"),
                    payKinds       = codeService.GetValueTextListByType("PayType"),
                    warehouseItems = new mms_warehouseService().GetWarehouseItems(currentProject)
                },
                defaultForm = new mms_receive().Extend(new
                {
                    BillNo      = id,
                    BillDate    = DateTime.Now,
                    DoPerson    = userName,
                    ReceiveDate = DateTime.Now,
                    SupplyType  = codeService.GetDefaultCode("SupplyType"),
                    PayKind     = codeService.GetDefaultCode("PayType"),
                }),
                defaultRow = new
                {
                    CheckNum  = 1,
                    Num       = 1,
                    UnitPrice = 0,
                    Money     = 0,
                    PrePay    = 0
                },
                setting = new
                {
                    postFormKeys   = new string[] { "BillNo" },
                    postListFields = new string[] { "BillNo", "RowId", "MaterialCode", "Unit", "CheckNum", "Num", "UnitPrice", "PrePay", "Money", "Remark" }
                }
            };

            return(View(model));
        }
예제 #2
0
        public ActionResult Edit(string id)
        {
            var userName = MmsHelper.GetUserName();
            var currentProject = MmsHelper.GetCurrentProject();
            var data = new ReceiveApiController().GetEditMaster(id);
            var codeService = new sys_codeService();

            var model = new
            {
                form = data.form,
                scrollKeys = data.scrollKeys,
                urls = MmsHelper.GetEditUrls("receive"),
                resx = MmsHelper.GetEditResx("收料单"),
                dataSource = new
                {
                    measureUnit = codeService.GetMeasureUnitListByType(),
                    supplyType = codeService.GetValueTextListByType("SupplyType"),
                    payKinds = codeService.GetValueTextListByType("PayType"),
                    warehouseItems = new mms_warehouseService().GetWarehouseItems(currentProject)
                },
                defaultForm = new mms_receive().Extend(new
                {
                    BillNo = id,
                    BillDate = DateTime.Now,
                    DoPerson = userName,
                    ReceiveDate = DateTime.Now,
                    SupplyType = codeService.GetDefaultCode("SupplyType"),
                    PayKind = codeService.GetDefaultCode("PayType"),
                }),
                defaultRow = new
                {
                    CheckNum = 1,
                    Num = 1,
                    UnitPrice = 0,
                    Money = 0,
                    PrePay = 0
                },
                setting = new
                {
                    postFormKeys = new string[] { "BillNo" },
                    postListFields = new string[] { "BillNo", "RowId", "MaterialCode", "Unit", "CheckNum", "Num", "UnitPrice", "PrePay", "Money", "Remark" }
                }
            };
            return View(model);
        }