/// <summary> /// 更新一条数据 /// </summary> public void UpdateAdmin(BCW.Model.Chat model) { dal.UpdateAdmin(model); }
/// <summary> /// 更新抢币设置 /// </summary> public void UpdateCb(BCW.Model.Chat model) { dal.UpdateCb(model); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(BCW.Model.Chat model) { return(dal.Add(model)); }
/// <summary> /// 更新一条数据 /// </summary> public void UpdateBasic(BCW.Model.Chat model) { dal.UpdateBasic(model); }
private void EditSavePage() { int ManageId = new BCW.User.Manage().IsManageLogin(); if (ManageId != 1) { Utils.Error("此功能暂停开放", ""); } int id = int.Parse(Utils.GetRequest("id", "post", 2, @"^[1-9]\d*$", "红包群ID错误")); string ChatName = Utils.GetRequest("ChatName", "post", 2, @"^[^\^]{1,20}$", "聊天名称限20字内"); string ChatNotes = Utils.GetRequest("ChatNotes", "post", 3, @"^[^\^]{1,200}$", "红包群主题限200字内,可留空"); string ChatSZ = Utils.GetRequest("ChatSZ", "post", 3, @"^[0-9]{1,10}(?:\#[0-9]{1,10}){0,500}$", "室主ID多个请用#分隔,可留空"); string ChatJS = Utils.GetRequest("ChatJS", "post", 3, @"^[0-9]{1,10}(?:\#[0-9]{1,10}){0,500}$", "见习室主ID多个请用#分隔,可留空"); string ChatLG = Utils.GetRequest("ChatLG", "post", 3, @"^[0-9]{1,10}(?:\#[0-9]{1,10}){0,500}$", "临管ID多个请用#分隔,可留空"); string ChatFoot = Utils.GetRequest("ChatFoot", "post", 3, @"^[^\^]{1,2000}$", "红包群底部UBB限2000字内,可留空"); int ChatCent = int.Parse(Utils.GetRequest("ChatCent", "post", 2, @"^[0-9]\d*$", "红包群基金填写错误")); string CentPwd = Utils.GetRequest("CentPwd", "post", 3, @"^[A-Za-z0-9]{4,20}$", "基金密码限4-20位,必须由字母或数字组成"); int ChatTopLine = int.Parse(Utils.GetRequest("ChatTopLine", "post", 2, @"^[0-9]\d*$", "最高在线人数填写错误")); int ChatScore = int.Parse(Utils.GetRequest("ChatScore", "post", 2, @"^[0-9]\d*$", "红包群积分填写错误")); int UsID = int.Parse(Utils.GetRequest("UsID", "post", 2, @"^[0-9]\d*$", "创建ID填写错误")); int GroupId = int.Parse(Utils.GetRequest("GroupId", "post", 2, @"^[0-9]\d*$", "关联ID填写错误")); int Types = int.Parse(Utils.GetRequest("Types", "post", 2, @"^[0-3]$", "类型选择错误")); string ChatPwd = Utils.GetRequest("ChatPwd", "post", 3, @"^[A-Za-z0-9]{1,20}$", "红包群密码限1-20位,必须由字母或数字组成,可留空"); string ChatCT = Utils.GetRequest("ChatCT", "post", 3, @"^[A-Za-z\u4e00-\u9fa5]{1,15}$", "抢币词语10字内,不能使用特殊符号,可留空"); string ChatCbig = Utils.GetRequest("ChatCbig", "post", 3, @"^[1-9]\d*-[1-9]\d*$", "抢币整点随机值填写格式10-20,不开放抢币请留空"); string ChatCsmall = Utils.GetRequest("ChatCsmall", "post", 3, @"^[1-9]\d*-[1-9]\d*$", "抢币非整点随机值填写格式1-5,不开放抢币请留空"); int ChatCon = int.Parse(Utils.GetRequest("ChatCon", "post", 2, @"^[0-9]\d*$", "循环时间必须为数字,不开放抢币请填写0")); int Paixu = int.Parse(Utils.GetRequest("Paixu", "post", 2, @"^[0-9]\d*$", "排序必须为数字")); DateTime AddTime = Utils.ParseTime(Utils.GetRequest("AddTime", "post", 2, DT.RegexTime, "创建时间格式填写出错,正确格式如" + DT.FormatDate(DateTime.Now, 0) + "")); string sExTime = Utils.GetRequest("ExTime", "post", 1, "", ""); DateTime ExTime = DateTime.Parse("1990-01-01 00:00:00"); if (sExTime != "0") { ExTime = Utils.ParseTime(Utils.GetRequest("ExTime", "post", 2, DT.RegexTime, "过期时间填写错误,永不过期请填写0")); } //抢币随机值判断 if (ChatCbig != "" && ChatCsmall != "") { string[] Cbig = ChatCbig.Split("-".ToCharArray()); if (Convert.ToInt32(Cbig[0]) >= Convert.ToInt32(Cbig[1])) { Utils.Error("抢币整点随机值填写格式10-20,不开放抢币请留空", ""); } string[] Csmall = ChatCsmall.Split("-".ToCharArray()); if (Convert.ToInt32(Csmall[0]) >= Convert.ToInt32(Csmall[1])) { Utils.Error("抢币非整点随机值填写格式1-5,不开放抢币请留空", ""); } } BCW.Model.Chat m = new BCW.BLL.Chat().GetChat(id); if (m == null) { Utils.Error("不存在的红包群", ""); } if (UsID > 0) { if (!new BCW.BLL.User().Exists(UsID)) { Utils.Error("不存在的创建ID", ""); } } if (Types == 3 && sExTime == "0") { Utils.Error("选择自建类型时,过期时间不能填写0", ""); } string getChatPwd = new BCW.BLL.Chat().GetChatPwd(id); if (getChatPwd != ChatPwd) { new BCW.BLL.Chat().UpdatePwdID(id, "");//清空进入的ID标识 } //抢币标识 string sCTemp = string.Empty; if (ChatCT != m.ChatCT) { string CText = Utils.ConvertSeparated(ChatCT, 1, "#"); string[] CTemp = CText.Split("#".ToCharArray()); for (int i = 0; i < CTemp.Length; i++) { sCTemp += "#0"; } sCTemp = Utils.Mid(sCTemp, 1, sCTemp.Length); } else { sCTemp = m.ChatCId; } BCW.Model.Chat model = new BCW.Model.Chat(); model.ID = id; model.ChatName = ChatName; model.ChatNotes = ChatNotes; model.ChatSZ = ChatSZ; model.ChatJS = ChatJS; model.ChatLG = ChatLG; model.ChatFoot = ChatFoot; model.ChatCent = ChatCent; model.CentPwd = CentPwd; model.ChatTopLine = ChatTopLine; model.ChatScore = ChatScore; model.UsID = UsID; model.GroupId = GroupId; model.Types = Types; model.ChatPwd = ChatPwd; model.ChatCT = ChatCT; model.ChatCbig = ChatCbig; model.ChatCsmall = ChatCsmall; model.ChatCId = sCTemp;//初始化抢币 model.ChatCon = ChatCon; model.Paixu = Paixu; model.AddTime = AddTime; model.ExTime = ExTime; new BCW.BLL.Chat().Update(model); Utils.Success("编辑红包群", "编辑红包群成功..", Utils.getUrl("chat.aspx?act=edit&id=" + id + "&backurl=" + Utils.getPage(0) + ""), "1"); }