Exemple #1
0
        public JsonResult Edit(UserPermissionModel model)
        {
            if (model == null)
            {
                return(Json(new { result = 0, msg = "无法获取数据对象" }));
            }
            var result = 0;

            if (string.IsNullOrWhiteSpace(model.EndVersion))
            {
                model.EndVersion = "9.9.9";
            }
            model.LastUpdateBy = HttpContext.User.Identity.Name;
            if (model.Id <= 0)
            {
                model.CreateBy = model.LastUpdateBy;
                result         = DALUserPermission.Add(model);
            }
            else
            {
                model.LastUpdateDateTime = DateTime.Now;
                result = DALUserPermission.Update(model);
            }
            var oprLog = new Tuhu.Provisioning.DataAccess.Entity.OprLog
            {
                ObjectID   = model.Id,
                ObjectType = "UserPermission",
                Author     = HttpContext.User.Identity.Name,
                Operation  = model.Id > 0 ? "更新" : "新增" + "UserLivingRights配置"
            };
            var operLogManager = new Business.OprLogManagement.OprLogManager();

            return(Json(new { result = result, msg = "操作成功" }));
        }
Exemple #2
0
        public JsonResult DeleteById(string ids)
        {
            try
            {
                if (string.IsNullOrWhiteSpace(ids))
                {
                    return(Json(new { data = 0, msg = "未能获取数据" }));
                }

                var operLogManager = new Business.OprLogManagement.OprLogManager();
                var result         = 0;
                foreach (var strId in ids.Split(','))
                {
                    if (string.IsNullOrWhiteSpace(strId))
                    {
                        continue;
                    }
                    var id = int.Parse(strId);
                    result += DALUserPermission.Delete(id);
                    var oprLog = new Tuhu.Provisioning.DataAccess.Entity.OprLog
                    {
                        ObjectID   = id,
                        ObjectType = "UserPermission",
                        Author     = HttpContext.User.Identity.Name,
                        Operation  = "删除UserPermission配置"
                    };
                    operLogManager.AddOprLogAsync(oprLog);
                }
                return(Json(new { data = result, msg = "删除成功" }));
            }
            catch (Exception e)
            {
                return(Json(new { data = -1, msg = "删除异常:" + e.ToString() }));
            }
        }
Exemple #3
0
        public ActionResult UpdateNews(tbl_TuhuNews tn)
        {
            var userName = HttpContext.User.Identity.Name;

            int result = DALTuhuNews.UpdateTuhuNews(new SqlConnection(strConn), tn);

            if (result > 0)
            {
                try
                {
                    var oprLog = new Tuhu.Provisioning.DataAccess.Entity.OprLog
                    {
                        ObjectID   = tn.Id,
                        ObjectType = "TuhuNews",
                        Author     = userName,
                        Operation  = "修改途虎新闻"
                    };
                    new Tuhu.Provisioning.Business.OprLogManagement.OprLogManager().AddOprLog(oprLog);
                }
                catch (Exception)
                {
                }
            }
            return(Json(result));
        }
Exemple #4
0
        public JsonResult DeleteTaskTypeReward(int id)
        {
            try
            {
                if (id <= 0)
                {
                    return(Json(new { data = 0, msg = "未能获取数据" }));
                }

                var operLogManager = new Business.OprLogManagement.OprLogManager();
                var result         = DalTaskTypeReward.Delete(id);
                if (result)
                {
                    var oprLog = new Tuhu.Provisioning.DataAccess.Entity.OprLog
                    {
                        ObjectID   = id,
                        ObjectType = "TaskTypeReward",
                        Author     = HttpContext.User.Identity.Name,
                        Operation  = "删除TaskTypeReward配置"
                    };
                    operLogManager.AddOprLogAsync(oprLog);
                    return(Json(new { data = 1, msg = "删除成功" }));
                }
                return(Json(new { data = 0, msg = "删除失败" }));
            }
            catch (Exception e)
            {
                return(Json(new { data = -1, msg = "删除异常:" + e.ToString() }));
            }
        }
        public JsonResult Save(MemberShipLivingRightsModel model)
        {
            if (model == null)
            {
                return(Json(new { result = 0, msg = "无法获取数据对象" }));
            }
            var result = 0;

            model.LastUpdateBy = HttpContext.User.Identity.Name;
            if (model.PKID <= 0)
            {
                model.LastUpdateBy = model.LastUpdateBy;
                result             = DALMembershipLivingRights.Add(model);
            }
            else
            {
                model.LastUpdateDateTime = DateTime.Now;
                result = DALMembershipLivingRights.Update(model);
            }
            var oprLog = new Tuhu.Provisioning.DataAccess.Entity.OprLog
            {
                ObjectID   = model.PKID,
                ObjectType = "UserLivingRights",
                Author     = HttpContext.User.Identity.Name,
                Operation  = model.PKID > 0 ? "更新" : "新增" + "UserLivingRights配置"
            };
            var operLogManager = new Business.OprLogManagement.OprLogManager();

            operLogManager.AddOprLogAsync(oprLog);
            return(Json(new { result = result, msg = "操作成功" }));
        }
        public async System.Threading.Tasks.Task <JsonResult> SaveAsync(List <UserDailyCheckInConfigModel> dataList)
        {
            if (dataList == null || dataList.Count <= 0)
            {
                return(Json(new { result = false, msg = "暂无获取数据" }));
            }
            var result     = false;
            var updateUser = HttpContext.User.Identity.Name;

            DalUserDailyCheckInConfig.Delete(updateUser);
            foreach (var dataModel in dataList)
            {
                dataModel.LastUpdateBy = updateUser;
                result = DalUserDailyCheckInConfig.Create(dataModel);
            }
            if (result)
            {
                var oprLog = new Tuhu.Provisioning.DataAccess.Entity.OprLog
                {
                    ObjectID   = 0,
                    ObjectType = "UserLivingRights",
                    Author     = HttpContext.User.Identity.Name,
                    Operation  = "更新UserDailyCheckInConfig配置信息"
                };
                var operLogManager = new Business.OprLogManagement.OprLogManager();
                operLogManager.AddOprLogAsync(oprLog);

                //更新member服务中缓存
                await new Business.ServiceProxy.MemberService().RefreshUserDailyCheckInConfigCacheAsync();
                return(Json(new { result = result, msg = "操作成功" }));
            }
            return(Json(new { result = false, msg = "操作失败" }));
        }
Exemple #7
0
        public ActionResult InsertOrUpdateProductConfig(string productModel, string platformConfig, string categoryData, string pid,
                                                        string brand, string parentID)
        {
            var result = -1;

            var productModuleModel = JsonConvert.DeserializeObject <ProductDescriptionModel>(productModel);
            var categoryList       = JsonConvert.DeserializeObject <List <ProductDescriptionModel> >(categoryData);
            var pidList            = JsonConvert.DeserializeObject <List <ProductDescriptionModel> >(pid);
            var platformList       = JsonConvert.DeserializeObject <List <ProductDescriptionModel> >(platformConfig);
            var brandList          = JsonConvert.DeserializeObject <List <ProductDescriptionModel> >(brand);
            var userName           = HttpContext.User.Identity.Name;
            var value = productModel + categoryData + pid + brand;

            foreach (var item in platformList)
            {
                item.ModuleContent = Server.UrlDecode(item.ModuleContent);
                item.ModuleContent = item.ModuleContent.Replace('&', '"');
            }
            productModuleModel.ModuleContent = Server.UrlDecode(productModuleModel.ModuleContent);

            if (String.IsNullOrWhiteSpace(parentID))
            {
                var moduleID = 0;
                result = ProductModuleConfigManager.InsertProductConfig(productModuleModel, platformList, categoryList, pidList,
                                                                        brandList, userName, out moduleID);
                if (result > 0 && moduleID > 0)
                {
                    var log = new Tuhu.Provisioning.DataAccess.Entity.OprLog
                    {
                        ObjectID    = moduleID,
                        ObjectType  = "ProConfig",
                        BeforeValue = "New",
                        AfterValue  = value,
                        Author      = userName,
                        Operation   = "添加商品配置信息"
                    };
                    new OprLogManager().AddOprLog(log);
                }
            }
            else
            {
                result = ProductModuleConfigManager.UpdateProductConfig(productModuleModel, platformList, categoryList, pidList, brandList, Convert.ToInt32(parentID), userName);
                if (result > 0)
                {
                    var log = new Tuhu.Provisioning.DataAccess.Entity.OprLog
                    {
                        ObjectID    = Convert.ToInt32(parentID),
                        ObjectType  = "ProConfig",
                        BeforeValue = "Update",
                        AfterValue  = value,
                        Author      = userName,
                        Operation   = "更改商品配置信息"
                    };
                    new OprLogManager().AddOprLog(log);
                }
            }

            return(Json(result));
        }
Exemple #8
0
        public JsonResult AddOrUpdate(BannerConfig model)
        {
            if (!string.IsNullOrWhiteSpace(model.Image))
            {
                model.Image = model.Image.Replace(WebConfigurationManager.AppSettings["DoMain_image"], "");
            }
            if (!string.IsNullOrWhiteSpace(model.StartVersion))
            {
                model.StartVersion = model.StartVersion.Trim();
            }
            if (!string.IsNullOrWhiteSpace(model.EndVersion))
            {
                model.EndVersion = model.EndVersion.Trim();
            }
            if (string.IsNullOrWhiteSpace(model.Creator))
            {
                model.Creator = string.Empty;
            }

            if (model.Id < 0)
            {
                var result = DownloadAppManager.InsertBannerConfig(model);
                if (result > 0)
                {
                    var oprLog = new Tuhu.Provisioning.DataAccess.Entity.OprLog
                    {
                        ObjectID   = result,
                        ObjectType = "BannerConfig",
                        AfterValue =
                            "位置: " + model.Location + ", 平台:" + model.Channel + ", 状态:" + model.Status + ", 目标群体:" +
                            (string.IsNullOrWhiteSpace(model.TargetGroups) ? "" : model.TargetGroups),
                        Author    = HttpContext.User.Identity.Name,
                        Operation = "新建Banner配置"
                    };
                    new OprLogManager().AddOprLog(oprLog);
                }
                return(Json(result));
            }
            else
            {
                var result = DownloadAppManager.UpdateBannerConfig(model);
                if (result > 0)
                {
                    var oprLog = new Tuhu.Provisioning.DataAccess.Entity.OprLog
                    {
                        ObjectID   = model.Id,
                        ObjectType = "BannerConfig",
                        AfterValue =
                            "位置: " + model.Location + ", 平台:" + model.Channel + ", 状态:" + model.Status + ", 目标群体:" +
                            (string.IsNullOrWhiteSpace(model.TargetGroups) ? "" : model.TargetGroups),
                        Author    = HttpContext.User.Identity.Name,
                        Operation = "更新Banner配置"
                    };
                    new OprLogManager().AddOprLog(oprLog);
                }
                return(Json(result));
            }
        }
        public void AddOprLog(string before, string after, string opr)
        {
            OprLog oprModel = new OprLog();

            oprModel.BeforeValue    = before;
            oprModel.AfterValue     = after;
            oprModel.Author         = User.Identity.Name;
            oprModel.ChangeDatetime = DateTime.Now;
            oprModel.HostName       = Request.UserHostName;
            oprModel.ObjectType     = "PLC";
            oprModel.Operation      = opr;
            OprLogManager.AddOprLog(oprModel);
        }
Exemple #10
0
        public ActionResult ExamUpdatePrice(QiangGouProductModel model)
        {
            var result = QiangGouManager.ExamUpdatePrice(model);

            if (result > 0)
            {
                var oprLog = new Tuhu.Provisioning.DataAccess.Entity.OprLog();
                oprLog.Author         = ThreadIdentity.Operator.Name;
                oprLog.ChangeDatetime = DateTime.Now;
                oprLog.AfterValue     = model.ActivityID.ToString();
                oprLog.ObjectType     = "FlashSale";
                oprLog.Operation      = "审核页面改" + model.PID + "价格:改为" + model.Price;
                new OprLogManager().AddOprLog(oprLog);
            }
            return(Json(result));
        }
Exemple #11
0
        public ActionResult DeleteBannerConfig(int Id)
        {
            var deleteResult = DownloadAppManager.DeleteBannerConfig(Id);

            if (!deleteResult)
            {
                return(Json(0, JsonRequestBehavior.AllowGet));
            }

            var oprLog = new Tuhu.Provisioning.DataAccess.Entity.OprLog
            {
                ObjectID   = Id,
                ObjectType = "BannerConfig",
                Author     = HttpContext.User.Identity.Name,
                Operation  = "删除Banner配置"
            };

            new OprLogManager().AddOprLog(oprLog);
            return(Json(1, JsonRequestBehavior.AllowGet));
        }
Exemple #12
0
        public ActionResult DeleteProductAllInfo(int PKID)
        {
            var userName = HttpContext.User.Identity.Name;
            var result   = -1;

            result = ProductModuleConfigManager.DeleteProductAllInfo(PKID, userName);
            if (result > 0)
            {
                var log = new Tuhu.Provisioning.DataAccess.Entity.OprLog
                {
                    ObjectID    = PKID,
                    ObjectType  = "ProConfig",
                    BeforeValue = "Delete",
                    AfterValue  = "",
                    Author      = userName,
                    Operation   = "删除商品配置信息"
                };
                new OprLogManager().AddOprLog(log);
            }
            return(Json(result));
        }
Exemple #13
0
        public ActionResult Add(tbl_TuhuNews tn)
        {
            var    userName = HttpContext.User.Identity.Name;
            string strGUID  = System.Guid.NewGuid().ToString();

            tn.NewsGuid = new Guid(strGUID);
            int          result   = (int)DALTuhuNews.InsertTuhuNews(new SqlConnection(strConn), tn);
            tbl_TuhuNews Tuhunews = DALTuhuNews.SelectNewsbyID(new SqlConnection(strConn));

            if (result > 0)
            {
                var oprLog = new Tuhu.Provisioning.DataAccess.Entity.OprLog
                {
                    ObjectID   = result,
                    ObjectType = "TuhuNews",
                    Author     = userName,
                    Operation  = "添加途虎新闻"
                };
                new Tuhu.Provisioning.Business.OprLogManagement.OprLogManager().AddOprLog(oprLog);
            }
            return(Json(result));
        }
        public JsonResult Save(UserPromotionCodeModel model)
        {
            if (model == null)
            {
                return(Json(new { result = 0, msg = "无法获取数据对象" }));
            }
            var result = 0;

            model.LastUpdateBy = HttpContext.User.Identity.Name;
            if (string.IsNullOrWhiteSpace(model.RewardValue))
            {
                model.RewardValue = "0";
            }
            if (string.IsNullOrWhiteSpace(model.RewardId))
            {
                model.RewardId = "0";
            }
            if (model.Id <= 0)
            {
                model.LastUpdateBy = model.LastUpdateBy;
                result             = DALUserPromotionCode.Add(model);
            }
            else
            {
                model.LastUpdateDateTime = DateTime.Now;
                result = DALUserPromotionCode.Update(model);
            }
            var oprLog = new Tuhu.Provisioning.DataAccess.Entity.OprLog
            {
                ObjectID   = model.Id,
                ObjectType = "UserPromotionCode",
                Author     = HttpContext.User.Identity.Name,
                Operation  = model.Id > 0 ? "更新" : "新增" + "UserPromotionCode配置"
            };
            var operLogManager = new Business.OprLogManagement.OprLogManager();

            operLogManager.AddOprLogAsync(oprLog);
            return(Json(new { result = result, msg = "操作成功" }));
        }