Ejemplo n.º 1
0
 protected void btnok_Click(object sender, System.EventArgs e)
 {
     if (base.Action.Equals(ActionType.Add.ToString()) && !base.IsAuthorizedOp(ActionType.Add.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else if (base.Action.Equals(ActionType.Modify.ToString()) && !base.IsAuthorizedOp(ActionType.Modify.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else
     {
         SettingCategoryInfo settingCategoryInfo = new SettingCategoryInfo();
         if (base.IsEdit)
         {
             settingCategoryInfo = SettingCategory.GetDataById(base.OpID);
         }
         settingCategoryInfo.CateName      = WebUtils.GetString(this.TextBox1.Text);
         settingCategoryInfo.CateDesc      = WebUtils.GetString(this.TextBox2.Text);
         settingCategoryInfo.IsUsing       = true;
         settingCategoryInfo.AutoTimeStamp = System.DateTime.Now;
         if (string.IsNullOrEmpty(settingCategoryInfo.CateName))
         {
             base.ShowMsg("Tên loại Cấu hình không thể để trống");
         }
         else if (string.IsNullOrEmpty(settingCategoryInfo.CateDesc))
         {
             base.ShowMsg("Tên hiển thị không thể để trống");
         }
         else
         {
             if (base.Action.Equals(ActionType.Add.ToString()))
             {
                 if (SettingCategory.Add(settingCategoryInfo) > 0)
                 {
                     CacheUtils.Del("JsonLeeCMS_CacheForGetSettingCategory");
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "Thêm cấu hình tùy chỉnh [" + settingCategoryInfo.CateDesc + "] thành công");
                     MessageUtils.DialogCloseAndParentReload(this);
                 }
                 else
                 {
                     base.ShowMsg("Thêm cấu hình tùy chỉnh thất bại");
                 }
             }
             if (base.Action.Equals(ActionType.Modify.ToString()))
             {
                 if (SettingCategory.Update(settingCategoryInfo))
                 {
                     CacheUtils.Del("JsonLeeCMS_CacheForGetSettingCategory");
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "Sửa đổi các cấu hình tùy chỉnh [" + settingCategoryInfo.CateDesc + "] thành công");
                     MessageUtils.DialogCloseAndParentReload(this);
                 }
                 else
                 {
                     base.ShowMsg("Sửa đổi các cấu hình tùy chỉnh thất bại");
                 }
             }
         }
     }
 }
Ejemplo n.º 2
0
 protected void btnok_Click(object sender, System.EventArgs e)
 {
     if (base.Action.Equals(ActionType.Add.ToString()) && !base.IsAuthorizedOp(ActionType.Add.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else if (base.Action.Equals(ActionType.Modify.ToString()) && !base.IsAuthorizedOp(ActionType.Modify.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else if (base.Action.Equals(ActionType.Modify.ToString()))
     {
         System.Collections.Generic.List <OAuthConfig> list = OAuthConfig.LoadAll();
         if (list != null)
         {
             string strMsg = string.Empty;
             foreach (OAuthConfig current in list)
             {
                 if (current.OAuthKey == WebUtils.GetQueryString("key"))
                 {
                     current.OAuthAppId  = WebUtils.GetString(this.TextBox1.Text);
                     current.OAuthAppKey = WebUtils.GetString(this.TextBox2.Text);
                     strMsg = "配置第三方登录[" + current.OAuthName + "]参数";
                     break;
                 }
             }
             OAuthConfig.Save(list);
             PageBase.log.AddEvent(base.LoginAccount.AccountName, strMsg);
             MessageUtils.DialogCloseAndParentReload(this);
         }
     }
 }
Ejemplo n.º 3
0
 protected void btnok_Click(object sender, System.EventArgs e)
 {
     if (base.Action.Equals("Reply") && !base.IsAuthorizedOp("Reply"))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else
     {
         EvaluationInfo dataById = Evaluation.GetDataById(base.OpID);
         dataById.ReplyContent = base.Server.HtmlEncode(this.txtReply.Text);
         if (!string.IsNullOrEmpty(dataById.ReplyContent))
         {
             dataById.Replier   = base.AccountName;
             dataById.ReplyTime = System.DateTime.Now;
         }
         else
         {
             dataById.Replier   = string.Empty;
             dataById.ReplyTime = new System.DateTime(1900, 1, 1);
         }
         if (Evaluation.Update(dataById))
         {
             PageBase.log.AddEvent(base.LoginAccount.AccountName, "回复评论[" + this.eva.Content + "] thành công");
             MessageUtils.DialogCloseAndParentReload(this);
         }
         else
         {
             base.ShowMsg("Thao tác thất bại");
         }
     }
 }
Ejemplo n.º 4
0
 protected void btnok_Click(object sender, System.EventArgs e)
 {
     if (base.Action.Equals(ActionType.Add.ToString()) && !base.IsAuthorizedOp(ActionType.Add.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else if (base.Action.Equals(ActionType.Modify.ToString()) && !base.IsAuthorizedOp(ActionType.Modify.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else
     {
         DingYueInfo dingYueInfo = new DingYueInfo();
         if (base.IsEdit)
         {
             dingYueInfo = SinGooCMS.BLL.DingYue.GetDataById(base.OpID);
         }
         dingYueInfo.UserName  = WebUtils.GetString(this.TextBox1.Text);
         dingYueInfo.Email     = WebUtils.GetString(this.TextBox2.Text);
         dingYueInfo.IsTuiDing = !this.istuiding.Checked;
         if (string.IsNullOrEmpty(dingYueInfo.UserName))
         {
             base.ShowMsg("请输入用户名称");
         }
         if (!ValidateUtils.IsEmail(dingYueInfo.Email))
         {
             base.ShowMsg("请输入有效的邮箱地址");
         }
         else
         {
             if (base.Action.Equals(ActionType.Add.ToString()))
             {
                 dingYueInfo.Lang          = base.cultureLang;
                 dingYueInfo.AutoTimeStamp = System.DateTime.Now;
                 if (SinGooCMS.BLL.DingYue.Add(dingYueInfo) > 0)
                 {
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "添加订阅邮箱[" + dingYueInfo.Email + "] thành công");
                     MessageUtils.DialogCloseAndParentReload(this);
                 }
                 else
                 {
                     base.ShowMsg("Thao tác thất bại");
                 }
             }
             if (base.Action.Equals(ActionType.Modify.ToString()))
             {
                 if (SinGooCMS.BLL.DingYue.Update(dingYueInfo))
                 {
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "修改订阅邮箱[" + dingYueInfo.Email + "] thành công");
                     MessageUtils.DialogCloseAndParentReload(this);
                 }
                 else
                 {
                     base.ShowMsg("Thao tác thất bại");
                 }
             }
         }
     }
 }
Ejemplo n.º 5
0
 protected void btnok_Click(object sender, System.EventArgs e)
 {
     if (base.Action.Equals(ActionType.Add.ToString()) && !base.IsAuthorizedOp(ActionType.Add.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else if (base.Action.Equals(ActionType.Modify.ToString()) && !base.IsAuthorizedOp(ActionType.Modify.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else
     {
         AdPlaceInfo adPlaceInfo = new AdPlaceInfo();
         if (base.IsEdit)
         {
             adPlaceInfo = AdPlace.GetDataById(base.OpID);
         }
         adPlaceInfo.PlaceName    = WebUtils.GetString(this.TextBox1.Text);
         adPlaceInfo.Width        = WebUtils.GetInt(this.TextBox2.Text);
         adPlaceInfo.Height       = WebUtils.GetInt(this.TextBox3.Text);
         adPlaceInfo.TemplateFile = WebUtils.GetString(this.TextBox5.Text);
         adPlaceInfo.PlaceDesc    = WebUtils.GetString(this.TextBox6.Text);
         adPlaceInfo.Lang         = base.cultureLang;
         if (string.IsNullOrEmpty(adPlaceInfo.PlaceName))
         {
             base.ShowMsg("请输入广告位名称");
         }
         else
         {
             if (base.Action.Equals(ActionType.Add.ToString()))
             {
                 adPlaceInfo.Price         = 0.0m;
                 adPlaceInfo.Sort          = AdPlace.MaxSort + 1;
                 adPlaceInfo.AutoTimeStamp = System.DateTime.Now;
                 if (AdPlace.Add(adPlaceInfo) > 0)
                 {
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "添加广告位[" + adPlaceInfo.PlaceName + "] thành công");
                     MessageUtils.DialogCloseAndParentReload(this);
                 }
                 else
                 {
                     base.ShowMsg("添加广告位失败");
                 }
             }
             if (base.Action.Equals(ActionType.Modify.ToString()))
             {
                 if (AdPlace.Update(adPlaceInfo))
                 {
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "修改广告位[" + adPlaceInfo.PlaceName + "] thành công");
                     MessageUtils.DialogCloseAndParentReload(this);
                 }
                 else
                 {
                     base.ShowMsg("修改广告位失败");
                 }
             }
         }
     }
 }
Ejemplo n.º 6
0
 protected void btnok_Click(object sender, System.EventArgs e)
 {
     if (base.Action.Equals(ActionType.Add.ToString()) && !base.IsAuthorizedOp(ActionType.Add.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else if (base.Action.Equals(ActionType.Modify.ToString()) && !base.IsAuthorizedOp(ActionType.Modify.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else
     {
         BrandInfo brandInfo = new BrandInfo();
         if (base.IsEdit)
         {
             brandInfo = Brand.GetDataById(base.OpID);
         }
         brandInfo.BrandName     = WebUtils.GetString(this.TextBox1.Text);
         brandInfo.CompanyName   = string.Empty;
         brandInfo.OfficialSite  = WebUtils.GetString(this.TextBox3.Text);
         brandInfo.IndName       = WebUtils.GetString(this.DropDownList4.SelectedValue);
         brandInfo.BrandDesc     = WebUtils.GetString(this.TextBox5.Text);
         brandInfo.Sort          = Brand.MaxSort + 1;
         brandInfo.IsRecommend   = false;
         brandInfo.AutoTimeStamp = System.DateTime.Now;
         if (string.IsNullOrEmpty(brandInfo.BrandName))
         {
             base.ShowMsg("品牌名称不为空!");
         }
         else
         {
             if (base.Action.Equals(ActionType.Add.ToString()))
             {
                 if (Brand.Add(brandInfo) > 0)
                 {
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "添加品牌[" + brandInfo.BrandDesc + "] thành công");
                     MessageUtils.DialogCloseAndParentReload(this);
                 }
                 else
                 {
                     base.ShowMsg("添加品牌失败");
                 }
             }
             if (base.Action.Equals(ActionType.Modify.ToString()))
             {
                 if (Brand.Update(brandInfo))
                 {
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "修改品牌[" + brandInfo.BrandName + "] thành công");
                     MessageUtils.DialogCloseAndParentReload(this);
                 }
                 else
                 {
                     base.ShowMsg("修改品牌失败");
                 }
             }
         }
     }
 }
Ejemplo n.º 7
0
 protected void btnok_Click(object sender, System.EventArgs e)
 {
     if (base.Action.Equals(ActionType.Add.ToString()) && !base.IsAuthorizedOp(ActionType.Add.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else if (base.Action.Equals(ActionType.Modify.ToString()) && !base.IsAuthorizedOp(ActionType.Modify.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else
     {
         UserLevelInfo userLevelInfo = new UserLevelInfo();
         if (base.IsEdit)
         {
             userLevelInfo = SinGooCMS.BLL.UserLevel.GetCacheUserLevelById(base.OpID);
         }
         userLevelInfo.LevelName = WebUtils.GetString(this.TextBox1.Text);
         userLevelInfo.Integral  = WebUtils.StringToInt(this.TextBox2.Text);
         userLevelInfo.Discount  = (double)WebUtils.StringToDecimal(this.TextBox3.Text);
         userLevelInfo.LevelDesc = WebUtils.GetString(this.TextBox4.Text);
         userLevelInfo.Sort      = SinGooCMS.BLL.UserLevel.MaxSort + 1;
         if (string.IsNullOrEmpty(userLevelInfo.LevelName))
         {
             base.ShowMsg("用户等级名称不为空!");
         }
         else
         {
             if (base.Action.Equals(ActionType.Add.ToString()))
             {
                 if (SinGooCMS.BLL.UserLevel.Add(userLevelInfo) > 0)
                 {
                     CacheUtils.Del("JsonLeeCMS_CacheForGetUserLevel");
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "添加用户等级[" + userLevelInfo.LevelName + "] thành công");
                     MessageUtils.DialogCloseAndParentReload(this);
                 }
                 else
                 {
                     base.ShowMsg("添加用户等级失败");
                 }
             }
             if (base.Action.Equals(ActionType.Modify.ToString()))
             {
                 if (SinGooCMS.BLL.UserLevel.Update(userLevelInfo))
                 {
                     CacheUtils.Del("JsonLeeCMS_CacheForGetUserLevel");
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "修改用户等级[" + userLevelInfo.LevelName + "] thành công");
                     MessageUtils.DialogCloseAndParentReload(this);
                 }
                 else
                 {
                     base.ShowMsg("修改用户等级失败");
                 }
             }
         }
     }
 }
Ejemplo n.º 8
0
 protected void btnok_Click(object sender, System.EventArgs e)
 {
     if (base.Action.Equals(ActionType.Add.ToString()) && !base.IsAuthorizedOp(ActionType.Add.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else if (base.Action.Equals(ActionType.Modify.ToString()) && !base.IsAuthorizedOp(ActionType.Modify.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else
     {
         VoteInfo voteInfo = new VoteInfo();
         if (base.IsEdit)
         {
             voteInfo = SinGooCMS.BLL.Vote.GetDataById(base.OpID);
         }
         voteInfo.Title         = WebUtils.GetString(this.TextBox1.Text);
         voteInfo.IsMultiChoice = this.chkdx.Checked;
         voteInfo.IsAnonymous   = this.chknm.Checked;
         voteInfo.IsAudit       = this.chksh.Checked;
         if (string.IsNullOrEmpty(voteInfo.Title))
         {
             base.ShowMsg("请输入在线调查主题名称");
         }
         else
         {
             if (base.Action.Equals(ActionType.Add.ToString()))
             {
                 voteInfo.Sort          = SinGooCMS.BLL.Vote.MaxSort + 1;
                 voteInfo.AutoTimeStamp = System.DateTime.Now;
                 voteInfo.Lang          = base.cultureLang;
                 if (SinGooCMS.BLL.Vote.Add(voteInfo) > 0)
                 {
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "添加在线调查[" + voteInfo.Title + "] thành công");
                     MessageUtils.DialogCloseAndParentReload(this);
                 }
                 else
                 {
                     base.ShowMsg("添加在线调查失败");
                 }
             }
             if (base.Action.Equals(ActionType.Modify.ToString()))
             {
                 if (SinGooCMS.BLL.Vote.Update(voteInfo))
                 {
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "修改在线调查[" + voteInfo.Title + "] thành công");
                     MessageUtils.DialogCloseAndParentReload(this);
                 }
                 else
                 {
                     base.ShowMsg("修改在线调查失败");
                 }
             }
         }
     }
 }
Ejemplo n.º 9
0
 protected void btnok_Click(object sender, System.EventArgs e)
 {
     if (base.Action.Equals(ActionType.Add.ToString()) && !base.IsAuthorizedOp(ActionType.Add.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else if (base.Action.Equals(ActionType.Modify.ToString()) && !base.IsAuthorizedOp(ActionType.Modify.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else
     {
         TagsInfo tagsInfo = new TagsInfo();
         if (base.IsEdit)
         {
             tagsInfo = SinGooCMS.BLL.Tags.GetDataById(base.OpID);
         }
         tagsInfo.TagName     = WebUtils.GetString(this.TextBox1.Text);
         tagsInfo.TagUrl      = WebUtils.GetString(this.TextBox2.Text);
         tagsInfo.Sort        = SinGooCMS.BLL.Tags.MaxSort + 1;
         tagsInfo.IsTop       = false;
         tagsInfo.IsRecommend = false;
         if (string.IsNullOrEmpty(tagsInfo.TagName))
         {
             base.ShowMsg("Vui lòng nhập một thẻ tag");
         }
         else
         {
             if (base.Action.Equals(ActionType.Add.ToString()))
             {
                 tagsInfo.AutoTimeStamp = System.DateTime.Now;
                 tagsInfo.Lang          = base.cultureLang;
                 if (SinGooCMS.BLL.Tags.Add(tagsInfo) > 0)
                 {
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "Thêm thẻ tag [" + tagsInfo.TagName + "] thành công");
                     MessageUtils.DialogCloseAndParentReload(this);
                 }
                 else
                 {
                     base.ShowMsg("Thêm thẻ thất bại");
                 }
             }
             if (base.Action.Equals(ActionType.Modify.ToString()))
             {
                 if (SinGooCMS.BLL.Tags.Update(tagsInfo))
                 {
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "Sửa đổi thẻ tag [" + tagsInfo.TagName + "] thành công");
                     MessageUtils.DialogCloseAndParentReload(this);
                 }
                 else
                 {
                     base.ShowMsg("Sửa đổi thẻ tag thất bại");
                 }
             }
         }
     }
 }
Ejemplo n.º 10
0
 protected void btnok_Click(object sender, System.EventArgs e)
 {
     if (base.Action.Equals(ActionType.Add.ToString()) && !base.IsAuthorizedOp(ActionType.Add.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else if (base.Action.Equals(ActionType.Modify.ToString()) && !base.IsAuthorizedOp(ActionType.Modify.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else
     {
         string     @string    = WebUtils.GetString(this.TextBox1.Text);
         FolderInfo folderInfo = new FolderInfo();
         if (base.IsEdit)
         {
             folderInfo = Folder.GetDataById(base.OpID);
         }
         folderInfo.FolderName = @string;
         folderInfo.ParentID   = 0;
         folderInfo.Remark     = WebUtils.GetString(this.TextBox4.Text);
         folderInfo.Sort       = Folder.MaxSort + 1;
         if (string.IsNullOrEmpty(@string))
         {
             base.ShowMsg("文件夹名称不能为空!");
         }
         else
         {
             if (base.Action.Equals(ActionType.Add.ToString()))
             {
                 folderInfo.Lang          = base.cultureLang;
                 folderInfo.AutoTimeStamp = System.DateTime.Now;
                 if (Folder.AddExt(folderInfo) > 0)
                 {
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "添加文件夹[" + folderInfo.FolderName + "] thành công");
                     MessageUtils.DialogCloseAndParentReload(this);
                 }
                 else
                 {
                     base.ShowMsg("添加失败");
                 }
             }
             if (base.Action.Equals(ActionType.Modify.ToString()))
             {
                 if (Folder.Update(folderInfo))
                 {
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "修改文件夹[" + folderInfo.FolderName + "] thành công");
                     MessageUtils.DialogCloseAndParentReload(this);
                 }
                 else
                 {
                     base.ShowMsg("修改失败");
                 }
             }
         }
     }
 }
Ejemplo n.º 11
0
 protected void btnok_Click(object sender, System.EventArgs e)
 {
     if (base.Action.Equals(ActionType.Add.ToString()) && !base.IsAuthorizedOp(ActionType.Add.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else if (base.Action.Equals(ActionType.Modify.ToString()) && !base.IsAuthorizedOp(ActionType.Modify.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else
     {
         int          queryInt     = WebUtils.GetQueryInt("voteid", 0);
         VoteItemInfo voteItemInfo = new VoteItemInfo();
         if (base.IsEdit)
         {
             voteItemInfo = SinGooCMS.BLL.VoteItem.GetDataById(base.OpID);
         }
         voteItemInfo.VoteOption = WebUtils.GetString(this.TextBox1.Text);
         voteItemInfo.VoteNum    = WebUtils.GetInt(this.TextBox2.Text);
         if (string.IsNullOrEmpty(voteItemInfo.VoteOption))
         {
             base.ShowMsg("请输入在在线调查选项名称");
         }
         else
         {
             if (base.Action.Equals(ActionType.Add.ToString()))
             {
                 voteItemInfo.VoteID        = queryInt;
                 voteItemInfo.AutoTimeStamp = System.DateTime.Now;
                 voteItemInfo.Lang          = base.cultureLang;
                 if (SinGooCMS.BLL.VoteItem.Add(voteItemInfo) > 0)
                 {
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "添加在线调查选项[" + voteItemInfo.VoteOption + "] thành công");
                     MessageUtils.DialogCloseAndParentReload(this);
                 }
                 else
                 {
                     base.ShowMsg("添加在线调查选项失败");
                 }
             }
             if (base.Action.Equals(ActionType.Modify.ToString()))
             {
                 if (SinGooCMS.BLL.VoteItem.Update(voteItemInfo))
                 {
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "修改在线调查选项[" + voteItemInfo.VoteOption + "] thành công");
                     MessageUtils.DialogCloseAndParentReload(this);
                 }
                 else
                 {
                     base.ShowMsg("修改在线调查选项失败");
                 }
             }
         }
     }
 }
Ejemplo n.º 12
0
 protected void btnok_Click(object sender, System.EventArgs e)
 {
     if (!base.IsAuthorizedOp("Reply"))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else
     {
         string text = base.Server.HtmlEncode(this.txtReply.Text);
         if (string.IsNullOrEmpty(text))
         {
             base.ShowMsg("请输入回复内容");
         }
         else
         {
             FeedbackInfo dataById = SinGooCMS.BLL.Feedback.GetDataById(base.OpID);
             dataById.Replier      = base.LoginAccount.AccountName;
             dataById.ReplyContent = text;
             dataById.ReplyDate    = System.DateTime.Now;
             if (SinGooCMS.BLL.Feedback.Update(dataById))
             {
                 string @string     = WebUtils.GetString(this.txtMail.Text);
                 string strMailBody = string.Concat(new string[]
                 {
                     "来自管理员的回复:<br/><div style='border-bottom:1px solid #ccc'>",
                     text,
                     "</div><br/>",
                     PageBase.config.SiteName,
                     "(",
                     PageBase.config.SiteDomain,
                     ")"
                 });
                 string empty = string.Empty;
                 if (this.chkReply2Mail.Checked && ValidateUtils.IsEmail(@string))
                 {
                     MsgService.SendMail(@string, "来自管理员的回复", strMailBody, out empty);
                 }
                 if (!string.IsNullOrEmpty(empty) && "success" != empty)
                 {
                     base.ShowMsg(empty);
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "回复留言[" + this.feedback.Title + "] thành công,但发送邮件失败");
                 }
                 else
                 {
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "回复留言[" + dataById.Title + "] thành công");
                     MessageUtils.DialogCloseAndParentReload(this);
                 }
             }
             else
             {
                 base.ShowMsg("回复留言失败");
             }
         }
     }
 }
Ejemplo n.º 13
0
 protected void btnok_Click(object sender, System.EventArgs e)
 {
     if (base.Action.Equals(ActionType.Add.ToString()) && !base.IsAuthorizedOp(ActionType.Add.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else if (base.Action.Equals(ActionType.Modify.ToString()) && !base.IsAuthorizedOp(ActionType.Modify.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else
     {
         RoleInfo roleInfo = new RoleInfo();
         if (base.IsEdit)
         {
             roleInfo = SinGooCMS.BLL.Role.GetDataById(base.OpID);
         }
         roleInfo.RoleName = WebUtils.GetString(this.TextBox1.Text);
         roleInfo.Remark   = WebUtils.GetString(this.TextBox2.Text);
         if (string.IsNullOrEmpty(roleInfo.RoleName))
         {
             base.ShowMsg("角色名称不能为空");
         }
         else
         {
             if (base.Action.Equals(ActionType.Add.ToString()))
             {
                 roleInfo.IsSystem      = false;
                 roleInfo.Sort          = SinGooCMS.BLL.Role.MaxSort + 1;
                 roleInfo.AutoTimeStamp = System.DateTime.Now;
                 if (SinGooCMS.BLL.Role.Add(roleInfo) > 0)
                 {
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "添加角色[" + roleInfo.RoleName + "] thành công");
                     MessageUtils.DialogCloseAndParentReload(this);
                 }
                 else
                 {
                     base.ShowMsg("添加角色失败");
                 }
             }
             if (base.Action.Equals(ActionType.Modify.ToString()))
             {
                 if (SinGooCMS.BLL.Role.Update(roleInfo))
                 {
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "修改角色[" + roleInfo.RoleName + "] thành công");
                     MessageUtils.DialogCloseAndParentReload(this);
                 }
                 else
                 {
                     base.ShowMsg("修改角色失败");
                 }
             }
         }
     }
 }
Ejemplo n.º 14
0
 protected void btnok_Click(object sender, System.EventArgs e)
 {
     if (base.Action.Equals(ActionType.Add.ToString()) && !base.IsAuthorizedOp(ActionType.Add.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else if (base.Action.Equals(ActionType.Modify.ToString()) && !base.IsAuthorizedOp(ActionType.Modify.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else
     {
         System.Collections.Generic.Dictionary <string, SinGooCMS.Plugin.MessageSet> dictionary = SinGooCMS.Plugin.MessageSet.LoadDict();
         SinGooCMS.Plugin.MessageSet messageSet = dictionary[WebUtils.GetQueryString("setkey")];
         string queryString = WebUtils.GetQueryString("type");
         string text        = queryString.ToLower().Trim();
         if (text != null)
         {
             if (!(text == "msg"))
             {
                 if (!(text == "mail"))
                 {
                     if (text == "sms")
                     {
                         messageSet.SMSTemplate = this.TextBox3.Text;
                     }
                 }
                 else
                 {
                     messageSet.MailTitle    = WebUtils.GetString(this.TextBox1.Text);
                     messageSet.MailTemplate = this.TextBox2.Text;
                 }
             }
             else
             {
                 messageSet.MessageTitle    = WebUtils.GetString(this.TextBox1.Text);
                 messageSet.MessageTemplate = this.TextBox3.Text;
             }
         }
         if (base.Action.Equals(ActionType.Modify.ToString()))
         {
             try
             {
                 SinGooCMS.Plugin.MessageSet.Save(dictionary);
                 PageBase.log.AddEvent(base.LoginAccount.AccountName, "Sửa đổi Cài đặt tin nhắn [" + messageSet.SetType + "] thành công");
                 MessageUtils.DialogCloseAndParentReload(this);
             }
             catch (System.Exception ex)
             {
                 base.ShowMsg("Thao tác thất bại:" + ex.Message);
             }
         }
     }
 }
Ejemplo n.º 15
0
 protected void btnok_Click(object sender, System.EventArgs e)
 {
     if (!base.IsAuthorizedOp("Copy"))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else
     {
         CouponsInfo dataById = SinGooCMS.BLL.Coupons.GetDataById(base.OpID);
         int         @int     = WebUtils.GetInt(this.TextBox1.Text);
         if (dataById == null)
         {
             base.ShowMsg("找不到原始优惠券信息!");
         }
         else if (@int <= 0)
         {
             base.ShowMsg("无效的复制张数!");
         }
         else if (@int > 10000)
         {
             base.ShowMsg("最大不能超过10000张!");
         }
         else
         {
             string text = string.Empty;
             for (int i = 0; i < @int; i++)
             {
                 if (!SinGooCMS.BLL.Coupons.Copy(dataById))
                 {
                     text = text + "复制第" + i.ToString() + "条优惠券时发生错误";
                     break;
                 }
                 System.Threading.Thread.Sleep(50);
             }
             if (string.IsNullOrEmpty(text))
             {
                 PageBase.log.AddEvent(base.LoginAccount.AccountName, string.Concat(new string[]
                 {
                     "批量复制",
                     @int.ToString(),
                     "张优惠券[",
                     dataById.Title,
                     "] thành công"
                 }));
                 MessageUtils.DialogCloseAndParentReload(this);
             }
             else
             {
                 base.ShowMsg(text);
             }
         }
     }
 }
Ejemplo n.º 16
0
 protected void btnok_Click(object sender, System.EventArgs e)
 {
     if (base.Action.Equals(ActionType.Add.ToString()) && !base.IsAuthorizedOp(ActionType.Add.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else if (base.Action.Equals(ActionType.Modify.ToString()) && !base.IsAuthorizedOp(ActionType.Modify.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else
     {
         SearchRankInfo searchRankInfo = new SearchRankInfo();
         if (base.IsEdit)
         {
             searchRankInfo = SinGooCMS.BLL.SearchRank.GetDataById(base.OpID);
         }
         searchRankInfo.SearchKey   = WebUtils.GetString(this.TextBox1.Text);
         searchRankInfo.Times       = WebUtils.GetInt(this.TextBox2.Text);
         searchRankInfo.IsRecommend = this.CheckBox3.Checked;
         if (string.IsNullOrEmpty(searchRankInfo.SearchKey))
         {
             base.ShowMsg("请输入搜索关键字");
         }
         else
         {
             if (base.Action.Equals(ActionType.Add.ToString()))
             {
                 if (SinGooCMS.BLL.SearchRank.Add(searchRankInfo) > 0)
                 {
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "添加搜索关键字[" + searchRankInfo.SearchKey + "] thành công");
                     MessageUtils.DialogCloseAndParentReload(this);
                 }
                 else
                 {
                     base.ShowMsg("Thao tác thất bại");
                 }
             }
             if (base.Action.Equals(ActionType.Modify.ToString()))
             {
                 if (SinGooCMS.BLL.SearchRank.Update(searchRankInfo))
                 {
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "修改搜索关键字[" + searchRankInfo.SearchKey + "] thành công");
                     MessageUtils.DialogCloseAndParentReload(this);
                 }
                 else
                 {
                     base.ShowMsg("Thao tác thất bại");
                 }
             }
         }
     }
 }
Ejemplo n.º 17
0
 protected void btnok_Click(object sender, System.EventArgs e)
 {
     if (base.Action.Equals(ActionType.Add.ToString()) && !base.IsAuthorizedOp(ActionType.Add.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else if (base.Action.Equals(ActionType.Modify.ToString()) && !base.IsAuthorizedOp(ActionType.Modify.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else
     {
         string text = WebUtils.GetString(this.txtFileName.Text) + this.ddlFileType.SelectedItem;
         if (string.IsNullOrEmpty(WebUtils.GetString(this.txtFileName.Text)))
         {
             base.ShowMsg("请输入模板文件名");
         }
         else if (text.IndexOf(".") == -1)
         {
             base.ShowMsg("模板文件格式不正确,没有找到扩展名");
         }
         else
         {
             if (base.Action.Equals(ActionType.Add.ToString()))
             {
                 this.strFileName = text;
                 FileUtils.CreateFile(this.GetTemplateFilePath(), this.FileContent.Text);
                 PageBase.log.AddEvent(base.LoginAccount.AccountName, "创建模板文件[" + this.GetTemplateFilePath() + "] thành công");
                 MessageUtils.DialogCloseAndParentReload(this);
             }
             if (base.Action.Equals(ActionType.Modify.ToString()))
             {
                 if (this.strFileName != text)
                 {
                     FileUtils.ReNameFile(this.strFolderPath, this.strFileName, text, 1);
                     this.strFileName = text;
                 }
                 FileUtils.WriteFileContent(this.GetTemplateFilePath(), this.FileContent.Text, false);
                 PageBase.log.AddEvent(base.LoginAccount.AccountName, "修改模板文件[" + this.GetTemplateFilePath() + "] thành công");
                 MessageUtils.DialogCloseAndParentReload(this);
             }
         }
     }
 }
Ejemplo n.º 18
0
 protected void btnok_Click(object sender, System.EventArgs e)
 {
     if (!base.IsAuthorizedOp("SetRole"))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else
     {
         this.account.Roles = base.GetRepeaterCheckIDs(this.Repeater1, "checkbox", "autoid");
         if (SinGooCMS.BLL.Account.Update(this.account))
         {
             PageBase.log.AddEvent(base.LoginAccount.AccountName, "设置帐户[" + this.account.AccountName + "]的角色成功");
             MessageUtils.DialogCloseAndParentReload(this);
         }
         else
         {
             base.ShowMsg("Thao tác thất bại");
         }
     }
 }
Ejemplo n.º 19
0
 protected void btnok_Click(object sender, System.EventArgs e)
 {
     if (base.Action.Equals("Reply") && !base.IsAuthorizedOp("Reply"))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else
     {
         GoodsQAInfo dataById = SinGooCMS.BLL.GoodsQA.GetDataById(base.OpID);
         dataById.Answer = base.Server.HtmlEncode(this.txtReply.Text);
         if (SinGooCMS.BLL.GoodsQA.Update(dataById))
         {
             PageBase.log.AddEvent(base.LoginAccount.AccountName, "回复商品咨询成功");
             MessageUtils.DialogCloseAndParentReload(this);
         }
         else
         {
             base.ShowMsg("Thao tác thất bại");
         }
     }
 }
Ejemplo n.º 20
0
 protected void btnok_Click(object sender, System.EventArgs e)
 {
     if (base.Action.Equals(ActionType.Add.ToString()) && !base.IsAuthorizedOp(ActionType.Add.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else if (base.Action.Equals(ActionType.Modify.ToString()) && !base.IsAuthorizedOp(ActionType.Modify.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else
     {
         AccountInfo accountInfo = new AccountInfo();
         if (base.IsEdit)
         {
             accountInfo = SinGooCMS.BLL.Account.GetDataById(base.OpID);
         }
         string @string = WebUtils.GetString(this.TextBox2.Text);
         if (accountInfo.AccountName != "superadmin")
         {
             accountInfo.AccountName = WebUtils.GetString(this.TextBox1.Text);
         }
         accountInfo.Email         = WebUtils.GetString(this.TextBox3.Text);
         accountInfo.Mobile        = WebUtils.GetString(this.TextBox4.Text);
         accountInfo.AutoTimeStamp = System.DateTime.Now;
         if (string.IsNullOrEmpty(accountInfo.AccountName))
         {
             base.ShowMsg("帐户名称不能为空");
         }
         else
         {
             if (base.Action.Equals(ActionType.Add.ToString()))
             {
                 if (string.IsNullOrEmpty(@string))
                 {
                     base.ShowMsg("帐户密码不为空");
                     return;
                 }
                 accountInfo.Password = DEncryptUtils.SHA512Encrypt(@string);
                 accountInfo.IsSystem = false;
                 if (SinGooCMS.BLL.Account.Add(accountInfo) > 0)
                 {
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "添加角色[" + accountInfo.AccountName + "] thành công");
                     MessageUtils.DialogCloseAndParentReload(this);
                 }
                 else
                 {
                     base.ShowMsg("添加角色失败");
                 }
             }
             if (base.Action.Equals(ActionType.Modify.ToString()))
             {
                 if (!string.IsNullOrEmpty(@string))
                 {
                     accountInfo.Password = DEncryptUtils.SHA512Encrypt(@string);
                 }
                 if (SinGooCMS.BLL.Account.Update(accountInfo))
                 {
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "修改角色[" + accountInfo.AccountName + "] thành công");
                     MessageUtils.DialogCloseAndParentReload(this);
                 }
                 else
                 {
                     base.ShowMsg("修改角色失败");
                 }
             }
         }
     }
 }
Ejemplo n.º 21
0
 protected void btnok_Click(object sender, System.EventArgs e)
 {
     if (base.Action.Equals(ActionType.Add.ToString()) && !base.IsAuthorizedOp(ActionType.Add.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else if (base.Action.Equals(ActionType.Modify.ToString()) && !base.IsAuthorizedOp(ActionType.Modify.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else
     {
         CatalogInfo catalogInfo = new CatalogInfo();
         if (base.IsEdit)
         {
             catalogInfo = Catalog.GetCacheCatalogById(base.OpID);
         }
         catalogInfo.CatalogName = WebUtils.GetString(this.TextBox1.Text);
         catalogInfo.Remark      = WebUtils.GetString(this.TextBox3.Text);
         if (!base.IsEdit)
         {
             catalogInfo.CatalogCode = WebUtils.GetString(this.TextBox2.Text);
             CatalogInfo cacheCatalogByCode = Catalog.GetCacheCatalogByCode(catalogInfo.CatalogCode);
             if (cacheCatalogByCode != null)
             {
                 base.ShowMsg("栏目代码已存在");
                 return;
             }
         }
         if (string.IsNullOrEmpty(catalogInfo.CatalogName) || string.IsNullOrEmpty(catalogInfo.CatalogCode))
         {
             base.ShowMsg("栏目名称和栏目代码不能为空");
         }
         else
         {
             if (base.Action.Equals(ActionType.Add.ToString()))
             {
                 catalogInfo.AutoTimeStamp = System.DateTime.Now;
                 catalogInfo.IsSystem      = false;
                 catalogInfo.Sort          = Catalog.MaxSort + 1;
                 if (Catalog.Add(catalogInfo) > 0)
                 {
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "添加栏目[" + catalogInfo.CatalogName + "] thành công");
                     MessageUtils.DialogCloseAndParentReload(this);
                 }
                 else
                 {
                     base.ShowMsg("添加栏目失败");
                 }
             }
             if (base.Action.Equals(ActionType.Modify.ToString()))
             {
                 if (Catalog.Update(catalogInfo))
                 {
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "修改栏目[" + catalogInfo.CatalogName + "] thành công");
                     MessageUtils.DialogCloseAndParentReload(this);
                 }
                 else
                 {
                     base.ShowMsg("修改栏目失败");
                 }
             }
         }
     }
 }
Ejemplo n.º 22
0
 protected void btnok_Click(object sender, System.EventArgs e)
 {
     if (base.Action.Equals(ActionType.Add.ToString()) && !base.IsAuthorizedOp(ActionType.Add.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else if (base.Action.Equals(ActionType.Modify.ToString()) && !base.IsAuthorizedOp(ActionType.Modify.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else
     {
         DictsInfo dataById   = Dicts.GetDataById(WebUtils.GetQueryInt("dictid"));
         string    strKeyName = WebUtils.GetString(this.TextBox1.Text);
         string    @string    = WebUtils.GetString(this.TextBox2.Text);
         int       @int       = WebUtils.GetInt(this.TextBox3.Text);
         if (string.IsNullOrEmpty(strKeyName))
         {
             base.ShowMsg("Nội dung Từ điển quan trọng không thể để trống");
         }
         else if (string.IsNullOrEmpty(@string))
         {
             base.ShowMsg("Giá trị từ điền không thể để trống");
         }
         else if (base.Action.Equals(ActionType.Add.ToString()) && dataById.Items.Exists((DictItemInfo p) => p.KeyName.Equals(strKeyName)))
         {
             base.ShowMsg("Nội dung từ điển đã tồn tại");
         }
         else
         {
             if (base.Action.Equals(ActionType.Add.ToString()))
             {
                 string text = string.Empty;
                 if (dataById.DictValue.IndexOf("[") == -1)
                 {
                     text = string.Concat(new object[]
                     {
                         "{\"KeyName\":\"",
                         strKeyName,
                         "\",\"KeyValue\":\"",
                         @string,
                         "\",\"Sort\":",
                         @int,
                         "}"
                     });
                 }
                 else
                 {
                     text = string.Concat(new object[]
                     {
                         dataById.DictValue.TrimStart(new char[]
                         {
                             '['
                         }).TrimEnd(new char[]
                         {
                             ']'
                         }),
                         ",{\"KeyName\":\"",
                         strKeyName,
                         "\",\"KeyValue\":\"",
                         @string,
                         "\",\"Sort\":",
                         @int,
                         "}"
                     });
                 }
                 dataById.DictValue = "[" + text.TrimStart(new char[]
                 {
                     ','
                 }) + "]";
                 if (Dicts.Update(dataById))
                 {
                     CacheUtils.Del("JsonLeeCMS_CacheForGetDicts");
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "Thêm nội dung từ điển [" + strKeyName + "] thành công");
                     MessageUtils.DialogCloseAndParentReload(this);
                 }
                 else
                 {
                     base.ShowMsg("Thao tác thất bại");
                 }
             }
             if (base.Action.Equals(ActionType.Modify.ToString()))
             {
                 DictItemInfo dictItemInfo = (from p in Dicts.GetDataById(WebUtils.GetQueryInt("dictid")).Items
                                              where p.KeyName.Equals(WebUtils.GetQueryString("key"))
                                              select p).FirstOrDefault <DictItemInfo>();
                 string oldValue = string.Concat(new object[]
                 {
                     "{\"KeyName\":\"",
                     dictItemInfo.KeyName,
                     "\",\"KeyValue\":\"",
                     dictItemInfo.KeyValue,
                     "\",\"Sort\":",
                     dictItemInfo.Sort,
                     "}"
                 });
                 string newValue = string.Concat(new object[]
                 {
                     "{\"KeyName\":\"",
                     strKeyName,
                     "\",\"KeyValue\":\"",
                     @string,
                     "\",\"Sort\":",
                     @int,
                     "}"
                 });
                 dataById.DictValue = dataById.DictValue.Replace(oldValue, newValue);
                 if (Dicts.Update(dataById))
                 {
                     CacheUtils.Del("JsonLeeCMS_CacheForGetDicts");
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "Sửa đổi nội dung từ điển [" + strKeyName + "] thành công");
                     MessageUtils.DialogCloseAndParentReload(this);
                 }
                 else
                 {
                     base.ShowMsg("Thao tác thất bại");
                 }
             }
         }
     }
 }
Ejemplo n.º 23
0
        protected void btnok_Click(object sender, System.EventArgs e)
        {
            if (base.Action.Equals(ActionType.Add.ToString()) && !base.IsAuthorizedOp(ActionType.Add.ToString()))
            {
                base.ShowMsg("Không có thẩm quyền");
            }
            else if (base.Action.Equals(ActionType.Modify.ToString()) && !base.IsAuthorizedOp(ActionType.Modify.ToString()))
            {
                base.ShowMsg("Không có thẩm quyền");
            }
            else
            {
                ContModelInfo contModelInfo = new ContModelInfo();
                if (base.IsEdit)
                {
                    contModelInfo = ContModel.GetCacheModelByID(base.OpID);
                }
                contModelInfo.ModelName = WebUtils.GetString(this.TextBox1.Text);
                contModelInfo.TableName = "cms_C_" + WebUtils.GetString(this.TextBox2.Text);
                contModelInfo.ModelDesc = WebUtils.GetString(this.TextBox3.Text);
                contModelInfo.IsUsing   = true;
                contModelInfo.Creator   = base.LoginAccount.AccountName;
                if (string.IsNullOrEmpty(contModelInfo.ModelName))
                {
                    base.ShowMsg("模型名称不能为空");
                }
                else if (string.IsNullOrEmpty(this.TextBox2.Text))
                {
                    base.ShowMsg("数据表名不能为空");
                }
                else
                {
                    if (base.Action.Equals(ActionType.Add.ToString()))
                    {
                        contModelInfo.AutoTimeStamp = System.DateTime.Now;
                        ModelAddState modelAddState  = ContModel.Add(contModelInfo);
                        ModelAddState modelAddState2 = modelAddState;
                        switch (modelAddState2)
                        {
                        case ModelAddState.Error:
                            base.ShowMsg("添加模型失败");
                            break;

                        case ModelAddState.ModelNameExists:
                            base.ShowMsg("模型名称已经存在");
                            break;

                        case ModelAddState.TableNameIsUsing:
                            base.ShowMsg("已经存在相同的自定义表名称");
                            break;

                        case ModelAddState.TableExists:
                            base.ShowMsg("自定义表已经存在");
                            break;

                        case ModelAddState.CreateTableError:
                            base.ShowMsg("创建自定义表失败");
                            break;

                        default:
                            if (modelAddState2 == ModelAddState.Success)
                            {
                                PageBase.log.AddEvent(base.LoginAccount.AccountName, "添加模型[" + contModelInfo.ModelName + "] thành công");
                                MessageUtils.DialogCloseAndParentReload(this);
                            }
                            break;
                        }
                    }
                    if (base.Action.Equals(ActionType.Modify.ToString()))
                    {
                        if (ContModel.Update(contModelInfo))
                        {
                            PageBase.log.AddEvent(base.LoginAccount.AccountName, "修改模型[" + contModelInfo.ModelName + "] thành công");
                            MessageUtils.DialogCloseAndParentReload(this);
                        }
                        else
                        {
                            base.ShowMsg("修改模型失败");
                        }
                    }
                }
            }
        }
Ejemplo n.º 24
0
 protected void btnok_Click(object sender, System.EventArgs e)
 {
     if (base.Action.Equals(ActionType.Add.ToString()) && !base.IsAuthorizedOp(ActionType.Add.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else if (base.Action.Equals(ActionType.Modify.ToString()) && !base.IsAuthorizedOp(ActionType.Modify.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else
     {
         DictsInfo dictsInfo = new DictsInfo();
         if (base.IsEdit)
         {
             dictsInfo = Dicts.GetDataById(base.OpID);
         }
         dictsInfo.DictName    = WebUtils.GetString(this.TextBox1.Text);
         dictsInfo.DisplayName = WebUtils.GetString(this.TextBox2.Text);
         if (string.IsNullOrEmpty(dictsInfo.DictName))
         {
             base.ShowMsg("Tên từ điển không thể để trống");
         }
         else if (string.IsNullOrEmpty(dictsInfo.DisplayName))
         {
             base.ShowMsg("Tên hiển thị không thể để trống");
         }
         else
         {
             if (base.Action.Equals(ActionType.Add.ToString()))
             {
                 if (Dicts.ExistsForName(dictsInfo.DictName))
                 {
                     base.ShowMsg("Khóa từ điển đã tồn tại!");
                 }
                 else
                 {
                     dictsInfo.IsSystem = false;
                     if (Dicts.Add(dictsInfo) > 0)
                     {
                         CacheUtils.Del("JsonLeeCMS_CacheForGetDicts");
                         PageBase.log.AddEvent(base.LoginAccount.AccountName, "Thêm từ điển [" + dictsInfo.DictName + "] thành công");
                         MessageUtils.DialogCloseAndParentReload(this);
                     }
                     else
                     {
                         base.ShowMsg("Thao tác thất bại");
                     }
                 }
             }
             if (base.Action.Equals(ActionType.Modify.ToString()))
             {
                 if (Dicts.Update(dictsInfo))
                 {
                     CacheUtils.Del("JsonLeeCMS_CacheForGetDicts");
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "Sửa đổi từ điển [" + dictsInfo.DictName + "] thành công");
                     MessageUtils.DialogCloseAndParentReload(this);
                 }
                 else
                 {
                     base.ShowMsg("Thao tác thất bại");
                 }
             }
         }
     }
 }
Ejemplo n.º 25
0
 protected void btnok_Click(object sender, System.EventArgs e)
 {
     if (base.Action.Equals(ActionType.Add.ToString()) && !base.IsAuthorizedOp(ActionType.Add.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else if (base.Action.Equals(ActionType.Modify.ToString()) && !base.IsAuthorizedOp(ActionType.Modify.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else
     {
         IPStrategyInfo iPStrategyInfo = new IPStrategyInfo();
         if (base.IsEdit)
         {
             iPStrategyInfo = SinGooCMS.BLL.IPStrategy.GetDataById(base.OpID);
         }
         string @string = WebUtils.GetString(this.TextBox1.Text);
         string string2 = WebUtils.GetString(this.TextBox2.Text);
         iPStrategyInfo.AutoTimeStamp = System.DateTime.Now;
         if (string.IsNullOrEmpty(@string) && string.IsNullOrEmpty(string2))
         {
             base.ShowMsg("IP地址不能为空");
         }
         else if (!string.IsNullOrEmpty(@string) && !ValidateUtils.IsIP(@string))
         {
             base.ShowMsg("起始IP不是有效的IP格式");
         }
         else if (!string.IsNullOrEmpty(string2) && !ValidateUtils.IsIP(string2))
         {
             base.ShowMsg("结束IP不是有效的IP格式");
         }
         else
         {
             if (!string.IsNullOrEmpty(@string) && !string.IsNullOrEmpty(string2))
             {
                 iPStrategyInfo.IPAddress = @string + "-" + string2;
             }
             else if (!string.IsNullOrEmpty(@string))
             {
                 iPStrategyInfo.IPAddress = @string;
             }
             else if (!string.IsNullOrEmpty(string2))
             {
                 iPStrategyInfo.IPAddress = string2;
             }
             iPStrategyInfo.Strategy = this.DropDownList3.SelectedValue;
             if (base.Action.Equals(ActionType.Add.ToString()))
             {
                 if (SinGooCMS.BLL.IPStrategy.Add(iPStrategyInfo) > 0)
                 {
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "添加IP策略[" + iPStrategyInfo.IPAddress + "] thành công");
                     MessageUtils.DialogCloseAndParentReload(this);
                 }
                 else
                 {
                     base.ShowMsg("添加IP策略失败");
                 }
             }
             if (base.Action.Equals(ActionType.Modify.ToString()))
             {
                 if (SinGooCMS.BLL.IPStrategy.Update(iPStrategyInfo))
                 {
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "修改IP策略[" + iPStrategyInfo.IPAddress + "] thành công");
                     MessageUtils.DialogCloseAndParentReload(this);
                 }
                 else
                 {
                     base.ShowMsg("修改IP策略失败");
                 }
             }
         }
     }
 }
Ejemplo n.º 26
0
 protected void btnok_Click(object sender, System.EventArgs e)
 {
     if (base.Action.Equals(ActionType.Add.ToString()) && !base.IsAuthorizedOp(ActionType.Add.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else if (base.Action.Equals(ActionType.Modify.ToString()) && !base.IsAuthorizedOp(ActionType.Modify.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else
     {
         ModuleInfo moduleInfo = new ModuleInfo();
         if (base.IsEdit)
         {
             moduleInfo = SinGooCMS.BLL.Module.GetDataById(base.OpID);
         }
         moduleInfo.CatalogID  = WebUtils.StringToInt(this.DropDownList5.SelectedValue, 0);
         moduleInfo.ModuleName = WebUtils.GetString(this.TextBox1.Text);
         moduleInfo.FilePath   = WebUtils.GetString(this.TextBox3.Text);
         moduleInfo.Remark     = WebUtils.GetString(this.TextBox4.Text);
         moduleInfo.IsDefault  = this.isdefault.Checked;
         if (!base.IsEdit)
         {
             moduleInfo.ModuleCode = WebUtils.GetString(this.TextBox2.Text);
             ModuleInfo moduleByCode = SinGooCMS.BLL.Module.GetModuleByCode(moduleInfo.ModuleCode);
             if (moduleByCode != null)
             {
                 base.ShowMsg("模块代码已存在");
                 return;
             }
         }
         if (string.IsNullOrEmpty(moduleInfo.ModuleName) || string.IsNullOrEmpty(moduleInfo.FilePath))
         {
             base.ShowMsg("模块名称和模块路径不能为空");
         }
         else
         {
             if (base.Action.Equals(ActionType.Add.ToString()))
             {
                 moduleInfo.AutoTimeStamp = System.DateTime.Now;
                 moduleInfo.IsSystem      = false;
                 moduleInfo.Sort          = SinGooCMS.BLL.Module.MaxSort + 1;
                 int num = SinGooCMS.BLL.Module.Add(moduleInfo);
                 if (num > 0)
                 {
                     if (moduleInfo.IsDefault)
                     {
                         PageBase.dbo.UpdateTable(string.Concat(new object[]
                         {
                             "update sys_Module set IsDefault=0 where CatalogID=",
                             moduleInfo.CatalogID,
                             " and AutoID<>",
                             num
                         }));
                     }
                     CacheUtils.Del("JsonLeeCMS_CacheForGetAccountMenuDT");
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "添加模块[" + moduleInfo.ModuleName + "] thành công");
                     MessageUtils.DialogCloseAndParentReload(this);
                 }
                 else
                 {
                     base.ShowMsg("增加模块失败");
                 }
             }
             if (base.Action.Equals(ActionType.Modify.ToString()))
             {
                 if (SinGooCMS.BLL.Module.Update(moduleInfo))
                 {
                     if (moduleInfo.IsDefault)
                     {
                         PageBase.dbo.UpdateTable(string.Concat(new object[]
                         {
                             "update sys_Module set IsDefault=0 where CatalogID=",
                             moduleInfo.CatalogID,
                             " and AutoID<>",
                             moduleInfo.AutoID
                         }));
                     }
                     CacheUtils.Del("JsonLeeCMS_CacheForGetAccountMenuDT");
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "修改模块[" + moduleInfo.ModuleName + "] thành công");
                     MessageUtils.DialogCloseAndParentReload(this);
                 }
                 else
                 {
                     base.ShowMsg("修改模块失败");
                 }
             }
         }
     }
 }
Ejemplo n.º 27
0
 protected void btnok_Click(object sender, System.EventArgs e)
 {
     if (base.Action.Equals(ActionType.Add.ToString()) && !base.IsAuthorizedOp(ActionType.Add.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else if (base.Action.Equals(ActionType.Modify.ToString()) && !base.IsAuthorizedOp(ActionType.Modify.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else
     {
         decimal  @decimal = WebUtils.GetDecimal(this.TextBox1.Text);
         UserInfo userById = SinGooCMS.BLL.User.GetUserById(WebUtils.GetQueryInt("UserID"));
         if (userById == null)
         {
             base.ShowMsg("会员不存在或者已删除!");
         }
         else if (@decimal.Equals(0m))
         {
             base.ShowMsg("请输入有效的数值!");
         }
         else if (base.Action.Equals(ActionType.Modify.ToString()))
         {
             string queryString = WebUtils.GetQueryString("Type");
             if (queryString != null)
             {
                 if (!(queryString == "Amount"))
                 {
                     if (queryString == "Integral")
                     {
                         SinGooCMS.BLL.AccountDetail.AddIntegral(userById, (@decimal > 0m) ? 1 : 0, (double)System.Math.Abs(@decimal), string.Concat(new string[]
                         {
                             "管理员[",
                             base.LoginAccount.AccountName,
                             "]对会员[",
                             userById.UserName,
                             "]账户进行积分充值"
                         }));
                     }
                 }
                 else
                 {
                     SinGooCMS.BLL.AccountDetail.AddAmount(userById, (@decimal > 0m) ? 1 : 0, (double)System.Math.Abs(@decimal), string.Concat(new string[]
                     {
                         "管理员[",
                         base.LoginAccount.AccountName,
                         "]对会员[",
                         userById.UserName,
                         "]账户进行金额充值"
                     }));
                 }
             }
             PageBase.log.AddEvent(base.LoginAccount.AccountName, string.Concat(new object[]
             {
                 "管理员[",
                 base.LoginAccount.AccountName,
                 "]对会员[",
                 userById.UserName,
                 "]账户进行",
                 WebUtils.GetQueryString("Type").Equals("Amount") ? "金额" : "积分",
                 "充值,充值数值为:",
                 @decimal
             }));
             MessageUtils.DialogCloseAndParentReload(this);
         }
     }
 }
Ejemplo n.º 28
0
        protected void btnok_Click(object sender, System.EventArgs e)
        {
            if (base.Action.Equals(ActionType.Add.ToString()) && !base.IsAuthorizedOp(ActionType.Add.ToString()))
            {
                base.ShowMsg("Không có thẩm quyền");
            }
            else if (base.Action.Equals(ActionType.Modify.ToString()) && !base.IsAuthorizedOp(ActionType.Modify.ToString()))
            {
                base.ShowMsg("Không có thẩm quyền");
            }
            else
            {
                UserGroupInfo userGroupInfo = new UserGroupInfo();
                if (base.IsEdit)
                {
                    userGroupInfo = SinGooCMS.BLL.UserGroup.GetCacheUserGroupById(base.OpID);
                }
                userGroupInfo.GroupName = WebUtils.GetString(this.TextBox1.Text);
                userGroupInfo.TableName = "cms_U_" + WebUtils.GetString(this.TextBox2.Text);
                userGroupInfo.GroupDesc = WebUtils.GetString(this.TextBox3.Text);
                userGroupInfo.Sort      = SinGooCMS.BLL.UserGroup.MaxSort + 1;
                userGroupInfo.Creator   = base.LoginAccount.AccountName;
                if (string.IsNullOrEmpty(userGroupInfo.GroupName) || string.IsNullOrEmpty(this.TextBox2.Text.Trim()))
                {
                    base.ShowMsg("用户组名称和数据表名不能为空");
                }
                else
                {
                    if (base.Action.Equals(ActionType.Add.ToString()))
                    {
                        userGroupInfo.AutoTimeStamp = System.DateTime.Now;
                        ModelAddState modelAddState  = SinGooCMS.BLL.UserGroup.Add(userGroupInfo);
                        ModelAddState modelAddState2 = modelAddState;
                        switch (modelAddState2)
                        {
                        case ModelAddState.Error:
                            base.ShowMsg("添加用户组失败");
                            break;

                        case ModelAddState.ModelNameExists:
                            base.ShowMsg("用户组名称已经存在");
                            break;

                        case ModelAddState.TableNameIsUsing:
                            base.ShowMsg("已经存在相同的自定义表名称");
                            break;

                        case ModelAddState.TableExists:
                            base.ShowMsg("自定义表已经存在");
                            break;

                        case ModelAddState.CreateTableError:
                            base.ShowMsg("创建自定义表失败");
                            break;

                        default:
                            if (modelAddState2 == ModelAddState.Success)
                            {
                                PageBase.log.AddEvent(base.LoginAccount.AccountName, "添加用户组[" + userGroupInfo.GroupName + "] thành công");
                                MessageUtils.DialogCloseAndParentReload(this);
                            }
                            break;
                        }
                    }
                    if (base.Action.Equals(ActionType.Modify.ToString()))
                    {
                        if (SinGooCMS.BLL.UserGroup.Update(userGroupInfo))
                        {
                            PageBase.log.AddEvent(base.LoginAccount.AccountName, "修改用户组[" + userGroupInfo.GroupName + "] thành công");
                            MessageUtils.DialogCloseAndParentReload(this);
                        }
                        else
                        {
                            base.ShowMsg("修改用户组失败");
                        }
                    }
                }
            }
        }
Ejemplo n.º 29
0
 protected void btnok_Click(object sender, System.EventArgs e)
 {
     if (base.Action.Equals(ActionType.Add.ToString()) && !base.IsAuthorizedOp(ActionType.Add.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else if (base.Action.Equals(ActionType.Modify.ToString()) && !base.IsAuthorizedOp(ActionType.Modify.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else
     {
         WxMenuInfo wxMenuInfo = new WxMenuInfo();
         if (base.IsEdit)
         {
             wxMenuInfo = WxMenu.GetDataById(base.OpID);
         }
         wxMenuInfo.ParentID = WebUtils.GetInt(this.parentmenu.SelectedValue);
         wxMenuInfo.Name     = WebUtils.GetString(this.menuname.Text);
         wxMenuInfo.Type     = this.menutype.SelectedValue;
         wxMenuInfo.Url      = WebUtils.GetString(this.TextBox4.Text);
         wxMenuInfo.EventKey = string.Empty;
         AutoRlyInfo autoRlyInfo = new AutoRlyInfo
         {
             RlyType     = "事件回复",
             MsgKey      = StringUtils.GetRandomNumber(),
             MsgText     = WebUtils.GetString(this.TextBox1.Text),
             MediaPath   = WebUtils.GetString(this.TextBox2.Text),
             Description = WebUtils.GetString(this.TextBox3.Text),
             LinkUrl     = WebUtils.GetString(this.TextBox4.Text)
         };
         if (string.IsNullOrEmpty(wxMenuInfo.Name))
         {
             base.ShowMsg("菜单名称不能为空");
         }
         else if (wxMenuInfo.ParentID == 0 && wxMenuInfo.Name.Length > 4)
         {
             base.ShowMsg("一级菜单文字长度不超过4个汉字");
         }
         else if (wxMenuInfo.ParentID > 0 && wxMenuInfo.Name.Length > 8)
         {
             base.ShowMsg("二级菜单文字长度不超过8个汉字");
         }
         else if (wxMenuInfo.Type == "click" && string.IsNullOrEmpty(autoRlyInfo.MsgText))
         {
             base.ShowMsg("图文推送文本不能为空");
         }
         else if (wxMenuInfo.Type == "click" && (autoRlyInfo.MsgText.Length > 600 || autoRlyInfo.Description.Length > 600))
         {
             base.ShowMsg("推送图文中的文本不能超过600汉字");
         }
         else if (wxMenuInfo.Type == "view" && string.IsNullOrEmpty(autoRlyInfo.LinkUrl))
         {
             base.ShowMsg("地址跳转的地址不能为空");
         }
         else
         {
             if (base.Action.Equals(ActionType.Add.ToString()))
             {
                 wxMenuInfo.Sort          = WxMenu.MaxSort + 1;
                 wxMenuInfo.AutoTimeStamp = System.DateTime.Now;
                 WxStatus wxStatus = WxMenu.Add(wxMenuInfo, autoRlyInfo);
                 if (wxStatus == WxStatus.增加成功)
                 {
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "添加微信菜单[" + wxMenuInfo.Name + "] thành công");
                     MessageUtils.DialogCloseAndParentReload(this);
                 }
                 else
                 {
                     base.ShowMsg(wxStatus.ToString());
                 }
             }
             if (base.Action.Equals(ActionType.Modify.ToString()))
             {
                 WxStatus wxStatus2 = WxMenu.Update(wxMenuInfo, autoRlyInfo);
                 if (wxStatus2 == WxStatus.修改成功)
                 {
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "修改微信菜单[" + wxMenuInfo.Name + "] thành công");
                     MessageUtils.DialogCloseAndParentReload(this);
                 }
                 else
                 {
                     base.ShowMsg(wxStatus2.ToString());
                 }
             }
         }
     }
 }