コード例 #1
0
        public ActionResult GetMode(int solId)
        {
            var obj = PrivilegeOrderService.FindById(solId);

            obj.ModeTitle = SysDataDictService.GetDictionaryList(Logic.DicType.返利模式).FirstOrDefault(o => o.DicSN == obj.ModeSN).Title;
            return(new JsonNetResult(obj));
        }
コード例 #2
0
        public ActionResult SaveSolution(PrivilegeSolution obj)
        {
            obj.SupplierIds = Request["SupplierIds"];
            var re = PrivilegeOrderService.SaveSolution(obj, Request["StartVal"], Request["EndVal"]);

            return(Content(re.ToJson()));
        }
コード例 #3
0
        public ActionResult SolutionList()
        {
            var count = 20;
            var list  = PrivilegeOrderService.SolutionList(Request.Params, out count);

            return(ToDataGrid(list, count));
        }
コード例 #4
0
 public ActionResult SaveCalc()
 {
     ViewBag.Modes = ListToSelect(SysDataDictService.GetDictionaryList(Logic.DicType.返利模式).Select(o => new SelectListItem()
     {
         Value = o.DicSN.ToString(), Text = o.Title
     }));
     ViewBag.Solutions = ListToSelect(PrivilegeOrderService.FindList(o => o.ModeSN != 46).Select(o => new SelectListItem()
     {
         Value = o.Id.ToString(), Text = o.Title
     }), emptyTitle: "请选择");
     return(View(new PrivilegeCalc()));
 }
コード例 #5
0
        public ActionResult SaveSolution(int?id)
        {
            ViewBag.Modes = ListToSelect(SysDataDictService.GetDictionaryList(Logic.DicType.返利模式).Select(o => new SelectListItem()
            {
                Value = o.DicSN.ToString(), Text = o.Title
            }));
            ViewBag.Suppliers = ListToSelect(SupplierService.GetList().Where(o => o.BusinessType == 1).Select(o => new SelectListItem()
            {
                Value = o.Id, Text = o.FullTitle
            }), emptyTitle: "请选择");
            var obj = PrivilegeOrderService.GetObj(id);

            return(View(obj.IsNullThrow()));
        }
コード例 #6
0
        public ActionResult Export(int id)
        {
            var obj = PrivilegeOrderService.GetCalc(id);
            var dt  = obj.Details.ToDataTable();

            string[] fields = { "IndentOrderId", "Barcode", "PartName", "CategoryTitle", "Unit", "OrderDate", "TakeDate", "TakeNum", "Price", "SubTotal" };
            string[] names  = { "订单号", "商品条码", "商品名称", "类别", "单位", "(订货/销售)日期", "到货日期", "收货数量", "进价", "小计" };
            var      title  = "返利模式:" + obj.PrivilegeModeSNTitle + "供应商名称:" + obj.SupplierTitle + "   返利期间:" + obj.StartDate.GetValueOrDefault().ToString("yyyy-MM-dd") + "至" + obj.EndDate.GetValueOrDefault().ToString("yyyy-MM-dd") + "    返利(金额/数量):" + obj.PrivilegeNum;

            new ExportExcel()
            {
                IsBufferOutput = true, HeaderText = title
            }.ToExcel(obj.PrivilegeSolutionTitle, dt, fields, names, null);
            return(new EmptyResult());
        }
コード例 #7
0
        public ActionResult SetProduct(int?id)
        {
            var obj  = PrivilegeOrderService.GetObj(id, false);
            var data = SysDataDictService.Find(o => o.DicSN == obj.ModeSN);

            if (obj != null)
            {
                obj.ModeTitle = data.Title;
            }
            List <DropdownItem> parents = null;

            if (obj.SupplierIds.IsNullOrEmpty())
            {
                parents = ProductCategoryService.GetParentTypes().Select(o => new DropdownItem()
                {
                    Value = o.CategorySN.ToString(), Text = o.Title
                }).ToList();
            }
            else
            {
                var sp   = obj.SupplierIds.Split(',').ToList();
                var bars = BaseService <ProductMultSupplier> .FindList(o => sp.Contains(o.SupplierId)).Select(o => o.Barcode).Distinct().ToList();

                var categorys = BaseService <VwProduct> .FindList(o => sp.Contains(o.SupplierId) || bars.Contains(o.Barcode)).Select(o => o.CategorySN).Distinct().ToList();

                parents = ProductCategoryService.GetRootSNs(categorys).Select(o => new DropdownItem()
                {
                    Value = o.CategorySN.ToString(), Text = o.Title
                }).ToList();;
            }
            parents.Insert(0, new DropdownItem("", "请选择"));
            ViewBag.parenttypes = parents.ToJson();
            ViewBag.types       = PrivilegeOrderService.LoadTypeDetailJson(id);
            ViewBag.products    = PrivilegeOrderService.LoadProductDetailJson(id);
            return(View(obj.ModeSN == 46 ? "SetProduct2" : "SetProduct", obj.IsNullThrow()));
        }
コード例 #8
0
        public ActionResult GetGift(string supplierId, string barcodes, string categorys, decimal ordernum)
        {
            var list = PrivilegeOrderService.OrderCalc(supplierId, barcodes, categorys, ordernum);

            return(Json(list));
        }
コード例 #9
0
        public ActionResult SetProduct(PrivilegeSolution obj)
        {
            var re = PrivilegeOrderService.SaveDesign(obj);

            return(Content(re.ToJson()));
        }
コード例 #10
0
 public ActionResult Detail(int id)
 {
     return(View(PrivilegeOrderService.GetCalc(id)));
 }
コード例 #11
0
        public ActionResult DeleteCalc(int[] ids)
        {
            var re = PrivilegeOrderService.DeleteCalc(ids);

            return(new JsonNetResult(re));
        }
コード例 #12
0
        public ActionResult GetCalc(int solId, DateTime start, DateTime end)
        {
            var str = PrivilegeOrderService.GetCalc(solId, start, end);

            return(Content(str));
        }
コード例 #13
0
        public ActionResult SaveCalc(PrivilegeCalc obj)
        {
            var re = PrivilegeOrderService.SaveCalc(obj);

            return(Content(re.ToJson()));
        }
コード例 #14
0
        public ActionResult LoadProductDetailList(int?id, bool getValue = true)
        {
            var json = PrivilegeOrderService.LoadProductDetailJson(id, getValue);

            return(Content(json));
        }