Пример #1
0
 public JsonResult DeleteProduct(string key)
 {
     ProductInfo info = new ProductInfo();
     if (!string.IsNullOrEmpty(key))
     {
         info.Id = key;
         OperationResult opr = ProductService.Remove(key);
         return Json(new JsonResultHelper(opr.Message));
     }
     else
     {
         return Json(new JsonResultHelper(false, "选择的记录无效", ""));
     }
 }
Пример #2
0
 public JsonResult UpdateProductValid(string key, string validstatus)
 {
     ProductInfo info = new ProductInfo();
     if (!string.IsNullOrEmpty(key) && !string.IsNullOrEmpty(validstatus))
     {
         info.Id = key;
         info.SYS_IsValid = int.Parse(validstatus);
         OperationResult opr = ProductService.Modify(info);
         return Json(new JsonResultHelper(opr.Message));
     }
     else
     {
         return Json(new JsonResultHelper(false, "选择的记录无效", ""));
     }
 }
Пример #3
0
 public ViewResult ProductForm(string key)
 {
     ViewBag.Title = "ProductForm";
     ViewBag.DicProductCatalog = PublicMethod.ListAllProductCatalogInfo(ProductCatalogService, null);
     ViewBag.DicUnit = PublicMethod.ListAllUnitInfo(UnitService, null);
     if (string.IsNullOrEmpty(key))
     {
         ProductInfo info = new ProductInfo();
         return View(info);
     }
     else
     {
         ProductInfo info = ProductService.Load(key);
         return View(info);
     }
 }
Пример #4
0
        public ActionResult SaveProduct(ProductInfo info)
        {
            OperationResult opr = new OperationResult(OperationResultType.Success);
            try
            {
                if (string.IsNullOrEmpty(info.Id))
                {
                    info.Id = System.Guid.NewGuid().ToString();
                    opr = ProductService.Create(info);
                }
                else
                {
                    opr = ProductService.Modify(info);

                }

                ViewBag.DicProductCatalog = PublicMethod.ListAllProductCatalogInfo(ProductCatalogService, null);
                ViewBag.DicUnit = PublicMethod.ListAllUnitInfo(UnitService, null);

                ViewBag.PromptMsg = opr.Message;
            }
            catch (Exception err)
            {
                ViewBag.PromptMsg = err.Message;
            }

            return View("ProductForm", info);
        }
Пример #5
0
        public static void ProductETD(Product entity, ProductInfo info)
        {
            info.Id = entity.Id;
               info._IdIsDirty = 0;

               info.ProductCatalogId = entity.ProductCatalogId;
               info._ProductCatalogIdIsDirty = 0;

               info.ProductCode = entity.ProductCode;
               info._ProductCodeIsDirty = 0;

               info.ProductName = entity.ProductName;
               info._ProductNameIsDirty = 0;

               info.SearchKey = entity.SearchKey;
               info._SearchKeyIsDirty = 0;

               info.UnitId = entity.UnitId;
               info._UnitIdIsDirty = 0;

               info.Special = entity.Special;
               info._SpecialIsDirty = 0;

               info.Texture = entity.Texture;
               info._TextureIsDirty = 0;

               info.Size = entity.Size;
               info._SizeIsDirty = 0;

               info.Color = entity.Color;
               info._ColorIsDirty = 0;

               info.ImageUrl = entity.ImageUrl;
               info._ImageUrlIsDirty = 0;

               info.MinStock = entity.MinStock;
               info._MinStockIsDirty = 0;

               info.Stock = entity.Stock;
               info._StockIsDirty = 0;

               info.MaxStock = entity.MaxStock;
               info._MaxStockIsDirty = 0;

               info.Intro = entity.Intro;
               info._IntroIsDirty = 0;

               info.SYS_OrderSeq = entity.SYS_OrderSeq;
               info._SYS_OrderSeqIsDirty = 0;

               info.SYS_IsValid = entity.SYS_IsValid;
               info._SYS_IsValidIsDirty = 0;

               info.SYS_IsDeleted = entity.SYS_IsDeleted;
               info._SYS_IsDeletedIsDirty = 0;

               info.SYS_Remark = entity.SYS_Remark;
               info._SYS_RemarkIsDirty = 0;

               info.SYS_StaffId = entity.SYS_StaffId;
               info._SYS_StaffIdIsDirty = 0;

               info.SYS_StationId = entity.SYS_StationId;
               info._SYS_StationIdIsDirty = 0;

               info.SYS_DepartmentId = entity.SYS_DepartmentId;
               info._SYS_DepartmentIdIsDirty = 0;

               info.SYS_CompanyId = entity.SYS_CompanyId;
               info._SYS_CompanyIdIsDirty = 0;

               info.SYS_AppId = entity.SYS_AppId;
               info._SYS_AppIdIsDirty = 0;

               info.SYS_CreateTime = entity.SYS_CreateTime;
               info._SYS_CreateTimeIsDirty = 0;

               info.SYS_ModifyTime = entity.SYS_ModifyTime;
               info._SYS_ModifyTimeIsDirty = 0;

               info.SYS_DeleteTime = entity.SYS_DeleteTime;
               info._SYS_DeleteTimeIsDirty = 0;
        }