Beispiel #1
0
        //查看单据(单据状态为已审核状态)
        public ActionResult InvoiceDetail(string id)
        {
            ViewBag.types = ListToSelect(SysDataDictService.GetReceiptsCategories().Select(o => new SelectListItem()
            {
                Value = o.DicSN.ToString(), Text = o.Title
            }), emptyTitle: "全部");
            var obj = InvoiceBLL.FindById(id);

            obj.IsNullThrow();


            var user = UserInfoService.Find(o => o.UID == obj.CreateUID);

            if (user != null)
            {
                obj.CreateTitle = user.FullName;
            }
            var type = SysDataDictService.Find(o => o.DicSN == obj.CategoryId);

            if (type != null)
            {
                ViewData["Category"] = type.Title;
            }
            return(View(obj));
        }
Beispiel #2
0
        //新增单据/修改单据(单据状态为待审核状态)
        public ActionResult InvoiceSave(string id)
        {
            ViewBag.types = ListToSelect(SysDataDictService.GetReceiptsCategories().Select(o => new SelectListItem()
            {
                Value = o.DicSN.ToString(), Text = o.Title
            }), emptyTitle: "请选择");
            var supplierForAdd = SupplierService.Find(o => o.Id == Pharos.Sys.SupplierUser.SupplierId);
            var obj            = new Receipts()
            {
                CreateTitle = supplierForAdd.Title, CreateDT = DateTime.Now
            };                                                                                       //CreateTitle = CurrentUser.FullName

            if (!id.IsNullOrEmpty())
            {
                obj = InvoiceBLL.FindById(id);
                obj.IsNullThrow();
                var supplier = SupplierService.Find(o => o.Id == obj.CreateUID);
                if (supplier != null)
                {
                    obj.CreateTitle = supplier.Title;
                }
            }
            return(View(obj));
        }