コード例 #1
0
        public ActionResult Save(string id)
        {
            ViewBag.types = ListToSelect(SysDataDictService.GetReceiptsCategories().Select(o => new SelectListItem()
            {
                Value = o.DicSN.ToString(), Text = o.Title
            }), emptyTitle: "请选择");
            var obj = new Receipts()
            {
                CreateTitle = Sys.CurrentUser.FullName, CreateDT = DateTime.Now
            };

            if (!id.IsNullOrEmpty())
            {
                obj = ReceiptsBLL.FindById(id);
                obj.IsNullThrow();
                if (obj.Source == 1)
                {
                    var user = UserInfoService.Find(o => o.UID == obj.CreateUID);
                    if (user != null)
                    {
                        obj.CreateTitle = user.FullName;
                    }
                }
                else
                {
                    var supplier = SupplierService.Find(o => o.Id == obj.CreateUID);
                    if (supplier != null)
                    {
                        obj.CreateTitle = supplier.Title;
                    }
                }
            }
            return(View(obj));
        }
コード例 #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));
        }