public void DelDls(string id, string zdlid) { if (!MyFunc.CheckUserLogin(this.Session.Contents["adminusername"].ToString().Trim(), this.Session.Contents["adminuserpass"].ToString().Trim(), this.Session.Contents["adminclassid"].ToString().Trim(), 1)) { MyFunc.goToLoginPage(); } else { DataBase base2 = new DataBase(MyFunc.GetConnStr(2)); int num = (int)base2.ExecuteScalar("SELECT COUNT(*) FROM member WHERE dlsid=" + id); if (num > 0) { base2.Dispose(); MyFunc.showmsg("该代理商下还有会员,不能删除该代理商"); base.Response.End(); } else if (base2.ExecuteNonQuery("DELETE FROM agence WHERE userid=" + id + " AND classid=4") > 0) { base2.ExecuteNonQuery("UPDATE agence SET memcount=memcount-1 WHERE userid=" + zdlid); base2.Dispose(); MyFunc.JumpPage("删除该代理商成功", "dlslist.aspx"); base.Response.End(); } else { base2.Dispose(); MyFunc.showmsg("删除代理商失败"); base.Response.End(); } } }
public void DelUser(string id, string dlsid) { if (!MyFunc.CheckUserLogin(this.Session.Contents["adminusername"].ToString().Trim(), this.Session.Contents["adminuserpass"].ToString().Trim(), "1", 1)) { MyFunc.goToLoginPage(); } else { DataBase base2 = new DataBase(MyFunc.GetConnStr(2)); int num = (int) base2.ExecuteScalar("SELECT xzcount FROM member WHERE userid=" + id); if (num > 0) { base2.Dispose(); MyFunc.showmsg("该会员有注单,不能删除该会员"); base.Response.End(); } else { string text = base2.ExecuteScalar("SELECT dlsid FROM member WHERE userid=" + id).ToString(); if (base2.ExecuteNonQuery("DELETE FROM member WHERE userid=" + id) > 0) { base2.ExecuteNonQuery("UPDATE agence SET memcount=memcount-1 WHERE dlsid=" + text); base2.Dispose(); MyFunc.JumpPage("删除该会员成功", "dlslist.aspx"); base.Response.End(); } else { base2.Dispose(); MyFunc.showmsg("删除会员失败"); base.Response.End(); } } } }
private void DelGd(string id) { if (!MyFunc.CheckUserLogin(this.Session.Contents["adminusername"].ToString().Trim(), this.Session.Contents["adminuserpass"].ToString().Trim(), this.Session.Contents["adminclassid"].ToString().Trim(), 1)) { MyFunc.goToLoginPage(); } else { DataBase base2 = new DataBase(MyFunc.GetConnStr(2)); if (((int)base2.ExecuteScalar("SELECT COUNT(*) FROM agence WHERE gdid=" + id)) > 0) { base2.Dispose(); MyFunc.showmsg("该股东下还有总代理,代理商或会员,不能删除股东"); base.Response.End(); } else if (base2.ExecuteNonQuery("DELETE FROM agence WHERE userid=" + id + " AND classid=2") > 0) { base2.Dispose(); MyFunc.JumpPage("删除股东成功!", "gdlist.aspx"); base.Response.End(); } else { base2.Dispose(); MyFunc.showmsg("删除股东失败"); base.Response.End(); } } }
public void DelZdl(string id) { if (!MyFunc.CheckUserLogin(this.Session.Contents["adminusername"].ToString().Trim(), this.Session.Contents["adminuserpass"].ToString().Trim(), this.Session.Contents["adminclassid"].ToString().Trim(), 1)) { MyFunc.goToLoginPage(); } else { DataBase base2 = new DataBase(MyFunc.GetConnStr(2)); int num = (int)base2.ExecuteScalar("SELECT COUNT(*) FROM agence WHERE zdlid=" + id + " AND classid=4 AND gdid=" + this.Session.Contents["adminuserid"].ToString().Trim()); if (num > 0) { base2.Dispose(); MyFunc.showmsg("该总代理下还有代理商个数不为0,不能删除"); base.Response.End(); } else if (base2.ExecuteNonQuery("DELETE FROM agence WHERE userid=" + id + " AND classid=3 AND gdid=" + this.Session.Contents["adminuserid"].ToString().Trim()) > 0) { base2.ExecuteNonQuery("UPDATE agence SET memcount=memcount-1 WHERE userid=" + id + " AND gdid=" + this.Session.Contents["adminuserid"].ToString().Trim()); base2.Dispose(); MyFunc.JumpPage("删除该总代理成功", "zdllist.aspx"); base.Response.End(); } else { base2.Dispose(); MyFunc.showmsg("删除总代理失败"); base.Response.End(); } } }
private void submitbutton_Click(object sender, EventArgs e) { string sql = ""; DataBase base2 = new DataBase(MyFunc.GetConnStr(2)); SqlDataReader reader = base2.ExecuteReader("SELECT vindID,isFront,frontContent,isBehind,befindContent FROM vindicate"); if (reader.Read()) { sql = "UPDATE vindicate SET frontContent = '" + this.frontContent.Text.Trim() + "',befindContent = '" + this.befindContent.Text.Trim() + "',isFront = " + this.isFront.SelectedValue.ToString() + ",isBehind = " + this.isBehind.SelectedValue.ToString(); } else { sql = "INSERT INTO vindicate (isFront,frontContent,isBehind,befindContent) VALUES (" + this.isFront.SelectedValue.ToString() + ",'" + this.frontContent.Text.Trim() + "'," + this.isBehind.SelectedValue.ToString() + ",'" + this.befindContent.Text.Trim() + "')"; } if (this.isFront.SelectedValue.Trim() == "1") { MyTeam.OnlineList.OnlineList.TickClassidDown(",,20,"); } if (this.isBehind.SelectedValue.Trim() == "1") { MyTeam.OnlineList.OnlineList.TickClassidDown(",,0,2,3,4,22,33,44,"); } reader.Close(); base2.ExecuteNonQuery(sql); base2.CloseConnect(); base2.Dispose(); MyFunc.JumpPage("设定成功!", "chglists.aspx"); }
private void dealsaveadd() { string sql = "INSERT INTO affiche (le,content,updatetime,tupdatetime,kaisai,qishu,isclose) VALUES ('" + this.le.SelectedValue + "', '" + this.content.Text.Trim().Replace("'", " ") + "', '" + DateTime.Now.ToString() + "', '" + this.TUpdateTime.Text.Trim().ToString() + "', '" + this.kaisai.Text.Trim().Replace("'", " ") + "','" + this.qishu.Text.Trim().Replace("'", " ") + "','" + this.kaipan.SelectedValue.ToString() + "')"; DataBase base2 = new DataBase(MyFunc.GetConnStr(2)); base2.ExecuteNonQuery(sql); base2.CloseConnect(); base2.Dispose(); MyFunc.JumpPage("新增公告成功", "mgrconfiglist.aspx"); }
private void CancelOrderList(string list) { DataBase base2 = new DataBase(MyFunc.GetConnStr(2)); base2.ExecuteNonQuery("UPDATE ball_order SET iscancel=1,isjs=1,win=0,lose=0,mgd=0,mzdl=0,mdls=0,truewin=0 WHERE orderid in(" + list + "0)"); base2.Dispose(); MyFunc.JumpPage("取消注单成功", "searchOrder.aspx"); base.Response.End(); }
private void dealsavechg() { string sql = "UPDATE affiche SET le = '" + this.le.SelectedValue + "',content = '" + this.content.Text.Trim().Replace("'", " ") + "',updatetime = '" + DateTime.Now.ToString() + "',tupdatetime = '" + this.TUpdateTime.Text.Trim().ToString() + "',kaisai= '" + this.kaisai.Text.Trim().Replace("'", " ") + "',qishu= '" + this.qishu.Text.Trim().Replace("'", " ") + "',isclose='" + this.kaipan.SelectedValue.ToString() + "' WHERE id = '" + this.configid.Value + "'"; DataBase base2 = new DataBase(MyFunc.GetConnStr(2)); base2.ExecuteNonQuery(sql); base2.CloseConnect(); base2.Dispose(); MyFunc.JumpPage("修改公告成功", "mgrconfiglist.aspx"); }
private void SaveOrder() { string text = this.TextBoxOrderid.Text.Trim(); string text2 = this.TextBoxContent.Text.Trim(); string text3 = this.TextBoxTzMoney.Text.Trim(); string text4 = this.TextBoxTzTime.Text.Trim(); string text5 = this.TextBoxDlsMoney.Text.Trim(); string text6 = this.TextBoxZdlMoney.Text.Trim(); string text7 = this.TextBoxGdMoney.Text.Trim(); string text8 = this.TextBoxWin.Text.Trim(); string text9 = this.TextBoxLose.Text.Trim(); string selectedValue = this.DropDownListJs.SelectedValue; string text11 = this.DropdownlistIsCancel.SelectedValue; string s = this.TextBoxTzTeam.Text.Trim(); string text13 = this.TextBoxDS.Text.Trim(); string text14 = (this.TextBoxTzTeam.Text.Trim() == "H") ? "1" : "2"; string text15 = this.TextBoxPl.Text.Trim(); DataBase base2 = new DataBase(MyFunc.GetConnStr(2)); string sql = ""; switch (this.TextBoxTzType.Text.Trim()) { case "5": case "20": case "24": case "27": case "28": sql = "UPDATE ball_order SET tzteam='" + s + "',curpl='" + text15 + "',tzmoney=" + text3 + ",updatetime='" + text4 + "',isjs=" + selectedValue + ",ds=" + text14 + ",iscancel=" + text11 + ",content='" + text2 + "',mdls=" + text5 + ",mzdl=" + text6 + ",mgd=" + text7 + ",win=" + text8 + ",lose=" + text9 + " WHERE orderid=" + text; break; case "8": { string[] textArray2 = new string[] { "UPDATE ball_order SET tzteam='", (int.Parse(s) + 0x22).ToString(), "',curpl='", text15, "',tzmoney=", text3, ",updatetime='", text4, "',isjs=", selectedValue, ",ds=", text14, ",iscancel=", text11, ",content='", text2, "',mdls=", text5, ",mzdl=", text6, ",mgd=", text7, ",win=", text8, ",lose=", text9, " WHERE orderid=", text }; sql = string.Concat(textArray2); break; } default: sql = "UPDATE ball_order SET tzteam='" + s + "',curpl='" + text15 + "',tzmoney=" + text3 + ",updatetime='" + text4 + "',isjs=" + selectedValue + ",dxc=" + text13 + ",iscancel=" + text11 + ",content='" + text2 + "',mdls=" + text5 + ",mzdl=" + text6 + ",mgd=" + text7 + ",win=" + text8 + ",lose=" + text9 + " WHERE orderid=" + text; break; } if (base2.ExecuteNonQuery(sql) > 0) { base2.Dispose(); MyFunc.JumpPage("修改注单成功", "OrderList.aspx?action=kygl" + HttpUtility.UrlDecode(base.Request.QueryString["url"].ToString().Trim())); } else { base2.Dispose(); MyFunc.showmsg("修改注单出错"); base.Response.End(); } }
private void ButtonOk_Click(object sender, EventArgs e) { if (!MyFunc.CheckUserLogin(0) || ((this.Session.Contents["classid"].ToString().Trim() != "1") && (this.Session.Contents["classid"].ToString().Trim() != "2"))) { MyFunc.goToLoginPage(); base.Response.End(); } else { string text7 = ""; string text = this.TextBoxUserid.Text.Trim(); string text2 = this.TextBoxUserName.Text.Trim(); string text3 = this.TextBoxUserPass1.Text.Trim(); string text4 = this.TextBoxUserPass2.Text.Trim(); string text5 = this.TextBoxTrueName.Text.Trim(); string text6 = this.DropDownListIsuseable.SelectedValue.Trim(); if (text2 == "") { MyFunc.showmsg("请输选择要修改的比分员"); base.Response.End(); } else { if ((text3 != "") || (text4 != "")) { if (text3 != text4) { MyFunc.showmsg("输入的密码不同"); base.Response.End(); return; } text7 = ",userpass='******'"; } DataBase base2 = new DataBase(MyFunc.GetConnStr(2)); if (int.Parse(base2.ExecuteScalar("SELECT COUNT(1) FROM pluser WHERE userid=" + text).ToString()) == 0) { base2.Dispose(); MyFunc.showmsg("没有该比分员"); base.Response.End(); } else if (base2.ExecuteNonQuery("UPDATE pluser SET truename='" + text5 + "'" + text7 + ",isuseable=" + text6 + " WHERE userid=" + text) > 0) { base2.Dispose(); MyFunc.JumpPage("修改比分员成功", "bfuser.aspx"); base.Response.End(); } else { base2.Dispose(); MyFunc.showmsg("修改比分员失败"); base.Response.End(); } } } }
private void ButtonOk_Click(object sender, EventArgs e) { if (!MyFunc.CheckUserLogin(0) || ((this.Session.Contents["classid"].ToString().Trim() != "1") && (this.Session.Contents["classid"].ToString().Trim() != "2"))) { MyFunc.goToLoginPage(); base.Response.End(); } else { string text = this.TextBoxUserName.Text.Trim(); string text2 = this.TextBoxUserPass1.Text.Trim(); string text3 = this.TextBoxUserPass2.Text.Trim(); string text4 = this.TextBoxTrueName.Text.Trim(); string text5 = this.DropDownListIsuseable.SelectedValue.Trim(); if (((text == "") || (text2 == "")) || (text3 == "")) { MyFunc.showmsg("请输入比分员帐号和密码"); base.Response.End(); } else if (text2 != text3) { MyFunc.showmsg("输入的密码不同"); base.Response.End(); } else { DataBase base2 = new DataBase(MyFunc.GetConnStr(2)); if (int.Parse(base2.ExecuteScalar("SELECT COUNT(1) FROM pluser WHERE username='******'").ToString()) != 0) { base2.Dispose(); MyFunc.showmsg("已存在该用户帐号"); base.Response.End(); } else if (base2.ExecuteNonQuery("INSERT INTO pluser(username,userpass,truename,isuseable,classid) VALUES('" + text + "','" + text2 + "','" + text4 + "'," + text5 + ",3)") > 0) { base2.Dispose(); MyFunc.JumpPage("添加比分员成功", "bfuser.aspx"); base.Response.End(); } else { base2.Dispose(); MyFunc.showmsg("添加比分员失败"); base.Response.End(); } } } }
private void CancelOrderList(string list) { if (!MyFunc.CheckUserLogin(this.Session.Contents["adminusername"].ToString().Trim(), this.Session.Contents["adminuserpass"].ToString().Trim(), "1", 1)) { MyFunc.goToLoginPage(); base.Response.End(); } else { DataBase base2 = new DataBase(MyFunc.GetConnStr(2)); base2.ExecuteNonQuery("UPDATE ball_order SET iscancel=1,isjs=1,win=0,lose=0,mgd=0,mzdl=0,mdls=0,truewin=0 WHERE orderid in(" + list + "0)"); base2.Dispose(); MyFunc.JumpPage("取消注单成功", "searchOrder.aspx"); base.Response.End(); } }
private void ButtonPost_Click(object sender, EventArgs e) { string text = this.TextBoxOldPass.Text.Trim(); string text2 = this.TextBoxNewPass1.Text.Trim(); string text3 = this.TextBoxNewPass2.Text.Trim(); if (((text == "") || (text2 == "")) || (text3 == "")) { MyFunc.showmsg("请输入旧密码和要修改的新密码"); base.Response.End(); } else if (text2 != text3) { MyFunc.showmsg("输入的新密码不相同"); base.Response.End(); } else if (!MyFunc.CheckUserLogin(this.Session.Contents["username"].ToString().Trim(), this.Session.Contents["userpass"].ToString().Trim(), "20", 0)) { MyFunc.showmsg("输入的密码错误!"); base.Response.End(); } else { DataBase base2 = new DataBase(MyFunc.GetConnStr(2)); if (base2.ExecuteNonQuery("UPDATE member SET userpass='******' WHERE userid=" + this.Session.Contents["userid"].ToString().Trim()) > 0) { this.Session.Contents["userpass"] = text2; base2.Dispose(); MyFunc.JumpPage("修改密码成功", "PassWord.aspx"); base.Response.End(); } else { base2.Dispose(); MyFunc.showmsg("修改密码失败"); base.Response.End(); } } }
private void ButtonSave_Click(object sender, EventArgs e) { if (!MyFunc.CheckUserLogin(this.Session.Contents["adminusername"].ToString().Trim(), this.Session.Contents["adminuserpass"].ToString().Trim(), this.Session.Contents["adminclassid"].ToString().Trim(), 1)) { MyFunc.goToLoginPage(); base.Response.End(); } else { string text = ""; string text2 = this.TextBoxUserID.Text.Trim(); string text3 = this.TextBoxNewpass1.Text.Trim(); string text4 = this.TextBoxNewpass2.Text.Trim(); string input = this.TextBoxTrueName.Text.Trim(); string text8 = "1"; string text6 = this.TextBoxTel.Text.Trim().Replace("'", "").Replace("%", ""); string s = this.TextBoxUseMoney.Text.Trim(); string text10 = this.Session.Contents["adminuserid"].ToString().Trim(); string text11 = this.Session.Contents["adminusername"].ToString().Trim(); string text9 = this.TextBoxDlsid.Text.Trim(); string text12 = this.DropDownListRate.SelectedItem.Text; string selectedValue = this.DropDownListRate.SelectedValue; string text14 = this.DropDownListPlType.SelectedValue; string text15 = this.RadioButton1.Checked ? "信用" : "现金"; string text16 = this.DropDownListABC.SelectedValue; if ((((text2 == "") || (input == "")) || ((text8 == "") || (s == ""))) || ((((text10 == "") || (text11 == "")) || ((text14 == "") || (text15 == ""))) || (((text16 == "") || (text12 == "")) || (selectedValue == "")))) { MyFunc.showmsg("请输入会员帐号,名称,信用额度"); base.Response.End(); } else { Regex regex = new Regex("[^'*%=\"<>/|]"); Regex regex2 = new Regex("[^'*%=\"<>/|]"); if (!regex2.IsMatch(input)) { MyFunc.showmsg("会员名称里含有非法字符"); base.Response.End(); } else { if ((text3 != "") && (text4 != "")) { if (text3 != text4) { MyFunc.showmsg("输入的密码不相同"); return; } text = ",userpass='******'"; } if (input.Length > 8) { MyFunc.showmsg("会员名称不能大于8个字符(4个汉字)"); base.Response.End(); } else { try { int num = (int)(int.Parse(s) * float.Parse(selectedValue)); if (num >= 0) { DataBase base2 = new DataBase(MyFunc.GetConnStr(2)); int num2 = int.Parse(base2.ExecuteScalar("SELECT usemoney FROM agence WHERE userid=" + text9).ToString()); int num3 = int.Parse(base2.ExecuteScalar("SELECT ISNULL(SUM(usemoney),0) FROM member WHERE dlsid=" + text9 + " AND userid<>" + text2).ToString()); int num4 = num2 - num3; if (int.Parse(s) > num4) { base2.Dispose(); MyFunc.showmsg("信用度额不能大于总代理可用信用度额"); base.Response.End(); } else { double num5 = double.Parse(base2.ExecuteScalar("SELECT ISNULL(usemoney-curmoney,0) FROM member WHERE userid=" + text2).ToString()); text = text + ",curmoney=" + ((double.Parse(s) - num5)).ToString(); int num6 = (int)base2.ExecuteScalar("SELECT COUNT(*) FROM member WHERE userid=" + text2); if (num6 < 1) { base2.Dispose(); MyFunc.showmsg("没有该会员帐号!"); base.Response.End(); } else { if (text16.ToString().Trim().ToUpper() != base2.ExecuteScalar("select abc from member where userid ='" + text2 + "'").ToString().Trim().ToUpper()) { base2.ExecuteNonQuery("DELETE FROM userhs where userid = '" + text2 + "'"); base2.ExecuteNonQuery("insert userhs select '" + text2.ToString().Trim() + "',w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12,w13,w14,w15,l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,l11,l12,l13,l14,l15,maxC1,maxC2,maxC3,maxC4,maxC5,maxC6,maxC7,maxC8,maxC9,maxC10,maxC11,maxC12,maxC13,maxC14,maxC15,maxZ1,maxZ2,maxZ3,maxZ4,maxZ5,maxZ6,maxZ7,maxZ8,maxZ9,maxZ10,maxZ11,maxZ12,maxZ13,maxZ14,maxZ15,W28,L28,maxC28,maxZ28,maxZ18,maxZ19,maxZ20,maxZ21,maxZ22,maxZ23,maxZ24,maxC18,maxC19,maxC20,maxC21,maxC22,maxC23,maxC24,w18,w19,w20,w21,w22,w23,w24,l18,l19,l20,l21,l22,l23,l24 from hs join agence on hs.userid = agence.userid where hs.userid='" + text9 + "' and hs.type='" + text16 + "'"); } if (base2.ExecuteNonQuery("UPDATE member SET truename='" + input + "'" + text + ",tel='" + text6 + "',usemoney=" + s + ",moneysort='" + text12 + "',moneyrate=" + selectedValue + ",pltype='" + text14 + "',usertype='" + text15 + "',abc='" + text16 + "' WHERE userid=" + text2 + " AND gdid=" + text10) > 0) { base2.Dispose(); MyFunc.JumpPage("修改会员成功!", "userlist.aspx"); } else { base2.Dispose(); MyFunc.showmsg("修改会员失败!"); } } } } else { MyFunc.showmsg("请输入正确的信用额度"); base.Response.End(); } } catch { MyFunc.showmsg("请输入正确的信用额度"); base.Response.End(); } } } } } }
private void ButtonSave_Click(object sender, EventArgs e) { string input; string s; string text6; string text7; string text8; string text9; string text11; string text12; string text13; string text14; string text15; string text16; DataBase base2; int num7; if (!MyFunc.CheckUserLogin(this.Session.Contents["adminusername"].ToString().Trim(), this.Session.Contents["adminuserpass"].ToString().Trim(), "1", 1)) { MyFunc.goToLoginPage(); base.Response.End(); } else { text11 = ""; text12 = ""; text13 = ""; text14 = ""; text15 = ""; text7 = this.TextBoxDlsID.Text.Trim(); string text = this.TextBoxUserName.Text.Trim(); string text2 = this.TextBoxNewpass1.Text.Trim(); string text3 = this.TextBoxNewpass2.Text.Trim(); input = this.TextBoxTrueName.Text.Trim(); s = this.TextBoxUseMoney.Text.Trim(); text6 = this.DropDownListIsUseAble.SelectedValue.Trim(); text9 = this.TextBoxZdlID.Text.Trim(); string text10 = this.TextBoxGdId.Text.Trim(); text8 = this.TextBoxTel.Text.Trim(); text14 = this.DropDownListZdlBl.SelectedValue.Trim(); text15 = this.DropDownListDlsBl.SelectedValue.Trim(); text16 = this.TextBoxMaxMem.Text.Trim(); if ((((text == "") || (input == "")) || ((text6 == "") || (s == ""))) || (((text14 == "") || (text15 == "")) || (text16 == ""))) { MyFunc.showmsg("请输入代理商帐号,密码,名称,即时注单状态,信用额度"); base.Response.End(); } else { Regex regex = new Regex("[^'*%=\"<>/|]"); Regex regex2 = new Regex("[^'*%=\"<>/|]"); if (!regex.IsMatch(text) || !regex2.IsMatch(input)) { MyFunc.showmsg("代理商帐号或名称里含有非法字符"); base.Response.End(); } else if (input.Length > 8) { MyFunc.showmsg("代理商名称不能大于8个字符(4个汉字)"); base.Response.End(); } else { if ((text2 != "") && (text3 != "")) { if (text2 != text3) { MyFunc.showmsg("输入的密码不相同"); return; } text11 = ",userpass='******'"; } try { if (int.Parse(s) >= 0) { try { int.Parse(text16); } catch { MyFunc.showmsg("请输入正确的最大会员数"); base.Response.End(); return; } base2 = new DataBase(MyFunc.GetConnStr(2)); text12 = base2.ExecuteScalar("SELECT gdbl FROM agence WHERE userid=" + text10).ToString(); text13 = base2.ExecuteScalar("SELECT gsbl FROM agence WHERE userid=" + text10).ToString(); if ((int.Parse(text14) + int.Parse(text15)) > (100 - int.Parse(text12))) { MyFunc.showmsg("总代理,代理商的比例相加不能大于" + ((100 - int.Parse(text12))).ToString()); base.Response.End(); return; } text12 = (((100 - int.Parse(text15)) - int.Parse(text14)) - int.Parse(text13)).ToString(); int num2 = (int)base2.ExecuteScalar("SELECT COUNT(*) FROM agence WHERE userid=" + text7); if (num2 < 1) { base2.Dispose(); MyFunc.showmsg("没有该代理商"); return; } int num3 = int.Parse(base2.ExecuteScalar("SELECT maxmem FROM agence WHERE userid=" + text9).ToString()); if (num3 > 0) { int num4 = int.Parse(base2.ExecuteScalar("SELECT COUNT(1) FROM member WHERE dlsid=" + text7).ToString()); if (num4 > int.Parse(text16)) { base2.Dispose(); MyFunc.showmsg("该代理商已有 " + num4.ToString() + " 个会员,设置的最大会员数最小为 " + num4.ToString()); base.Response.End(); } else { num4 = int.Parse(base2.ExecuteScalar("SELECT ISNULL(SUM(maxmem),0) FROM agence WHERE zdlid=" + text9 + " AND classid=4 AND userid<>" + text7).ToString()); if ((num4 + int.Parse(text16)) <= num3) { goto Label_05B5; } base2.Dispose(); object[] objArray = new object[] { "该代理商的总代理最大会员数为 ", num3, " ,现在代理商最大会员数最大可设为 ", (num3 - num4).ToString() }; MyFunc.showmsg(string.Concat(objArray)); base.Response.End(); } return; } int num5 = int.Parse(base2.ExecuteScalar("SELECT maxmem FROM agence WHERE userid=" + text10).ToString()); if (num5 > 0) { int num6 = int.Parse(base2.ExecuteScalar("SELECT ISNULL(SUM(maxmem),0) FROM agence WHERE gdid=" + text10 + " AND classid=4 AND userid<>" + text7).ToString()); if ((num6 + int.Parse(text16)) > num5) { base2.Dispose(); object[] objArray2 = new object[] { "该代理商的股东的最大会员数为 ", num5, " ,现在代理商最大会员数最大可设为 ", (num5 - num6).ToString() }; MyFunc.showmsg(string.Concat(objArray2)); base.Response.End(); return; } } goto Label_05B5; } MyFunc.showmsg("请输入正确的信用额度"); base.Response.End(); } catch { MyFunc.showmsg("请输入正确的信用额度"); base.Response.End(); } } } } return; Label_05B5: num7 = int.Parse(base2.ExecuteScalar("SELECT ISNULL(usemoney,0) FROM agence WHERE userid=" + text9).ToString()); int num8 = int.Parse(base2.ExecuteScalar("SELECT ISNULL(SUM(usemoney),0) FROM agence WHERE zdlid=" + text9).ToString()); int num9 = int.Parse(base2.ExecuteScalar("SELECT ISNULL(usemoney,0) FROM agence WHERE userid=" + text7).ToString()); if (int.Parse(s) > ((num7 - num8) + num9)) { base2.Dispose(); MyFunc.showmsg("代理商信用额度不能大于总代理可用信用额度"); base.Response.End(); } else if (base2.ExecuteNonQuery("UPDATE agence SET truename='" + input + "'" + text11 + ",usemoney=" + s + ",isuseable=" + text6 + ",tel='" + text8 + "',bl=" + text15 + ",gsbl=" + text13 + ",gdbl=" + text12 + ",zdlbl=" + text14 + ",maxmem=" + text16 + " WHERE userid=" + text7) > 0) { base2.Dispose(); MyFunc.JumpPage("修改代理商成功!", "dlslist.aspx"); } else { base2.Dispose(); MyFunc.showmsg("修改代理商失败!"); } }
private void ButtonSave_Click(object sender, EventArgs e) { string text9 = ""; string text8 = this.TextBoxGdID.Text.Trim(); string input = this.TextBoxUserName.Text.Trim(); string text2 = this.TextBoxNewpass1.Text.Trim(); string text3 = this.TextBoxNewpass2.Text.Trim(); string text4 = this.TextBoxTrueName.Text.Trim(); string s = this.DropDownListBL.SelectedValue.Trim(); string text6 = MyFunc.DefaultValue(base.Request.Form["DropDownListGsGd"], ""); string text7 = this.TextBoxUseMoney.Text.Trim(); string text10 = this.TextBoxMaxMem.Text.Trim(); if ((((text8 == "") || (input == "")) || ((text4 == "") || (s == ""))) || ((text10 == "") || (text6 == ""))) { MyFunc.showmsg("请输入股东帐号,名称,成数和最大会员数"); base.Response.End(); } else { Regex regex = new Regex("[^'*%=\"<>/|]"); Regex regex2 = new Regex("[^'*%=\"<>/|]"); if (!regex.IsMatch(input) || !regex2.IsMatch(text4)) { MyFunc.showmsg("股东帐号或股东名里含有非法字符"); base.Response.End(); } else { if ((text2 != "") && (text3 != "")) { if (text2 != text3) { MyFunc.showmsg("输入的密码不相同"); return; } text9 = ",userpass='******'"; } if (text4.Length > 8) { MyFunc.showmsg("股东名称不能大于8个字符(4个汉字)"); base.Response.End(); } else { try { int num = int.Parse(s); if (((num % 10) == 0) && ((num >= 0) || (num <= 100))) { try { int num2 = int.Parse(text6); if ((num2 >= int.Parse(s)) || (num2 <= 100)) { try { if (int.Parse(text7) >= 0) { try { int.Parse(text10); } catch { MyFunc.showmsg("请输入正确的最大会员数"); base.Response.End(); return; } DataBase base2 = new DataBase(MyFunc.GetConnStr(2)); int num9 = 100 - int.Parse(text6); if (int.Parse(base2.ExecuteScalar("SELECT COUNT(1) FROM agence WHERE gdid=" + text8 + " AND bl+zdlbl>" + num9.ToString()).ToString()) > 0) { MyFunc.showmsg("不能修改股东成数,该股东下有总代理和代理商的成数和大于" + ((100 - int.Parse(s))).ToString()); base.Response.End(); } else if (int.Parse(base2.ExecuteScalar("SELECT COUNT(*) FROM agence WHERE userid=" + text8).ToString()) < 1) { base2.Dispose(); MyFunc.showmsg("没有该股东"); } else { int num4 = int.Parse(base2.ExecuteScalar("SELECT ISNULL(SUM(usemoney),0) FROM agence WHERE gdid=" + this.TextBoxGdID.Text + " AND isuseable=1 AND classid = 3").ToString()); int num5 = int.Parse(base2.ExecuteScalar("SELECT ISNULL(SUM(usemoney),0) FROM agence WHERE gdid=" + this.TextBoxGdID.Text + " AND isuseable=0 AND classid = 3").ToString()); int num6 = (int.Parse(this.TextBoxUseMoney.Text) - num4) - num5; if (num6 < 0) { base2.Dispose(); MyFunc.showmsg("信用额度一定要大于已用额度:" + ((num4 + num5)).ToString()); base.Response.End(); } else { int num7 = int.Parse(base2.ExecuteScalar("SELECT COUNT(1) FROM member WHERE gdid=" + text8).ToString()); if ((num7 > int.Parse(text10)) && (int.Parse(text10) != 0)) { base2.Dispose(); MyFunc.showmsg("该股东已有 " + num7.ToString() + " 个会员,设置的最大会员数最小为" + num7.ToString()); base.Response.End(); } else if (base2.ExecuteNonQuery("UPDATE agence SET truename='" + text4 + "'" + text9 + ",gsbl=" + s + ",maxmem=" + text10 + ",usemoney=" + text7 + " WHERE userid=" + text8) > 0) { int num8 = int.Parse(text6) - int.Parse(s); base2.ExecuteNonQuery("UPDATE agence SET gsbl=" + s + " WHERE gdid=" + text8 + " AND classid=4"); base2.ExecuteNonQuery("UPDATE agence SET gdbl=100-bl-zdlbl-gsbl WHERE gdid=" + text8 + " AND classid=4"); base2.Dispose(); MyFunc.JumpPage("修改股东成功!", "gdlist.aspx"); } else { base2.Dispose(); MyFunc.showmsg("修改股东失败!"); } } } } else { MyFunc.showmsg("请输入正确的信用额度"); base.Response.End(); } } catch { MyFunc.showmsg("请输入正确的信用额度"); base.Response.End(); } } else { MyFunc.showmsg("请选择正确的公司+股东成数"); base.Response.End(); } } catch { MyFunc.showmsg("请选择正确的公司+股东成数"); base.Response.End(); } } else { MyFunc.showmsg("请选择正确的公司成数"); base.Response.End(); } } catch { MyFunc.showmsg("请选择正确的公司成数"); base.Response.End(); } } } } }
private void Page_Load(object sender, EventArgs e) { if (!MyFunc.CheckUserLogin(1) || !MyTeam.OnlineList.OnlineList.isUserLogin(1)) { MyFunc.goToLoginPage("../"); base.Response.End(); } else if ((base.Request["action"] != null) && (base.Request["action"].Trim() == "odds")) { string sql = ""; sql = "DELETE ball_order"; DataBase base2 = new DataBase(MyFunc.GetConnStr(2)); base2.ExecuteNonQuery(sql); base2.Dispose(); DataBase base3 = new DataBase(MyFunc.GetConnStr(1)); sql = "update changeleave set giveup1sum=0"; base3.ExecuteNonQuery(sql); base3.Dispose(); MyFunc.JumpPage("删除成功。", "chgLists.aspx"); base.Response.End(); } else if ((base.Request["action"] != null) && (base.Request["action"].Trim() == "order1")) { DataBase base4 = new DataBase(MyFunc.GetConnStr(2)); string text2 = ""; text2 = "select * from ball_order1 where orderid not in (select orderid from ball_order where datediff(d,updatetime,'2005-07-11') > 6);"; text2 = text2 + "delete from ball_bf1"; base4.ExecuteNonQuery(text2); MyFunc.JumpPage("删除成功。", "chgLists.aspx"); base.Response.End(); } else if ((base.Request["action"] != null) && (base.Request["action"].Trim() == "deluser")) { DataBase base5 = new DataBase(MyFunc.GetConnStr(2)); string text3 = ""; text3 = "delete from member where datediff(d,regtime,getdate()) > 15 and userid not in (select userid from ball_order)"; base5.ExecuteNonQuery(text3); MyFunc.JumpPage("删除成功。", "chgLists.aspx"); base.Response.End(); } else if ((base.Request["action"] != null) && (base.Request["action"].Trim() == "deldls")) { DataBase base6 = new DataBase(MyFunc.GetConnStr(2)); string text4 = ""; text4 = "delete from agence where datediff(d,regtime,getdate()) > 15 and classid = 4 and userid not in (select dlsid from ball_order)"; base6.ExecuteNonQuery(text4); MyFunc.JumpPage("删除成功。", "chgLists.aspx"); base.Response.End(); } else if ((base.Request["action"] != null) && (base.Request["action"].Trim() == "delzdl")) { DataBase base7 = new DataBase(MyFunc.GetConnStr(2)); string text5 = ""; text5 = "delete from agence where datediff(d,regtime,getdate()) > 15 and classid = 3 and userid not in (select zdlid from ball_order)"; base7.ExecuteNonQuery(text5); MyFunc.JumpPage("删除成功。", "chgLists.aspx"); base.Response.End(); } else if ((base.Request["action"] != null) && (base.Request["action"].Trim() == "delgd")) { DataBase base8 = new DataBase(MyFunc.GetConnStr(2)); string text6 = ""; text6 = "delete from agence where datediff(d,regtime,getdate()) > 15 and classid = 2 and userid not in (select gdid from ball_order)"; base8.ExecuteNonQuery(text6); MyFunc.JumpPage("删除成功。", "chgLists.aspx"); base.Response.End(); } else if ((base.Request["action"] != null) && (base.Request["action"].Trim() == "del45order")) { DataBase base9 = new DataBase(MyFunc.GetConnStr(2)); string text7 = ""; text7 = "delete from ball_order where datediff(d,updatetime,getdate()) > 45"; base9.ExecuteNonQuery(text7); MyFunc.JumpPage("删除成功。", "chgLists.aspx"); base.Response.End(); } }
private void ButtonSave_Click(object sender, EventArgs e) { if (!MyFunc.CheckUserLogin(this.Session.Contents["adminusername"].ToString().Trim(), this.Session.Contents["adminuserpass"].ToString().Trim(), this.Session.Contents["adminclassid"].ToString().Trim(), 1)) { MyFunc.goToLoginPage(); base.Response.End(); } else { string input = this.TextBoxUserName.Text.Trim().ToLower(); string text2 = this.TextBoxNewpass1.Text.Trim(); string text3 = this.TextBoxNewpass2.Text.Trim(); string text4 = this.TextBoxTrueName.Text.Trim(); string text7 = "1"; string text5 = this.TextBoxTel.Text.Trim().Replace("'", "").Replace("%", ""); string s = this.TextBoxUseMoney.Text.Trim(); string text8 = this.TextBoxGdid.Text.Trim(); string text9 = this.TextBoxGdName.Text.Trim(); string text10 = this.Session.Contents["adminuserid"].ToString().Trim(); string text11 = this.Session.Contents["adminusername"].ToString().Trim(); string selectedValue = this.DropDownListDls.SelectedValue; string text = this.DropDownListDls.SelectedItem.Text; string text14 = this.DropDownListRate.SelectedItem.Text; string text15 = this.DropDownListRate.SelectedValue; string text16 = this.DropDownListPlType.SelectedValue; string text17 = this.RadioButton1.Checked ? "信用" : "现金"; string text18 = this.DropDownListABC.SelectedValue; if (((((input == "") || (text2 == "")) || ((text3 == "") || (text4 == ""))) || (((text7 == "") || (s == "")) || ((text10 == "") || (text11 == "")))) || (((selectedValue == "") || (text == "")) || ((text8 == "") || (text9 == "")))) { MyFunc.showmsg("请输入会员帐号,密码,名称,信用额度"); base.Response.End(); } else if (input.Length < 3) { MyFunc.showmsg("会员帐号不能小于3个字符"); base.Response.End(); } else if (text4.Length > 8) { MyFunc.showmsg("会员名称不能大于8个字符(4个汉字)"); base.Response.End(); } else { Regex regex = new Regex("[^'*%=\"<>/|]"); Regex regex2 = new Regex("[^'*%=\"<>/|]"); if (!regex.IsMatch(input) || !regex2.IsMatch(text4)) { MyFunc.showmsg("会员帐号或名称里含有非法字符"); base.Response.End(); } else if (text2 != text3) { MyFunc.showmsg("输入的密码不相同"); } else { try { int num = (int)(int.Parse(s) * float.Parse(text15)); if (num >= 0) { DataBase base2 = new DataBase(MyFunc.GetConnStr(2)); int num2 = int.Parse(base2.ExecuteScalar("SELECT usemoney FROM agence WHERE userid=" + selectedValue).ToString()); int num3 = int.Parse(base2.ExecuteScalar("SELECT ISNULL(SUM(usemoney),0) FROM member WHERE dlsid=" + selectedValue).ToString()); int num4 = num2 - num3; if (int.Parse(s) > num4) { base2.Dispose(); MyFunc.showmsg("信用度额不能大于总代理可用信用度额"); base.Response.End(); } else { int num5 = (int)base2.ExecuteScalar("SELECT COUNT(1) FROM member WHERE username='******'"); if (num5 > 0) { base2.Dispose(); MyFunc.showmsg("该会员帐号已存在!"); base.Response.End(); } else { int num6 = int.Parse(base2.ExecuteScalar("SELECT maxmem FROM agence WHERE userid=" + selectedValue).ToString()); if (num6 > 0) { int num7 = int.Parse(base2.ExecuteScalar("SELECT COUNT(1) FROM member WHERE dlsid=" + selectedValue + " AND isuseable=1").ToString()); if (num6 < (num7 + 1)) { base2.Dispose(); MyFunc.showmsg("该代理商的最大会员数为 " + num6.ToString() + ",不能再添加新会员"); base.Response.End(); return; } } else { int num8 = int.Parse(base2.ExecuteScalar("SELECT maxmem FROM agence WHERE userid=" + text10).ToString()); if (num8 > 0) { int num9 = int.Parse(base2.ExecuteScalar("SELECT COUNT(1) FROM member WHERE zdlid=" + text10 + " AND isuseable=1").ToString()); if (num8 < (num9 + 1)) { base2.Dispose(); MyFunc.showmsg("您的最大会员数为 " + num6.ToString() + ",不能再添加新会员"); base.Response.End(); return; } } else { int num10 = int.Parse(base2.ExecuteScalar("SELECT maxmem FROM agence WHERE userid=" + text8).ToString()); if (num10 > 0) { int num11 = int.Parse(base2.ExecuteScalar("SELECT COUNT(1) FROM member WHERE gdid=" + text8 + " AND isuseable=1").ToString()); if (num10 < (num11 + 1)) { base2.Dispose(); MyFunc.showmsg("该股东的最大会员数为 " + num6.ToString() + ",不能再添加新会员"); base.Response.End(); return; } } } } if (base2.ExecuteNonQuery("INSERT INTO member(username,userpass,truename,tel,regtime,isuseable,usemoney,moneysort,moneyrate,gdid,gdname,zdlid,zdlname,dlsid,dlsname,pltype,usertype,abc,curmoney)VALUES('" + input + "','" + text2 + "','" + text4 + "','" + text5 + "',GetDate(),1," + s + ",'" + text14 + "'," + text15 + "," + text8 + ",'" + text9 + "'," + text10 + ",'" + text11 + "'," + selectedValue + ",'" + text + "','" + text16 + "','" + text17 + "','" + text18 + "'," + s + ")") > 0) { string text19 = base2.ExecuteScalar("SELECT userid FROM member WHERE username='******'").ToString(); base2.ExecuteNonQuery("insert userhs select '" + text19 + "',w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12,w13,w14,w15,l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,l11,l12,l13,l14,l15,maxC1,maxC2,maxC3,maxC4,maxC5,maxC6,maxC7,maxC8,maxC9,maxC10,maxC11,maxC12,maxC13,maxC14,maxC15,maxZ1,maxZ2,maxZ3,maxZ4,maxZ5,maxZ6,maxZ7,maxZ8,maxZ9,maxZ10,maxZ11,maxZ12,maxZ13,maxZ14,maxZ15,W28,L28,maxC28,maxZ28,maxZ18,maxZ19,maxZ20,maxZ21,maxZ22,maxZ23,maxZ24,maxC18,maxC19,maxC20,maxC21,maxC22,maxC23,maxC24,w18,w19,w20,w21,w22,w23,w24,l18,l19,l20,l21,l22,l23,l24 from hs join agence on hs.userid = agence.userid where hs.userid='" + selectedValue + "' and hs.type='" + text18 + "'"); base2.ExecuteNonQuery("UPDATE agence SET memcount=memcount+1 WHERE userid=" + selectedValue); base2.Dispose(); MyFunc.JumpPage("添加会员成功!", "userlist.aspx"); } else { base2.Dispose(); MyFunc.showmsg("添加会员失败!"); } } } } else { MyFunc.showmsg("请输入正确的信用额度"); base.Response.End(); } } catch { MyFunc.showmsg("请输入正确的信用额度"); base.Response.End(); } } } } }
private void ButtonSave_Click(object sender, EventArgs e) { string text7 = ""; string text6 = this.TextBoxGsID.Text.Trim(); string input = this.TextBoxUserName.Text.Trim(); string text2 = this.TextBoxNewpass1.Text.Trim(); string text3 = this.TextBoxNewpass2.Text.Trim(); string text4 = this.TextBoxTrueName.Text.Trim(); string s = this.TextBoxUseMoney.Text.Trim(); string text8 = this.TextBoxMaxMem.Text.Trim(); if (((text6 == "") || (input == "")) || ((text4 == "") || (text8 == ""))) { MyFunc.showmsg("请输入公司帐号,名称,成数和最大会员数"); base.Response.End(); } else { Regex regex = new Regex("[^'*%=\"<>/|]"); Regex regex2 = new Regex("[^'*%=\"<>/|]"); if (!regex.IsMatch(input) || !regex2.IsMatch(text4)) { MyFunc.showmsg("公司帐号或股东名里含有非法字符"); base.Response.End(); } else { if ((text2 != "") && (text3 != "")) { if (text2 != text3) { MyFunc.showmsg("输入的密码不相同"); return; } text7 = ",userpass='******'"; } if (text4.Length > 8) { MyFunc.showmsg("公司名称不能大于8个字符(4个汉字)"); base.Response.End(); } else { try { if (int.Parse(s) >= 0) { try { int.Parse(text8); } catch { MyFunc.showmsg("请输入正确的最大会员数"); base.Response.End(); return; } DataBase base2 = new DataBase(MyFunc.GetConnStr(2)); if (int.Parse(base2.ExecuteScalar("SELECT COUNT(*) FROM agence WHERE userid=" + text6).ToString()) < 1) { base2.Dispose(); MyFunc.showmsg("没有该公司"); } else { string text9 = base2.ExecuteScalar("select arrgd+'-1' from agence where userid ='" + text6 + "'").ToString(); int num2 = int.Parse(base2.ExecuteScalar("SELECT COUNT(1) FROM member WHERE gdid in (" + text9 + ")").ToString()); if ((num2 > int.Parse(text8)) && (int.Parse(text8) != 0)) { base2.Dispose(); MyFunc.showmsg("该公司已有 " + num2.ToString() + " 个会员,设置的最大会员数最小为" + num2.ToString()); base.Response.End(); } else if (base2.ExecuteNonQuery("UPDATE agence SET truename='" + text4 + "'" + text7 + ",maxmem=" + text8 + ",usemoney=" + s + " WHERE userid=" + text6) > 0) { base2.Dispose(); MyFunc.JumpPage("修改公司成功!", "gslist.aspx"); } else { base2.Dispose(); MyFunc.showmsg("修改公司失败!"); } } } else { MyFunc.showmsg("请输入正确的信用额度"); base.Response.End(); } } catch { MyFunc.showmsg("请输入正确的信用额度"); base.Response.End(); } } } } }
private void ButtonSave_Click(object sender, EventArgs e) { if (!MyFunc.CheckUserLogin(this.Session.Contents["adminusername"].ToString().Trim(), this.Session.Contents["adminuserpass"].ToString().Trim(), this.Session.Contents["adminclassid"].ToString().Trim(), 1)) { MyFunc.goToLoginPage(); base.Response.End(); } else { string input = this.TextBoxUserName.Text.Trim().ToLower(); string text2 = this.TextBoxNewpass1.Text.Trim(); string text3 = this.TextBoxNewpass2.Text.Trim(); string text4 = this.TextBoxTrueName.Text.Trim(); string text6 = this.DropDownListIsUseAble.SelectedValue.Trim(); string s = this.TextBoxUseMoney.Text.Trim(); string text15 = this.TextBoxTel.Text.Trim().Replace(" ", "").Replace("'", "").Replace("%", ""); string text7 = this.TextBoxGdid.Text.Trim(); string text8 = this.TextBoxGdName.Text.Trim(); string upid = this.Session.Contents["adminuserid"].ToString().Trim(); string text10 = this.Session.Contents["adminusername"].ToString().Trim(); string selectedValue = this.DropDownListZdlBl.SelectedValue; string text13 = this.DropDownListDlsBl.SelectedValue; string text16 = this.TextBoxMaxMem.Text.Trim(); if ((((input == "") || (text2 == "")) || ((text3 == "") || (text4 == ""))) || ((((text6 == "") || (s == "")) || ((upid == "") || (text10 == ""))) || (((selectedValue == "") || (text13 == "")) || (text16 == "")))) { MyFunc.showmsg("请输入代理商帐号,密码,名称,即时注单状态,信用额度,最大会员数"); base.Response.End(); } else if (input.Length < 3) { MyFunc.showmsg("代理商帐号不能小于3个字符"); base.Response.End(); } else if (text4.Length > 8) { MyFunc.showmsg("代理商名称不能大于8个字符(4个汉字)"); base.Response.End(); } else { Regex regex = new Regex("[^'*%=\"<>/|]"); Regex regex2 = new Regex("[^'*%=\"<>/|]"); if (!regex.IsMatch(input) || !regex2.IsMatch(text4)) { MyFunc.showmsg("代理商帐号或名称里含有非法字符"); base.Response.End(); } else if (text2 != text3) { MyFunc.showmsg("输入的密码不相同"); } else { try { if (int.Parse(s) >= 0) { try { int.Parse(text16); } catch { MyFunc.showmsg("请输入正确的最大会员数"); base.Response.End(); return; } DataBase base2 = new DataBase(MyFunc.GetConnStr(2)); string text11 = base2.ExecuteScalar("SELECT gdbl FROM agence WHERE userid=" + text7).ToString(); string text14 = base2.ExecuteScalar("SELECT gsbl FROM agence WHERE userid=" + text7).ToString(); if ((int.Parse(selectedValue) + int.Parse(text13)) > (100 - int.Parse(text11))) { MyFunc.showmsg("总代理,代理商的比例相加不能大于" + ((100 - int.Parse(text11))).ToString()); base.Response.End(); } else { text11 = (((100 - int.Parse(text14)) - int.Parse(selectedValue)) - int.Parse(text13)).ToString(); int num2 = int.Parse(base2.ExecuteScalar("SELECT usemoney FROM agence WHERE userid=" + upid).ToString()); int num3 = int.Parse(base2.ExecuteScalar("SELECT ISNULL(SUM(usemoney),0) FROM agence WHERE zdlid=" + upid + " AND isuseable=1").ToString()); int num4 = int.Parse(base2.ExecuteScalar("SELECT ISNULL(SUM(usemoney),0) FROM agence WHERE zdlid=" + upid + " AND isuseable=0").ToString()); int num5 = (num2 - num3) - num4; if (int.Parse(s) > num5) { base2.Dispose(); MyFunc.showmsg("信用度额不能大于总代理可用信用度额"); base.Response.End(); } else if (int.Parse(base2.ExecuteScalar("SELECT COUNT(*) FROM agence WHERE username='******'").ToString()) > 0) { base2.Dispose(); MyFunc.showmsg("该代理商帐号已存在!"); base.Response.End(); } else { int num7 = int.Parse(base2.ExecuteScalar("SELECT maxmem FROM agence WHERE userid=" + upid).ToString()); if (num7 > 0) { int num8 = int.Parse(base2.ExecuteScalar("SELECT ISNULL(SUM(maxmem),0) FROM agence WHERE zdlid=" + upid + " AND classid=4").ToString()); if ((num8 + int.Parse(text16)) > num7) { base2.Dispose(); object[] objArray = new object[] { "您的最大会员为 ", num7, " ,现在代理商最大会员数最大可设为 ", (num7 - num8).ToString() }; MyFunc.showmsg(string.Concat(objArray)); base.Response.End(); return; } } else { int num9 = int.Parse(base2.ExecuteScalar("SELECT maxmem FROM agence WHERE userid=" + text7).ToString()); if (num9 > 0) { int num10 = int.Parse(base2.ExecuteScalar("SELECT ISNULL(SUM(maxmem),0) FROM agence WHERE gdid=" + text7 + " AND classid=4").ToString()); if ((num10 + int.Parse(text16)) > num9) { base2.Dispose(); object[] objArray2 = new object[] { "您的的最大会员为 ", num9, " ,现在代理商最大会员数最大可设为 ", (num9 - num10).ToString() }; MyFunc.showmsg(string.Concat(objArray2)); base.Response.End(); return; } } } if (base2.ExecuteNonQuery("INSERT INTO agence(username,userpass,truename,classid,regtime,isuseable,usemoney,tel,gdid,gdname,zdlid,zdlname,bl,gdbl,zdlbl,gsbl)VALUES('" + input + "','" + text2 + "','" + text4 + "',4,GetDate()," + this.DropDownListIsUseAble.SelectedValue + "," + s + ",'" + text15 + "'," + text7 + ",'" + text8 + "'," + upid + ",'" + text10 + "'," + text13 + "," + text11 + "," + selectedValue + "," + text14 + ")") > 0) { string userid = base2.ExecuteScalar("SELECT userid FROM agence WHERE username='******'").ToString(); this.SetStartHs(upid, userid, "A"); this.SetStartHs(upid, userid, "B"); this.SetStartHs(upid, userid, "C"); this.SetStartHs(upid, userid, "D"); base2.ExecuteNonQuery("UPDATE agence SET memcount=memcount+1 WHERE userid=" + upid); base2.Dispose(); MyFunc.JumpPage("添加代理商成功!", "dlslist.aspx"); } else { base2.Dispose(); MyFunc.showmsg("添加代理商失败!"); } } } } else { MyFunc.showmsg("请输入正确的信用额度"); base.Response.End(); } } catch { MyFunc.showmsg("请输入正确的信用额度"); base.Response.End(); } } } } }
private void ButtonSave_Click(object sender, EventArgs e) { if (!MyFunc.CheckUserLogin(this.Session.Contents["adminusername"].ToString().Trim(), this.Session.Contents["adminuserpass"].ToString().Trim(), this.Session.Contents["adminclassid"].ToString().Trim(), 1)) { MyFunc.goToLoginPage(); base.Response.End(); } else { string text9 = ""; string text7 = this.TextBoxZdlID.Text.Trim(); string input = this.TextBoxUserName.Text.Trim(); string text2 = this.TextBoxNewpass1.Text.Trim(); string text3 = this.TextBoxNewpass2.Text.Trim(); string text4 = this.TextBoxTrueName.Text.Trim(); string s = this.TextBoxUseMoney.Text.Trim(); string text10 = this.TextBoxMaxMem.Text.Trim(); string text8 = this.TextBoxTel.Text.Trim().Replace("'", "").Replace(" ", "").Replace("%", ""); string text6 = this.DropDownListIsUseAble.SelectedValue.Trim(); if (((input == "") || (text4 == "")) || (((text6 == "") || (s == "")) || (text10 == ""))) { MyFunc.showmsg("请输入总代理帐号,密码,名称,即时注单状态,信用额度,最大会员数"); base.Response.End(); } else { Regex regex = new Regex("[^'*%=\"<>/|]"); Regex regex2 = new Regex("[^'*%=\"<>/|]"); if (!regex.IsMatch(input) || !regex2.IsMatch(text4)) { MyFunc.showmsg("总代理帐号或名称里含有非法字符"); base.Response.End(); } else if (text4.Length > 8) { MyFunc.showmsg("股东名称不能大于8个字符(4个汉字)"); base.Response.End(); } else { if ((text2 != "") && (text3 != "")) { if (text2 != text3) { MyFunc.showmsg("输入的密码不相同"); return; } text9 = ",userpass='******'"; } try { if (int.Parse(s) >= 0) { try { int.Parse(text10); } catch { MyFunc.showmsg("请输入正确的最大会员数"); base.Response.End(); return; } DataBase base2 = new DataBase(MyFunc.GetConnStr(2)); int num2 = (int)base2.ExecuteScalar("SELECT COUNT(*) FROM agence WHERE userid=" + text7 + " AND gdid=" + this.Session.Contents["adminuserid"].ToString().Trim()); if (num2 < 1) { base2.Dispose(); MyFunc.showmsg("没有该总代理"); base.Response.End(); } else { int num3 = int.Parse(base2.ExecuteScalar("SELECT ISNULL(usemoney,0) FROM agence WHERE userid=" + this.Session.Contents["adminuserid"].ToString().Trim()).ToString()); int num4 = int.Parse(base2.ExecuteScalar("SELECT ISNULL(SUM(usemoney),0) FROM agence WHERE gdid=" + this.Session.Contents["adminuserid"].ToString().Trim() + " and classid = 3").ToString()); int num5 = int.Parse(base2.ExecuteScalar("SELECT ISNULL(usemoney,0) FROM agence WHERE userid=" + text7).ToString()); if (int.Parse(s) > ((num3 - num4) + num5)) { base2.Dispose(); MyFunc.showmsg("总代理信用额度不能大于股东可用信用额度"); base.Response.End(); } else { int num6 = int.Parse(base2.ExecuteScalar("SELECT maxmem FROM agence WHERE userid=" + this.Session.Contents["adminuserid"].ToString().Trim()).ToString()); if (num6 > 0) { int num7 = int.Parse(base2.ExecuteScalar("SELECT COUNT(1) FROM member WHERE zdlid=" + text7).ToString()); if (num7 > int.Parse(text10)) { base2.Dispose(); MyFunc.showmsg("该总代理已有 " + num7.ToString() + " 个会员,设置的最大会员数最小为 " + num7.ToString()); base.Response.End(); return; } num7 = int.Parse(base2.ExecuteScalar("SELECT ISNULL(SUM(maxmem),0) FROM agence WHERE gdid=" + this.Session.Contents["adminuserid"].ToString().Trim() + " AND classid=3 AND userid<>" + text7).ToString()); if ((num7 + int.Parse(text10)) > num6) { base2.Dispose(); object[] objArray = new object[] { "股东最大会员数为 ", num6, " ,现在总代理最大会员数最大可设为 ", (num6 - num7).ToString() }; MyFunc.showmsg(string.Concat(objArray)); base.Response.End(); return; } } if (base2.ExecuteNonQuery("UPDATE agence SET truename='" + text4 + "'" + text9 + ",usemoney=" + s + ",isuseable=" + text6 + ",tel='" + text8 + "',maxmem=" + text10 + " WHERE userid=" + text7 + " AND gdid=" + this.Session.Contents["adminuserid"].ToString().Trim()) > 0) { base2.Dispose(); MyFunc.JumpPage("修改总代理成功!", "zdllist.aspx"); } else { base2.Dispose(); MyFunc.showmsg("修改总代理失败!"); } } } } else { MyFunc.showmsg("请输入正确的信用额度"); base.Response.End(); } } catch { MyFunc.showmsg("请输入正确的信用额度"); base.Response.End(); } } } } }
private void ButtonSave_Click(object sender, EventArgs e) { if (!MyFunc.CheckUserLogin(this.Session.Contents["adminusername"].ToString().Trim(), this.Session.Contents["adminuserpass"].ToString().Trim(), this.Session.Contents["adminclassid"].ToString().Trim(), 1)) { MyFunc.goToLoginPage(); base.Response.End(); } else { string input = this.TextBoxUserName.Text.Trim().ToLower(); string text2 = this.TextBoxNewpass1.Text.Trim(); string text3 = this.TextBoxNewpass2.Text.Trim(); string text4 = this.TextBoxTrueName.Text.Trim(); string text6 = this.DropDownListIsUseAble.SelectedValue.Trim(); string s = this.TextBoxUseMoney.Text.Trim(); string text9 = this.TextBoxTel.Text.Trim().Replace("'", "").Replace("%", "").Replace(" ", ""); string upid = this.DropDownListGd.SelectedValue.Trim(); string text8 = this.DropDownListGd.SelectedItem.Text.Trim(); string text10 = this.TextBoxMaxMem.Text.Trim(); if (this.DropDownListGd.SelectedValue == "00") { MyFunc.showmsg("请输入总代理所在的股东帐号"); base.Response.End(); } else if ((((input == "") || (text2 == "")) || ((text3 == "") || (text4 == ""))) || (((text6 == "") || (s == "")) || (text10 == ""))) { MyFunc.showmsg("请输入总代理帐号,密码,名称,即时注单状态,信用额度,最大会员数"); base.Response.End(); } else if (input.Length < 5) { MyFunc.showmsg("总代理的帐号不能小于5个字符"); base.Response.End(); } else if (text4.Length > 8) { MyFunc.showmsg("总代理名称不能大于8个字符(4个汉字)"); base.Response.End(); } else { Regex regex = new Regex("[^'*%=\"<>/|]"); Regex regex2 = new Regex("[^'*%=\"<>/|]"); if (!regex.IsMatch(input) || !regex2.IsMatch(text4)) { MyFunc.showmsg("总代理帐号或名称里含有非法字符"); base.Response.End(); } else if (text2 != text3) { MyFunc.showmsg("输入的密码不相同"); } else { try { if (int.Parse(s) >= 0) { try { int.Parse(text10); } catch { MyFunc.showmsg("请输入正确的最大会员数"); base.Response.End(); return; } DataBase base2 = new DataBase(MyFunc.GetConnStr(2)); if (int.Parse(base2.ExecuteScalar("SELECT COUNT(*) FROM agence WHERE username='******'").ToString()) > 0) { base2.Dispose(); MyFunc.showmsg("该总代理的帐号已存在!"); base.Response.End(); } else { int num3 = int.Parse(base2.ExecuteScalar("SELECT ISNULL(usemoney,0) FROM agence WHERE userid=" + upid).ToString()); int num4 = int.Parse(base2.ExecuteScalar("SELECT ISNULL(SUM(usemoney),0) FROM agence WHERE gdid=" + upid + " and classid = 3").ToString()); if (int.Parse(s) > (num3 - num4)) { base2.Dispose(); MyFunc.showmsg("总代理信用额度不能大于股东可用信用额度"); base.Response.End(); } else { int num5 = int.Parse(base2.ExecuteScalar("SELECT maxmem FROM agence WHERE userid=" + upid).ToString()); if (num5 > 0) { int num6 = int.Parse(base2.ExecuteScalar("SELECT ISNULL(SUM(maxmem),0) FROM agence WHERE gdid=" + upid + " AND classid=3").ToString()); if ((num6 + int.Parse(text10)) > num5) { base2.Dispose(); object[] objArray = new object[] { "股东最大会员为 ", num5, " ,现在总代理最大会员数最大可设为 ", (num5 - num6).ToString() }; MyFunc.showmsg(string.Concat(objArray)); base.Response.End(); return; } } if (base2.ExecuteNonQuery("INSERT INTO agence(username,userpass,truename,classid,regtime,isuseable,usemoney,gdid,gdname,tel,maxmem)VALUES('" + input + "','" + text2 + "','" + text4 + "',3,GetDate()," + this.DropDownListIsUseAble.SelectedValue + "," + s + "," + upid + ",'" + text8 + "','" + text9 + "'," + text10 + ")") > 0) { string userid = base2.ExecuteScalar("SELECT userid FROM agence WHERE username='******'").ToString(); this.SetStartHs(upid, userid, "A"); this.SetStartHs(upid, userid, "B"); this.SetStartHs(upid, userid, "C"); this.SetStartHs(upid, userid, "D"); base2.ExecuteNonQuery("UPDATE agence SET memcount=memcount+1 WHERE userid=" + upid); base2.Dispose(); MyFunc.JumpPage("添加总代理成功!", "zdllist.aspx"); } else { base2.Dispose(); MyFunc.showmsg("添加总代理失败!"); } } } } else { MyFunc.showmsg("请输入正确的信用额度"); base.Response.End(); } } catch { MyFunc.showmsg("请输入正确的信用额度"); base.Response.End(); } } } } }
private void ButtonSave_Click(object sender, EventArgs e) { string input = this.TextBoxUserName.Text.Trim().ToLower(); string text2 = this.TextBoxNewpass1.Text.Trim(); string text3 = this.TextBoxNewpass2.Text.Trim(); string text4 = this.TextBoxTrueName.Text.Trim(); string s = this.DropDownListBL.SelectedValue.Trim(); string text6 = MyFunc.DefaultValue(base.Request.Form["DropDownListGsGd"], ""); string text8 = this.TextBoxUseMoney.Text.Trim(); string text7 = this.TextBoxMaxMem.Text.Trim(); if ((((input == "") || (text2 == "")) || ((text3 == "") || (text4 == ""))) || ((s == "") || (text6 == ""))) { MyFunc.showmsg("请输入股东帐号,密码,名称和比例"); base.Response.End(); } else if (input.Length < 3) { MyFunc.showmsg("股东帐号不能小于3个字符"); base.Response.End(); } else if (text4.Length > 8) { MyFunc.showmsg("股东名称不能大于8个字符(4个汉字)"); base.Response.End(); } else { Regex regex = new Regex("[^'*%=\"<>/|]"); Regex regex2 = new Regex("[^'*%=\"<>/|]"); if (!regex.IsMatch(input) || !regex2.IsMatch(text4)) { MyFunc.showmsg("股东帐号或股东名里含有非法字符"); base.Response.End(); } else if (text2 != text3) { MyFunc.showmsg("输入的密码不相同"); } else { try { int num = int.Parse(s); if ((num >= 0) || (num <= 100)) { try { int num2 = int.Parse(text6); if ((num2 >= int.Parse(s)) || (num2 <= 100)) { try { if (int.Parse(text8) >= 0) { if (int.Parse(text6) < int.Parse(s)) { MyFunc.showmsg("公司+股东比例不能小于公司最低比例"); base.Response.End(); } else { try { int.Parse(text7); } catch { MyFunc.showmsg("请输入正确的最大会员数"); base.Response.End(); return; } DataBase base2 = new DataBase(MyFunc.GetConnStr(2)); if (int.Parse(base2.ExecuteScalar("SELECT COUNT(*) FROM agence WHERE username='******'").ToString()) > 0) { base2.Dispose(); MyFunc.showmsg("该股东帐号已存在!"); base.Response.End(); } else if (base2.ExecuteNonQuery("INSERT INTO agence(username,userpass,truename,classid,regtime,isuseable,gsbl,gdbl,usemoney,maxmem,gdid,gdname)VALUES('" + input + "','" + text2 + "','" + text4 + "',2,GetDate(),1," + s + "," + text6 + "," + text8 + "," + text7 + ",'" + this.Session["adminuserid"].ToString() + "','" + this.Session["adminusername"].ToString() + "')") > 0) { string text9 = base2.ExecuteScalar("SELECT userid FROM agence WHERE username='******'").ToString(); base2.ExecuteNonQuery("UPDATE agence SET arrgd = arrgd+'" + text9.Trim() + ",' WHERE classid = 0 AND userid = '" + this.Session["adminuserid"].ToString() + "'"); base2.ExecuteNonQuery("INSERT INTO hs(userid,type)VALUES(" + text9 + ",'A');INSERT INTO hs(userid,type)VALUES(" + text9 + ",'B');INSERT INTO hs(userid,type)VALUES(" + text9 + ",'C');INSERT INTO hs(userid,type)VALUES(" + text9 + ",'D')"); base2.Dispose(); MyFunc.JumpPage("添加股东成功!", "gdlist.aspx"); } else { base2.Dispose(); MyFunc.showmsg("添加股东失败!"); } } } else { MyFunc.showmsg("请输入正确的信用额度"); base.Response.End(); } } catch { MyFunc.showmsg("请输入正确的信用额度"); base.Response.End(); } } else { MyFunc.showmsg("请选择正确的公司+股东成数"); base.Response.End(); } } catch { MyFunc.showmsg("请选择正确的公司+股东成数"); base.Response.End(); } } else { MyFunc.showmsg("请选择正确的公司成数"); base.Response.End(); } } catch { MyFunc.showmsg("请选择正确的公司成数"); base.Response.End(); } } } }
private void ButtonSave_Click(object sender, EventArgs e) { string input = this.TextBoxUserName.Text.Trim().ToLower(); string text2 = this.TextBoxNewpass1.Text.Trim(); string text3 = this.TextBoxNewpass2.Text.Trim(); string text4 = this.TextBoxTrueName.Text.Trim(); string s = this.TextBoxUseMoney.Text.Trim(); string text5 = this.TextBoxMaxMem.Text.Trim(); if (((input == "") || (text2 == "")) || ((text3 == "") || (text4 == ""))) { MyFunc.showmsg("请输入公司帐号,密码,名称和比例"); base.Response.End(); } else if (input.Length < 3) { MyFunc.showmsg("公司帐号不能小于3个字符"); base.Response.End(); } else if (text4.Length > 8) { MyFunc.showmsg("公司名称不能大于8个字符(4个汉字)"); base.Response.End(); } else { Regex regex = new Regex("[^'*%=\"<>/|]"); Regex regex2 = new Regex("[^'*%=\"<>/|]"); if (!regex.IsMatch(input) || !regex2.IsMatch(text4)) { MyFunc.showmsg("公司帐号或公司名里含有非法字符"); base.Response.End(); } else if (text2 != text3) { MyFunc.showmsg("输入的密码不相同"); } else { try { if (int.Parse(s) >= 0) { try { int.Parse(text5); } catch { MyFunc.showmsg("请输入正确的最大会员数"); base.Response.End(); return; } DataBase base2 = new DataBase(MyFunc.GetConnStr(2)); if (int.Parse(base2.ExecuteScalar("SELECT COUNT(*) FROM agence WHERE username='******'").ToString()) > 0) { base2.Dispose(); MyFunc.showmsg("该公司帐号已存在!"); base.Response.End(); } else if (base2.ExecuteNonQuery("INSERT INTO agence(username,userpass,truename,classid,regtime,isuseable,usemoney,maxmem)VALUES('" + input + "','" + text2 + "','" + text4 + "',0,GetDate(),1," + s + "," + text5 + ")") > 0) { string text7 = base2.ExecuteScalar("SELECT userid FROM agence WHERE username='******'").ToString(); base2.ExecuteNonQuery("INSERT INTO hs(userid,type)VALUES(" + text7 + ",'A');INSERT INTO hs(userid,type)VALUES(" + text7 + ",'B');INSERT INTO hs(userid,type)VALUES(" + text7 + ",'C');INSERT INTO hs(userid,type)VALUES(" + text7 + ",'D');"); base2.Dispose(); MyFunc.JumpPage("添加公司成功!", "gslist.aspx"); } else { base2.Dispose(); MyFunc.showmsg("添加公司失败!"); } } else { MyFunc.showmsg("请输入正确的信用额度"); base.Response.End(); } } catch { MyFunc.showmsg("请输入正确的信用额度"); base.Response.End(); } } } }