Exemple #1
0
        public JsonResult CreateCategory(string name, long pId)
        {
            if (string.IsNullOrWhiteSpace(name) || name.Length > 5)
            {
                throw new Exception();
            }
            ShopCategoryInfo shopCategoryInfo = new ShopCategoryInfo()
            {
                Name             = name,
                ParentCategoryId = pId,
                IsShow           = true,
                DisplaySequence  = ServiceHelper.Create <IShopCategoryService>().GetCategoryByParentId(pId).Count() + 1,
                ShopId           = base.CurrentSellerManager.ShopId
            };

            ServiceHelper.Create <IShopCategoryService>().AddCategory(shopCategoryInfo);
            IOperationLogService operationLogService = ServiceHelper.Create <IOperationLogService>();
            LogInfo logInfo = new LogInfo()
            {
                Date        = DateTime.Now,
                Description = string.Concat("创建供应商分类,父Id=", pId),
                IPAddress   = base.Request.UserHostAddress,
                PageUrl     = "/Category/CreateCategory",
                UserName    = base.CurrentSellerManager.UserName,
                ShopId      = base.CurrentSellerManager.ShopId
            };

            operationLogService.AddSellerOperationLog(logInfo);
            return(Json(new { successful = true }, JsonRequestBehavior.AllowGet));
        }
Exemple #2
0
        public JsonResult DeleteCategoryById(long id)
        {
            ServiceHelper.Create <IShopCategoryService>().DeleteCategory(id, base.CurrentSellerManager.ShopId);
            IOperationLogService operationLogService = ServiceHelper.Create <IOperationLogService>();
            LogInfo logInfo = new LogInfo()
            {
                Date        = DateTime.Now,
                Description = string.Concat("删除供应商分类,Id=", id),
                IPAddress   = base.Request.UserHostAddress,
                PageUrl     = "/Category/DeleteCategoryById",
                UserName    = base.CurrentSellerManager.UserName,
                ShopId      = base.CurrentSellerManager.ShopId
            };

            operationLogService.AddSellerOperationLog(logInfo);
            return(Json(new { Successful = true }, JsonRequestBehavior.AllowGet));
        }
Exemple #3
0
        public JsonResult UpdateName(string name, long id)
        {
            ServiceHelper.Create <IShopCategoryService>().UpdateCategoryName(id, name);
            IOperationLogService operationLogService = ServiceHelper.Create <IOperationLogService>();
            LogInfo logInfo = new LogInfo()
            {
                Date = DateTime.Now
            };

            object[] objArray = new object[] { "修改供应商分类名称,Id=", id, ",名称=", name };
            logInfo.Description = string.Concat(objArray);
            logInfo.IPAddress   = base.Request.UserHostAddress;
            logInfo.PageUrl     = "/Category/UpdateName";
            logInfo.UserName    = base.CurrentSellerManager.UserName;
            logInfo.ShopId      = base.CurrentSellerManager.ShopId;
            operationLogService.AddSellerOperationLog(logInfo);
            return(Json(new { Successful = true }, JsonRequestBehavior.AllowGet));
        }
 /// <summary>
 /// 增加平台日志信息
 /// </summary>
 /// <param name="info"></param>
 public static void AddSellerOperationLog(LogInfo info)
 {
     _iOperationLogService.AddSellerOperationLog(info);
 }