public void getMemberInfo() { string Number = DisposeString.DisString(this.Number.Text.Trim()); string Name = DisposeString.DisString(this.Name.Text.Trim()); string Recommended = DisposeString.DisString(this.Recommended.Text.Trim()); string Placement = DisposeString.DisString(this.Placement.Text.Trim()); int ExpectNum = 0; if (this.DropDownExpectNum.SelectedValue.ToString() == "") { ExpectNum = 0; } else { ExpectNum = Convert.ToInt32(this.DropDownExpectNum.SelectedItem.Value); } //string Tele =Encryption.Encryption.GetEncryptionTele(DisposeString.DisString(this.Tele.Text.Trim())); StringBuilder sb = new StringBuilder(); sb.Append(" 1=1 "); if (Number.Length > 0) { sb.Append(" and Number like'%" + Number + "%'"); } if (Name.Length > 0) { sb.Append(" and Name like'%" + Encryption.Encryption.GetEncryptionName(Name.Trim()) + "%'"); } if (Recommended.Length > 0) { sb.Append(" and Direct like'%" + Recommended + "%'"); } if (Placement.Length > 0) { sb.Append(" and Placement like'%" + Placement + "%'"); } //if (Tele.Length > 0) //{ // sb.Append(" and HomeTele ='" + Tele + "' or OfficeTele='" + Tele + "' or MobileTele='" + Tele + "' or FaxTele='" + Tele + "'"); //} if (type == 0) { if (ExpectNum > 0) { sb.Append(" and ExpectNum=" + ExpectNum); } } //首页传过来时候读取当日的会员 if (type == 1) { if (Request.QueryString["dd"] != null && Request.QueryString["dd"] != "") { sb.Append(" and Convert(varchar,RegisterDate,23) ='" + Request.QueryString["dd"].ToString() + "'"); } } string totalDataStart = txtBox_OrderDateTimeStart.Text.Trim(); string totalDataEnd = txtBox_OrderDateTimeEnd.Text.Trim(); if (totalDataStart != "") { Convert.ToDateTime(totalDataStart); sb.Append(" and dateadd(hour," + sphours + ",RegisterDate)>='" + totalDataStart + " 00:00:00'"); } if (totalDataEnd != "") { Convert.ToDateTime(totalDataEnd); sb.Append(" and dateadd(hour," + sphours + ",RegisterDate)<='" + totalDataEnd + " 23:59:59'"); } sb.Append(" and " + this.GetNumber()); ViewState["SQLSTR"] = "SELECT Number,[Name],Direct,Placement,(select [Name] from memberinfo d where d.number=m.Direct) as DirectName,(select [Name] from memberinfo p where p.number=m.Placement) as PlacementName,ExpectNum,isnull((Jackpot-Out-membership),0) as TotalMoney,isnull((totalremittances-totaldefray),0) as TotalOrderMoney FROM MemberInfo m WHERE " + sb.ToString(); Pager pager = Page.FindControl("Pager1") as Pager; pager.PageBind(0, 10, "MemberInfo m", "Number,[Name],Direct,Placement,(select [Name] from memberinfo d where d.number=m.Direct) as DirectName,(select [Name] from memberinfo p where p.number=m.Placement) as PlacementName,ExpectNum,isnull((Jackpot-Out-membership),0) as TotalMoney,isnull((totalremittances-totaldefray),0) as TotalOrderMoney", sb.ToString(), "ID", "GridView1"); ViewState["condition"] = sb.ToString(); Translations(); }
//private void Translations() //{ // this.TranControls(this.BtnConfirm, new string[][] { new string[] { "000340", "查询" } }); // this.TranControls(this.GridView2, // new string[][]{ // new string []{"000938","支付"}, // new string []{"000744","查看备注"}, // new string []{"000022","删除"}, // new string []{"000024","会员编号"}, // new string []{"000603","汇出金额"}, // new string []{"000775", "支付状态" }, // new string []{"000786","付款日期"}, // new string []{"000739","付款期数"}, // new string []{"005881","付款类型"}, // new string []{"000601","汇入银行"}, // new string []{"000519","经办人"}, // new string []{"000602","汇款人"}, // new string []{"000743","汇款人身份证"} // }); //} //绑定会员汇款 private void GetShopList2() { StringBuilder condition = new StringBuilder(); string table = " Remittances ,MemberInfo "; condition.Append("Remittances.id=" + id + " and MemberInfo.Number=Remittances.RemitNumber and Remittances.relationorderid='' and Remittances.RemitStatus=1 and MemberInfo.Number='" + Session["Member"].ToString() + "' "); string BeginRiQi = ""; string EndRiQi = ""; if (this.Datepicker1.Text != "") { DateTime time = DateTime.Now.ToUniversalTime(); bool b = DateTime.TryParse(Datepicker1.Text.Trim(), out time); if (!b) { Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("000827", "时间格式不正确!") + "')</script>"); return; } BeginRiQi = this.Datepicker1.Text.Trim().ToString(); DisposeString.DisString(BeginRiQi, "'", ""); if (this.Datepicker2.Text != "") { b = DateTime.TryParse(Datepicker2.Text.Trim(), out time); if (!b) { Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("000827", "时间格式不正确!") + "')</script>"); return; } EndRiQi = (DateTime.Parse(this.Datepicker2.Text).AddHours(23).AddMinutes(59).AddSeconds(59)).ToString(); DisposeString.DisString(EndRiQi, "'", ""); condition.Append(" and ReceivablesDate>= '" + BeginRiQi + "' and ReceivablesDate<='" + EndRiQi + "'"); } else { condition.Append(" and ReceivablesDate>= '" + BeginRiQi + "'"); } } else { if (this.Datepicker2.Text != "") { DateTime time = DateTime.Now.ToUniversalTime(); bool b = DateTime.TryParse(Datepicker2.Text.Trim(), out time); if (!b) { Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("000827", "时间格式不正确!") + "')</script>"); return; } EndRiQi = (DateTime.Parse(this.Datepicker2.Text.Trim()).AddHours(23).AddMinutes(59).AddSeconds(59)).ToString(); condition.Append(" and ReceivablesDate<='" + EndRiQi + "'"); } } if (this.DropDownList1.SelectedValue != "-1") { condition.Append(" and IsGSQR='" + this.DropDownList1.SelectedValue.Trim() + "' "); } string cloumns = " Remittances.isgsqr,Remittances.remittancesid,Remittances.RemittancesMoney,Remittances.RemittancesCurrency,Remittances.RemitNumber, Remittances.Sender,Remittances.Managers,Remittances.ImportBank, Remittances.PayWay,Remittances.Remittancesid,Remittances.[Use],Remittances.StandardCurrency,Remittances.ConfirmType, Remittances.SenderID, Remittances.RemitMoney,Remittances.PayExpectNum,Remittances.Id,Remittances.ReceivablesDate,Remittances.PayExpectNum,Remittances.isgsqr,Remittances.Remark "; string key = "Remittances.id"; ViewState["key"] = key; ViewState["PageColumn"] = cloumns; ViewState["table"] = table; ViewState["condition"] = condition.ToString(); this.GridView2.DataSourceID = null; this.Pager1.ControlName = "rep1"; this.Pager1.key = key; this.Pager1.PageColumn = cloumns; this.Pager1.Pageindex = 0; this.Pager1.PageTable = table; this.Pager1.Condition = condition.ToString(); this.Pager1.PageSize = 10; this.Pager1.PageCount = 0; this.Pager1.PageBind(); //Translations(); }
/// <summary> /// 获取会员信息 /// </summary> public void getMemberInfo() { string Number = DisposeString.DisString(this.Number.Text.Trim()); //去空格后赋值 string Name = Encryption.Encryption.GetEncryptionName(DisposeString.DisString(this.Name.Text.Trim())); string Recommended = DisposeString.DisString(this.Recommended.Text.Trim()); string Placement = DisposeString.DisString(this.Placement.Text.Trim()); string DName = DisposeString.DisString(this.DName.Text.Trim()); string PName = DisposeString.DisString(this.PName.Text.Trim()); int ExpectNum = 0; if (this.DropDownExpectNum.SelectedValue.ToString() == "") { ExpectNum = 0; } else { ExpectNum = Convert.ToInt32(this.DropDownExpectNum.SelectedItem.Value); } StringBuilder sb = new StringBuilder(); sb.Append(" 1=1 "); if (Number.Length > 0) { sb.Append(" and m.Number like'%" + Number + "%'"); } if (Name.Length > 0) { sb.Append(" and m.Name like'%" + Name + "%'"); } if (Recommended.Length > 0) { sb.Append(" and m.Direct like'%" + Recommended + "%'"); } if (DName.Length > 0) { sb.Append(" and d.name like'%" + DName + "%'"); } if (Placement.Length > 0) { sb.Append(" and m.Placement like'%" + Placement + "%'"); } if (PName.Length > 0) { sb.Append(" and p.name like'%" + PName + "%'"); } string totalDataStart = txtBox_OrderDateTimeStart.Text.Trim(); string totalDataEnd = txtBox_OrderDateTimeEnd.Text.Trim(); if (totalDataStart != "") { Convert.ToDateTime(totalDataStart); sb.Append(" and dateadd(hour," + sphours + ",m.advtime)>='" + totalDataStart + " 00:00:00'"); } if (totalDataEnd != "") { Convert.ToDateTime(totalDataEnd); sb.Append(" and dateadd(hour," + sphours + ",m.advtime)<='" + totalDataEnd + " 23:59:59'"); } if (sb.ToString().Contains("advtime")) { sb.Append(" and m.MemberState=1"); } if (ExpectNum > 0) { sb.Append(" and m.ExpectNum=" + ExpectNum); } ViewState["SQLSTR"] = "SELECT m.MemberState,m.Placement,p.name as PlacementName,m.Number,m.Name,m.PetName,m.StoreID,m.Direct,d.name as directName,m.ExpectNum,m.RegisterDate,m.Jackpot-m.Out as jjzh,m.Jackpot-m.Out as jjky,m.TotalRemittances-m.TotalDefray as bdzh,m.advtime FROM MemberInfo m left join Memberinfo d on m.direct=d.number left join Memberinfo p on m.placement=p.number WHERE " + sb.ToString() + " order by m.id desc"; string asg = ViewState["SQLSTR"].ToString(); Pager pager = Page.FindControl("Pager1") as Pager; pager.Pageindex = 0; pager.PageSize = 10; pager.PageTable = " MemberInfo m left join Memberinfo d on m.direct=d.number left join Memberinfo p on m.placement=p.number"; pager.Condition = sb.ToString(); pager.PageColumn = " m.MemberState,m.Placement,p.name as PlacementName,m.Number,m.Name,m.PetName,m.StoreID,m.Direct,d.name as directName,m.ExpectNum,m.RegisterDate,m.Jackpot-m.Out as jjzh,m.Jackpot-m.Out as jjky,m.TotalRemittances-m.TotalDefray as bdzh,m.advtime "; pager.ControlName = "GridView1"; pager.key = " m.ID "; pager.InitBindData = true; pager.PageBind(); Translations(); }
protected void btn_Save_Click(object sender, EventArgs e) { #region 验证用户输入 if (Request["type"] != "huifu" && txtBianhao.Text.Trim() == "" && this.RadioBianhao.Checked) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert(\"" + GetTran("001607", "请输入收件人编号") + "!!!\");</script>"); return; } if (txtTitle.Text.Trim() == "") { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("001609", "请输入标题") + "!!!');</script>"); Literal1.Text = ""; return; } if (this.content1.Value.Trim().Length.Equals(0)) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("kwl", "请输入邮件内容") + "!!!');</script>"); return; } if (this.content1.Value.Trim().Length > 4000) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000863", "您输入的信息过长") + "!!!');</script>"); return; } double from = 0; double to = 0; if (this.RadioRange.Checked && this.ChkBonus.Checked) { try { from = Convert.ToDouble(this.TxtBonusFrom.Text.Trim()); to = Convert.ToDouble(this.TxtBonusTo.Text.Trim()); } catch { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("kwl", "您输入的奖金区间无效") + "!!!');</script>"); return; } if (from >= to) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("kwl", "您输入的奖金区间无效") + "!!!');</script>"); return; } } if (this.drop_LoginRole.SelectedValue.Equals("2") && this.RadioRange.Checked && this.ChkNet.Checked) { if (this.TxtLeader.Text.Trim().Length.Equals(0)) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("kwl", "请指定团队首领编号") + "!!!');</script>"); return; } else { if (!MessageSendBLL.CheckNumber(2, this.TxtLeader.Text.Trim())) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("kwl", "指定的团队首领不存在") + "!!!');</script>"); return; } } } #endregion StringBuilder sb = new StringBuilder(); //if (Request["type"] != null) //{ if (Request["type"] == "huifu") { MessageSendModel messagesend = new MessageSendModel(); //邮件保存 messagesend.Content = this.content1.Value.Trim(); messagesend.DropFlag = 0; messagesend.InfoTitle = txtTitle.Text.Trim().Replace("<", "<").Replace(">", ">"); messagesend.LoginRole = drop_LoginRole.SelectedItem.Value; messagesend.ReadFlag = 0; messagesend.Sender = Session["Company"].ToString(); messagesend.SenderRole = "0"; messagesend.LanguageCode = this.DropDownList2.SelectedValue; messagesend.CountryCode = this.DropDownList1.SelectedValue; messagesend.MessageType = 'm'; messagesend.SetNoCondition(); int hfid; try { hfid = Convert.ToInt32(Request["hfid"]); if (hfid < 0) { return; } } catch (Exception) { return; } messagesend.ReplyFor = hfid; System.Data.SqlClient.SqlDataReader dr = DAL.DBHelper.ExecuteReader("select Sender,ClassID from MessageReceive where ID=@id", new System.Data.SqlClient.SqlParameter("@id", hfid), CommandType.Text); if (dr.Read()) { messagesend.Receive = dr["Sender"].ToString(); messagesend.MessageClassID = Convert.ToInt32(dr["ClassID"]); } else { ScriptHelper.SetAlert(Page, GetTran("001589", "对不起发件人不存在") + "!!!"); return; } if (MessageSendBLL.Addsendaffiche(messagesend)) { string href = "ManageMessage_Recive.aspx" + (Request["ClassID"] == null ? "" : "?ClassID=" + Request["ClassID"]); ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("001587", "邮件回复成功") + "!!!');location.href='" + href + "';</script>"); } else { ScriptHelper.SetAlert(Page, GetTran("001588", "邮件回复失败") + "!!!"); } } else//信息 { if (Request["Id"] != null) { int id = Convert.ToInt32(Request["Id"]); //还没改 MessageSendBLL.DelMessageSendById(id); sb.Append(GetTran("001590", "邮件修改")); } else { Response.Cache.SetExpires(DateTime.Now); Permissions.CheckManagePermission(EnumCompanyPermission.ManageMessage); sb.Append(GetTran("001592", "邮件发送")); } MessageSendModel messagesend = new MessageSendModel(); //邮件保存 messagesend.Content = this.content1.Value.Trim(); messagesend.DropFlag = 0; messagesend.InfoTitle = txtTitle.Text.Trim().Replace("<", "<").Replace(">", ">"); messagesend.LoginRole = drop_LoginRole.SelectedItem.Value; messagesend.ReadFlag = 0; messagesend.Sender = Session["Company"].ToString(); messagesend.SenderRole = "0"; messagesend.LanguageCode = this.DropDownList2.SelectedValue; messagesend.CountryCode = this.DropDownList1.SelectedValue; messagesend.Qishu = CommonDataDAL.getMaxqishu(); messagesend.MessageType = 'm'; messagesend.SetNoCondition(); if (this.RadioBianhao.Checked) //指定了编号 { if (txtBianhao.Text.Trim().Length > 0) { if (!txtBianhao.Text.Trim().Equals("*")) { //验证编号是否存在 string[] strArray = txtBianhao.Text.Trim().Split(new char[] { ',' }); foreach (string strNO in strArray) { if (strNO != "") { int id = Convert.ToInt32(drop_LoginRole.SelectedValue); //验证编号是否存在 if (!MessageSendBLL.CheckNumber(id, strNO)) { Response.Write("<script>alert('" + strNO + GetTran("001584", "不存在") + "');</script>"); return; } } } } } else { ScriptHelper.SetAlert(Page, GetTran("001594", "请输入收件人") + "!!!"); return; } messagesend.Receive = DisposeString.DisString(txtBianhao.Text.Trim()); } else //指定了Range { messagesend.Receive = "*"; //if (this.ChkLevel.Checked) //{ // messagesend.ConditionLevel = Convert.ToInt16(this.DropLevel.SelectedValue); //} if (this.ChkBonus.Checked) { messagesend.ConditionBonusFrom = Convert.ToDouble(this.TxtBonusFrom.Text.Trim()); messagesend.ConditionBonusTo = Convert.ToDouble(this.TxtBonusTo.Text.Trim()); } if (this.ChkNet.Checked) { messagesend.ConditionRelation = Convert.ToChar(this.DropRelation.SelectedValue); messagesend.ConditionLeader = this.TxtLeader.Text.Trim(); } } if (MessageSendBLL.Addsendaffiche(messagesend)) { sb.Append(GetTran("001600", "成功") + "!!!"); ScriptHelper.SetAlert(Page, sb.ToString()); } else { sb.Append(GetTran("001541", "失败") + "!!!"); ScriptHelper.SetAlert(Page, sb.ToString()); } } this.txtTitle.Text = ""; this.TextBox1.Text = ""; this.content1.Value = ""; }
protected void btnAdd_Click(object sender, EventArgs e) { int exists = 0; exists = (int)StoreRegisterBLL.IsMemberNum(this.txtNumber.Text); if (exists <= 0) { msg = "<script language='javascript'>alert('" + GetTran("000288", "对不起,该会员编号不存在") + "')</script>"; return; } if (DBHelper.ExecuteScalar("select MemberState from memberinfo where number='" + this.txtNumber.Text + "'").ToString() == "2") { msg = "<script language='javascript'>alert('" + GetTran("000284", "该会员已注销,请先激活") + "')</script>"; return; } if (StoreRegisterBLL.CheckStoreNumber(this.txtNumber.Text.Trim()) == -1) { ScriptHelper.SetAlert(Page, "该会员已经申请服务机构,不可重复申请"); return; } if (StoreRegisterBLL.CheckStoreNumber(this.txtNumber.Text.Trim()) == -2) { ScriptHelper.SetAlert(Page, "该会员已经是服务机构,不可重复申请"); return; } if (StoreRegisterConfirmBLL.CheckStoreId(DisposeString.DisString(txtStoreId.Text))) { msg = "<script language='javascript'>alert('" + GetTran("000291", "对不起,店铺编号已存在") + "')</script>"; return; } if (!StoreRegisterBLL.CheckMemberInfoByNumber(DisposeString.DisString(txtDirect.Text))) { msg = "<script language='javascript'>alert('" + GetTran("000293", "对不起,推荐店铺编号会员不存在") + "')</script>"; return; } if (this.txtRemark.Text.ToString().Length > 150) { BLL.CommonClass.Transforms.JSAlert(GetTran("006896", "对不起,备注应在150个字以内!")); return; } if (this.txtFareBreed.Text.ToString().Length > 150) { BLL.CommonClass.Transforms.JSAlert(GetTran("006896", "对不起,经营品种应在150个字以内!")); return; } GetPassword(); string str = Gettxt(); if (str != "") { msg = "<script language='javascript'>alert('" + str + "')</script>"; return; } SetUStoreInfo(); if (StoreRegisterBLL.AllerRegisterStoreInfo(ustore)) { msg = "<script language='javascript'>alert('申请成功,请等待公司审核');location.href='ShowRegStore.aspx'</script>"; } }
//绑定会员现金账户明细 private void GetShopList3(string actable) { zsf.Text = ""; DateTime time = DateTime.Now.ToUniversalTime(); bool b = true; StringBuilder condition = new StringBuilder(); string table = actable + " a left join memberinfo b on a.number=b.number "; condition.Append("1=1"); string number = ""; if (TextBox1.Text.Trim() != "") { string sql = "select number from MemberInfo where MobileTele='" + TextBox1.Text + "'"; DataTable shj = DBHelper.ExecuteDataTable(sql); if (shj.Rows.Count > 0) { number = shj.Rows[0][0].ToString(); } else { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('无此手机号,请检查后再重新输入!')</script>"); return; } condition.Append(" and MobileTele='" + TextBox1.Text + "'"); } /// condition.Append(" and sftype=0"); string BeginRiQi = ""; string EndRiQi = ""; if (this.Datepicker1.Text != "") { b = DateTime.TryParse(this.Datepicker1.Text, out time); if (!b) { Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("000827", "时间格式不正确!") + "')</script>"); return; } BeginRiQi = this.Datepicker1.Text.Trim().ToString(); DisposeString.DisString(BeginRiQi, "'", ""); if (this.Datepicker2.Text != "") { b = DateTime.TryParse(this.Datepicker2.Text, out time); if (!b) { Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("000827", "时间格式不正确!") + "')</script>"); return; } EndRiQi = (DateTime.Parse(this.Datepicker2.Text).AddHours(23).AddMinutes(59).AddSeconds(59)).ToString(); DisposeString.DisString(EndRiQi, "'", ""); condition.Append(" and happentime>= '" + BeginRiQi + "' and happentime<='" + EndRiQi + "'"); } else { condition.Append(" and happentime>= '" + BeginRiQi + "'"); } } else { if (this.Datepicker2.Text != "") { b = DateTime.TryParse(this.Datepicker2.Text, out time); if (!b) { Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("000827", "时间格式不正确!") + "')</script>"); return; } EndRiQi = (DateTime.Parse(this.Datepicker2.Text.Trim()).AddHours(23).AddMinutes(59).AddSeconds(59)).ToString(); condition.Append(" and happentime<='" + EndRiQi + "'"); } } string happenmoney = "happenmoney"; string Balancemoney = "Balancemoney"; string cloumns = " a.id,b.mobiletele,a.happentime,a.Direction,a.sftype,a.kmtype,a.remark" + "," + happenmoney + "," + Balancemoney; string key = "a.id"; ViewState["key"] = key; ViewState["PageColumn"] = cloumns; ViewState["table"] = table; ViewState["condition"] = condition.ToString(); this.GridView2.DataSourceID = null; this.Pager1.ControlName = "GridView2"; this.Pager1.key = key; this.Pager1.PageColumn = cloumns; this.Pager1.Pageindex = 0; this.Pager1.PageTable = table; this.Pager1.Condition = condition.ToString(); this.Pager1.PageSize = 10; this.Pager1.PageCount = 0; this.Pager1.PageBind(); /// Translations(); }
private void GetShopList2() { StringBuilder condition = new StringBuilder(); string table = " MemberCash W ,MemberInfo M "; condition.Append(" M.Number=w.Number "); string BeginRiQi = ""; string EndRiQi = ""; if (this.Datepicker1.Text != "") { try { DateTime time = DateTime.Parse(this.Datepicker1.Text); } catch { Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("000827", "时间格式不正确!") + "')</script>"); return; } BeginRiQi = this.Datepicker1.Text.Trim().ToString(); DisposeString.DisString(BeginRiQi, "'", ""); if (this.Datepicker2.Text != "") { try { DateTime time = DateTime.Parse(this.Datepicker2.Text); } catch { Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("000827", "时间格式不正确!") + "')</script>"); return; } EndRiQi = DateTime.Parse(this.Datepicker2.Text.Trim()).AddHours(23).AddMinutes(59).AddSeconds(59).ToString(); DisposeString.DisString(EndRiQi, "'", ""); condition.Append(" and WithdrawTime>= '" + BeginRiQi + "' and WithdrawTime<='" + EndRiQi + "'"); } else { condition.Append(" and WithdrawTime>= '" + BeginRiQi + "'"); } } else { if (this.Datepicker2.Text != "") { try { DateTime time = DateTime.Parse(this.Datepicker2.Text); } catch { Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("000827", "时间格式不正确!") + "')</script>"); return; } EndRiQi = DateTime.Parse(this.Datepicker2.Text.Trim()).AddHours(23).AddMinutes(59).AddSeconds(59).ToString(); condition.Append(" and WithdrawTime<='" + EndRiQi + "'"); } } if (this.DropDownList1.SelectedValue != "-1") { condition.Append(" and isAuditing='" + this.DropDownList1.SelectedValue.Trim() + "' "); } if (this.txtNumber.Text.Trim() != "") { condition.Append(" and w.Number like '%" + this.txtNumber.Text.Trim() + "%'"); } if (this.txtMoney.Text.Trim() != "") { try { Convert.ToDouble(this.txtMoney.Text.Trim()); } catch { Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("001094", "金额输入不正确!") + "')</script>"); return; } string fuhao = ""; switch (this.ddlType.SelectedValue) { case "0": fuhao = ">"; break; case "1": fuhao = ">="; break; case "2": fuhao = "="; break; case "3": fuhao = "<="; break; case "4": fuhao = "<"; break; default: fuhao = "="; break; } condition.Append(" and w.withdrawMoney " + fuhao + Convert.ToDouble(this.txtMoney.Text.Trim())); } string cloumns = " w.withdrawMoney-w.WithdrawSXF as withdrawMoneys,w.Number,w.isauditing,w.Id,w.withdrawsxf,w.withdrawMoney,w.WithdrawSXF,w.wyj,w.WithdrawTime,w.bankcard,w.AuditingTime,w.Remark,w.IsJL,m.name as name"; string key = " w.id "; ViewState["key"] = key; ViewState["PageColumn"] = cloumns; ViewState["table"] = table; ViewState["condition"] = condition.ToString(); this.GridView1.DataSourceID = null; this.Pager1.ControlName = "GridView1"; this.Pager1.key = key; this.Pager1.PageColumn = cloumns; this.Pager1.Pageindex = 0; this.Pager1.PageTable = table; this.Pager1.Condition = condition.ToString(); this.Pager1.PageSize = 10; this.Pager1.PageCount = 0; this.Pager1.PageBind(); translation(); }
private void SetUStoreInfo() { ustore = new UnauditedStoreInfoModel(); try { ustore.FareArea = Convert.ToDecimal(fareArea); } catch (Exception) { msg = "<script language='javascript'>alert('" + GetTran("000279", "输入的格式不对") + "')</script>"; } ustore.FareBreed = fareBreed; try { if (stouzi.Length > 0) { ustore.TotalaccountMoney = Convert.ToDecimal(stouzi); } else { ustore.TotalaccountMoney = 0; } } catch (Exception) { msg = "<script language='javascript'>alert('" + GetTran("000279", "输入的格式不对") + "')</script>"; } ustore.Number = number; ustore.StoreId = storeid; ustore.Name = Encryption.Encryption.GetEncryptionName(new AjaxClass().GetMumberName(number)); //加密店长姓名 ustore.StoreName = Encryption.Encryption.GetEncryptionName(storename); //加密店铺名称 ustore.Country = country; ustore.Province = province; ustore.City = city; ustore.CPCCode = DBHelper.ExecuteScalar("select cpccode from city where country='" + this.StoreCountry.SelectedValue.ToString() + "' and province='" + this.StoreCity.SelectedValue.ToString() + "'").ToString().Substring(0, 4); ustore.SCPCCode = CommonDataBLL.GetCityCode(country, province, city); ustore.StoreAddress = Encryption.Encryption.GetEncryptionAddress(address); //加密地址 ustore.HomeTele = Encryption.Encryption.GetEncryptionTele(homeTel); //加密家庭电话 ustore.OfficeTele = Encryption.Encryption.GetEncryptionTele(officetel); //加密办公电话 ustore.MobileTele = Encryption.Encryption.GetEncryptionTele(mobiletel); //加密电话 ustore.FaxTele = Encryption.Encryption.GetEncryptionTele(faxtel); //加密传真 ustore.BankCode = bankCode; ustore.BankCard = Encryption.Encryption.GetEncryptionCard(bankCard); //加密卡号 ustore.Email = email; ustore.NetAddress = netAddress; ustore.Remark = remark; ustore.Direct = DisposeString.DisString(txtDirect.Text); ustore.ExpectNum = CommonDataBLL.getMaxqishu(); ustore.RegisterDate = DateTime.Now.ToUniversalTime(); ustore.LoginPass = password; ustore.AdvPass = password; ustore.StoreLevelStr = storelevelstr; //ustore.FareArea = Convert.ToDecimal(fareArea); ustore.FareBreed = fareBreed; //ustore.TotalaccountMoney = 0; ustore.TotalinvestMoney = decimal.Parse(stouzi); ustore.PostalCode = postalcode; ustore.AccreditExpectNum = int.Parse(this.DropDownList1.SelectedValue); ustore.PermissionMan = ""; //ustore.Language = Convert.ToInt32(ddlLanaguage.SelectedItem.Value); //ustore.Currency = Convert.ToInt32(Currency.SelectedValue); CurrencyCode = DBHelper.ExecuteScalar("select rateid from country where countrycode='" + ustore.CPCCode.Substring(0, 2) + "'").ToString(); ustore.Currency = Convert.ToInt32(CurrencyCode); ustore.StoreLevelInt = storelevelint; ustore.StoreCity = storepriovince; ustore.StoreCountry = scountry; ustore.OperateIp = CommonDataBLL.OperateIP; ustore.OperateNum = ""; ustore.PhotoPath = photo; }
/// <summary> /// 提交 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Button1_Click(object sender, EventArgs e) { this.question.Text = question.Text.Trim(); this.money.Text = money.Text.Trim(); //设置特定值防止重复提交 hid_fangzhi.Value = "0"; if (this.rad_Deduct.SelectedValue == "") { ScriptHelper.SetAlert(Page, GetTran("007748", "请选择补扣款项")); return; } if (this.txtbh.Text != "" && this.question.Text != "" && this.money.Text != "") { string vquestion; //判断会员是否存在 string number = ""; string sql = "select number from MemberInfo where MobileTele='" + txtbh.Text + "'"; DataTable shj = DBHelper.ExecuteDataTable(sql); if (shj.Rows.Count > 0) { number = shj.Rows[0][0].ToString(); } else { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("002096", "无此编号,请检查后再重新输入") + "!')</script>"); return; } double d; if (!double.TryParse(money.Text, out d)) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("002095", "金额输入有误") + "!')</script>"); return; } if (d <= 0) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script >alert('" + GetTran("001539", "操作失败,输入的金额不能小于0") + "!')</script>"); return; } else { vquestion = this.question.Text.Trim(); DeductModel model = new DeductModel(); model.Number = DisposeString.DisString(number.Trim(), "<,>,',-", "<,>,', ", ","); model.DeductMoney = d; model.DeductReason = vquestion; model.IsDeduct = Convert.ToInt32(rad_Deduct.SelectedValue); model.Actype = Convert.ToInt32(rad_Account.SelectedValue); model.ExpectNum = CommonDataBLL.getMaxqishu(); model.OperateIP = CommonDataBLL.OperateIP; model.OperateNum = CommonDataBLL.OperateBh; try { if (DeductBLL.AddDeduct(model)) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script >alert('" + GetTran("000006", "添加成功") + "!');window.location.href='DeductBD.aspx';</script>"); } else { ClientScript.RegisterStartupScript(this.GetType(), "", "<script >alert('" + GetTran("000007", "添加失败") + "!')</script>"); } } catch (Exception) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script >alert('" + GetTran("001507", "操作失败") + "!')</script>"); } } } else { ClientScript.RegisterStartupScript(this.GetType(), "", "<script >alert('" + GetTran("002094", "所有项必填,请重新输入") + "!')</script>"); } clear(); }
/// <summary> /// 查找 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void butsele_Click(object sender, EventArgs e) { if (this.ddlItem.SelectedItem.Value == "Client" && this.txtvalue.Text.Trim().Length == 0) { getdata(null, null); } else if (this.txtvalue.Text.Trim().Length > 0) { InventoryDocModel inventory = new InventoryDocModel(); inventory.DocTypeID = QueryInStorageBLL.GetDocTypeIDEByDocTypeCode("TH"); int expectnum = -1; double totalmoney = -0; DateTime time = DateTime.Now; inventory.TotalMoney = -1; inventory.ExpectNum = -1; inventory.DocMakeTime = DateTime.Parse("0001-1-1 0:00:00"); switch (this.ddlItem.SelectedValue.Trim()) { case "Client": if (this.txtvalue.Text.Trim().Length > 0) { inventory.Client = DisposeString.DisString(this.txtvalue.Text.Trim(), "<,>,',-", "<,>,', ", ","); } //退货店铺 else { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("001063", "条件错误") + "');</script>"); return; }; break; case "ExpectNum": if (this.txtvalue.Text.Trim().Length > 0) { if (int.TryParse(this.txtvalue.Text.Trim(), out expectnum)) //期数 { inventory.ExpectNum = expectnum; } else { inventory.ExpectNum = CommonDataBLL.GetMaxqishu(); } } else { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("001063", "条件错误") + "');</script>"); return; }; break; case "TotalMoney": if (this.txtvalue.Text.Trim().Length > 0) //总价格 { if (double.TryParse(this.txtvalue.Text.Trim(), out totalmoney)) { inventory.TotalMoney = totalmoney; } else { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("001063", "条件错误") + "');</script>"); return; } } else { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("001063", "条件错误") + "');</script>"); return; }; break; case "DocMakeTime": if (this.txttime.Text.Trim().Length > 0) { if (DateTime.TryParse(this.txttime.Text.Trim(), out time)) { inventory.DocMakeTime = time.AddHours(BLL.other.Company.WordlTimeBLL.ConvertAddHours()); } } else { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("001063", "条件错误") + "');</script>"); return; }; break; //退货日期 } inventory.Flag = int.Parse(this.ddlstatu.SelectedValue); pagebind(inventory); } else { getdata(null, null); } Translations(); ViewState["FID"] = null; ViewState["Fdocid"] = null; }
/// <summary> /// 搜索按钮点击搜索事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSearch_Click(object sender, EventArgs e) { string condition = " and OrderExpectNum<" + maxExpect; string expectNum = ""; if (ExpectNum1.SelectedValue != "-1") { expectNum = " and B.OrderExpectNum=" + ExpectNum1.SelectedValue; } if (this.ddlContion.SelectedValue.IndexOf("error") > 0) { if (this.ddlcompare.SelectedValue != "all") { condition += " and B.error <> ''"; } if (this.ddlcompare.SelectedValue == " like " || this.ddlcompare.SelectedValue == " not like ") { if (txtContent.Text.Trim() != "") { condition += " and " + DisposeString.DisString(this.ddlContion.SelectedValue) + " " + ddlcompare.SelectedValue + " '%" + DisposeString.DisString(txtContent.Text) + "%'"; } } } else { if (this.ddlcompare.SelectedValue == " like " || this.ddlcompare.SelectedValue == " not like ") { if (txtContent.Text.Trim() != "") { if (ddlContion.SelectedValue == "A.Name") { condition += " and " + DisposeString.DisString(this.ddlContion.SelectedValue) + " " + ddlcompare.SelectedValue + " '%" + Encryption.Encryption.GetEncryptionName(DisposeString.DisString(txtContent.Text)) + "%'"; } else { condition += " and " + DisposeString.DisString(this.ddlContion.SelectedValue) + " " + ddlcompare.SelectedValue + " '%" + DisposeString.DisString(txtContent.Text) + "%'"; } } } else if (this.ddlcompare.SelectedValue != "all") { if (txtContent.Text.Trim() != "") { if (ddlContion.SelectedValue == "B.TotalMoney") { try { double ads = Convert.ToDouble(this.txtContent.Text.Trim()); if (ads > 9999999) { ScriptHelper.SetAlert(Page, "金额输入过大."); return; } } catch { ScriptHelper.SetAlert(Page, "金额格式输入错误."); return; } condition += " and " + DisposeString.DisString(this.ddlContion.SelectedValue) + " " + ddlcompare.SelectedValue + " " + DisposeString.DisString(txtContent.Text.Trim()); } else if (ddlContion.SelectedValue == "B.TotalPv") { try { double ads = Convert.ToDouble(this.txtContent.Text.Trim()); if (ads > 9999999) { ScriptHelper.SetAlert(Page, "积分输入过大."); return; } } catch { ScriptHelper.SetAlert(Page, "积分格式输入错误."); return; } condition += " and " + DisposeString.DisString(this.ddlContion.SelectedValue) + " " + ddlcompare.SelectedValue + " " + DisposeString.DisString(txtContent.Text.Trim()); } else { condition += " and " + DisposeString.DisString(this.ddlContion.SelectedValue) + " " + DisposeString.DisString(ddlcompare.SelectedValue) + " " + DisposeString.DisString(txtContent.Text); } } } } condition += " and B.defraystate=1"; //condition += " and " + GetNumber(); this.Pager1.PageBind(0, 10, @"[MemberInfo]as A,MemberOrder as B", "B.SendWay,A.ID,A.Number,A.StoreID,b.OrderID,B.IsReceivables,B.StoreID as OStoreID,A.Name,A.PetName,B.totalMoney,B.totalPv,B.OrderExpectNum,case B.PayExpectNum when -1 then '0' when 0 then '1' else convert(varchar,B.PayExpectNum) end as PayExpectNum,A.RegisterDate as RegisterDatec,A.Remark,B.Error as Error,B.ordertype,case when B.ordertype=0 then '0' when B.ordertype = 3 then '3' when B.ordertype = 4 then '4' else '5' end as RegisterWay , case when B.defraytype=1 then '1' when B.defraytype=2 then '2' when B.defraytype=3 then '3' when B.defraytype=4 then '4' else '5' end as defrayname,B.defraytype,B.DefrayState, case when B.DefrayState = 0 then '0' when B.DefrayState = 1 then '1' else '2' end as PayStatus ,B.isAgain ,case B.isAgain when 0 then '注册报单' when 1 then '复销报单' when 5 then '首次店铺团购' when 6 then '再次店铺团购' end as againType", " B.Number=A.Number " + expectNum + condition, " B.Id ", "gv_browOrder"); //this.excelTable = new BrowseMemberOrdersBLL().GetInfoAndOrder("[MemberInfo]as A,MemberOrder as B", "A.ID,A.Number,A.StoreID,b.OrderID,B.IsReceivables,B.StoreID as OStoreID,A.Name,A.PetName,B.totalMoney,B.totalPv,B.OrderExpectNum,case B.PayExpectNum when -1 then '0' when 0 then '1' else convert(varchar,B.PayExpectNum) end as PayExpectNum,A.RegisterDate as RegisterDatec,A.Remark,B.Error as Error,B.ordertype,case when B.ordertype=0 then '0' when B.ordertype = 3 then '3' when B.ordertype = 4 then '4' else '5' end as RegisterWay , case when B.defraytype=1 then '1' when B.defraytype=2 then '2' when B.defraytype=3 then '3' when B.defraytype=4 then '4' else '5' end as defrayname,B.defraytype,B.DefrayState, case when B.DefrayState = 0 then '0' when B.DefrayState = 1 then '1' else '2' end as PayStatus ,B.isAgain ,case B.isAgain when 0 then '注册报单' when 1 then '复销报单' when 5 then '首次店铺团购' when 6 then '再次店铺团购' end as againType", " B.Number=A.Number " + expectNum + condition, " B.Id "); ViewState["excelTable"] = "Select Case B.SendWay When 0 Then '0' Else '1' End As SendWay,A.ID,A.Number,A.StoreID,b.OrderID,B.IsReceivables,B.StoreID as OStoreID,A.Name,A.PetName,B.totalMoney,B.totalPv,B.OrderExpectNum,case B.PayExpectNum when -1 then '0' when 0 then '1' else convert(varchar,B.PayExpectNum) end as PayExpectNum,A.RegisterDate as RegisterDatec,A.Remark,B.Error as Error,B.ordertype,case when B.ordertype=0 then '0' when B.ordertype = 3 then '3' when B.ordertype = 4 then '4' else '5' end as RegisterWay , case when B.defraytype=1 then '1' when B.defraytype=2 then '2' when B.defraytype=3 then '3' when B.defraytype=4 then '4' else '5' end as defrayname,B.defraytype,B.DefrayState, case when B.DefrayState = 0 then '0' when B.DefrayState = 1 then '1' else '2' end as PayStatus ,B.isAgain ,case B.isAgain when 0 then '注册报单' when 1 then '复销报单' when 5 then '首次店铺团购' when 6 then '再次店铺团购' end as againType From [MemberInfo]as A,MemberOrder as B Where B.Number=A.Number" + expectNum + condition + " Order By B.Id Desc"; this.Pager1.Visible = true; string str = GetZJE(" " + expectNum + condition); if (str != ",") { try { lab_cjezj.Text = str.Split(',')[0]; lab_cjfzj.Text = str.Split(',')[1]; } catch { lab_cjezj.Text = "未知"; lab_cjfzj.Text = "未知"; } } Translate(); }
protected void btnEndit_Click(object sender, EventArgs e) { #region /* ********************** * if (this.txtNewStoreID.Text.ToString().Length > 0) * { * if (StoreRegisterConfirmBLL.CheckStoreId(DisposeString.DisString(txtNewStoreID.Text.Trim()))) * { * if (Convert.ToInt32(rdofangshi.SelectedValue) == 1) * { * string memberid = DisposeString.DisString(txtstoreId.Text.Trim()); * string newStoreid = DisposeString.DisString(txtNewStoreID.Text.Trim()); * string oldStoreid = DisposeString.DisString(lblOldStoreID.Text.Trim()); * int flag = Convert.ToInt32(this.rdofangshi.SelectedValue); * int ex = CommonDataBLL.getMaxqishu(); * if (OwnerStoreResetBLL.MemberStoreReset(memberid, newStoreid, oldStoreid, flag, ex)) * { * this.msg = "<script language='javascript'>alert('修改成功!!!')</script>"; * btnSearch_Click(null, null); * this.txtNewStoreID.Text = ""; * } * else * { * this.msg = "<script language='javascript'>alert('修改失败!!!')</script>"; * } * } * else * { * string memberid = DisposeString.DisString(txtstoreId.Text.Trim()); * string newStoreid = DisposeString.DisString(txtNewStoreID.Text.Trim()); * string oldStoreid = DisposeString.DisString(lblOldStoreID.Text.Trim()); * int flag = Convert.ToInt32(this.rdofangshi.SelectedValue); * int ex = CommonDataBLL.getMaxqishu(); * if (OwnerStoreResetBLL.MemberStoreReset2(memberid, newStoreid, oldStoreid, flag, ex)) * { * this.msg = "<script language='javascript'>alert('修改成功!!!')</script>"; * btnSearch_Click(null, null); * this.txtNewStoreID.Text = ""; * } * else * { * this.msg = "<script language='javascript'>alert('修改失败!!!')</script>"; * } * } * } * else * { * this.msg = "<script language='javascript'>alert('对不起,新店铺不存在!!!')</script>"; * } * } * else * { * this.msg = "<script language='javascript'>alert('请输入新店铺编号!!!')</script>"; * } */ #endregion if (this.txtNewStoreID.Text.ToString().Length > 0) { if (StoreRegisterConfirmBLL.CheckStoreId(DisposeString.DisString(txtNewStoreID.Text.Trim()))) { string InUP_Sql = ""; string memberid = DisposeString.DisString(txtstoreId.Text.Trim()); string newStoreid = DisposeString.DisString(txtNewStoreID.Text.Trim()); string oldStoreid = DisposeString.DisString(lblOldStoreID.Text.Trim()); int flag = Convert.ToInt32(this.rdofangshi.SelectedValue); int expectnum = CommonDataBLL.getMaxqishu(); DateTime time = DateTime.Now; string RiQi = time.ToString(); int isMod = Convert.ToInt32(DBHelper.ExecuteScalar("select count(*) from updatestore where flag=1 and expectnum=" + expectnum + " and number='" + memberid + "'")); //int isMod1 = Convert.ToInt32(DBHelper.ExecuteScalar("select count(*) from updatestore where flag=2 and expectnum=" + expectnum + " and number='" + memberid + "'")); DataTable dt_one = DAL.DBHelper.ExecuteDataTable("select StoreState from StoreInfo where StoreID='" + txtNewStoreID.Text + "'"); string StoreState = dt_one.Rows[0]["StoreState"].ToString();//汇款id if (StoreState == "0") { msg = "<script>alert('该服务机构未激活,无法重置!');</script>"; return; } using (SqlConnection conn = new SqlConnection(DAL.DBHelper.connString)) { conn.Open(); SqlTransaction tran = conn.BeginTransaction(); try { if (flag == 1) { string upSql = "update memberinfo set storeid='" + this.txtNewStoreID.Text.Trim() + "' where number='" + memberid + "'"; if (isMod == 0) { InUP_Sql = @"insert into updatestore(number,OldStoreID,NewStoreID,expectnum,flag,UpdDate) values('" + memberid + "','" + oldStoreid + "','" + newStoreid + "'," + expectnum + ",1,'" + RiQi + "')"; } else { InUP_Sql = "update updatestore set OldStoreID='" + oldStoreid + "',NewStoreID='" + newStoreid + "',flag=1 where Number='" + memberid + "' and expectnum=" + expectnum; } // BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("storeinfo", "(ltrim(rtrim(id)))"); // cl_h_info.AddRecord(ID); DBHelper.ExecuteNonQuery(tran, upSql, null, CommandType.Text); DBHelper.ExecuteNonQuery(tran, InUP_Sql, null, CommandType.Text); // cl_h_info.ModifiedIntoLogs(BLL.CommonClass.ChangeCategory.Store, Session["Company"].ToString(), BLL.CommonClass.ENUM_USERTYPE.Company); } else { if (isMod == 0) { InUP_Sql = @"insert into updatestore(number,OldStoreID,NewStoreID,expectnum,flag,UpdDate) values('" + memberid + "','" + oldStoreid + "','" + newStoreid + "'," + expectnum + ",2,'" + RiQi + "')"; } else { InUP_Sql = "update updatestore set OldStoreID='" + oldStoreid + "',NewStoreID='" + newStoreid + "',flag=2 where Number='" + memberid + "' and expectnum=" + expectnum; } SqlParameter[] parm = { new SqlParameter("@bianhao", SqlDbType.VarChar, 20), new SqlParameter("@storeid", SqlDbType.VarChar, 20) }; parm[0].Value = memberid; parm[1].Value = newStoreid; DBHelper.ExecuteNonQuery(tran, InUP_Sql, null, CommandType.Text); DBHelper.ExecuteNonQuery(tran, "UpdateMemberStoreid", parm, CommandType.StoredProcedure); } tran.Commit(); msg = "<script>alert('" + GetTran("001024", "更改成功!") + "')</script>"; this.lblOldStoreID.Text = this.txtNewStoreID.Text.ToString(); this.txtNewStoreID.Text = ""; } catch { tran.Rollback(); throw; } finally { conn.Close(); } } } else { msg = "<script>alert('" + GetTran("001027", "新的所属店铺编号不存在!") + "')</script>"; } } else { this.msg = "<script language='javascript'>alert('" + GetTran("001030", "请输入新店铺编号!") + "')</script>"; } }
protected void btnOk_Click(object sender, EventArgs e) { string number = this.labBh.Text; string placement = SearchPlacement_DoubleLines1.Placement; string direct = DisposeString.DisString(this.txtDirect.Text, "'", "").Trim(); string oldplacement = ViewState["placement"].ToString(); string olddirect = ViewState["direct"].ToString(); string storeid = ViewState["storeid"].ToString(); if (placement == "" || direct == "") { lblmessage.Text = GetTran("000716", "推荐编号或安置编号都不能为空!"); return; } if (ChangeTeamBLL.CheckNum(direct)) { lblmessage.Text = GetTran("000717", "推荐编号不存在!"); return; } if (ChangeTeamBLL.CheckNum(placement)) { lblmessage.Text = GetTran("000718", "安置编号不存在!"); return; } string topMemberId = BLL.CommonClass.CommonDataBLL.getManageID(3); int district = Convert.ToInt32(ViewState["district"]);; if (placement != topMemberId) { int flag_xiou = ChangeTeamBLL.GetPlacementCount(placement, number); if (flag_xiou >= 2) { ScriptHelper.SetAlert(Page, GetTran("000000", "此安置编号下已经安置了两个人!")); return; } if (DBHelper.ExecuteScalar("select count(0) from memberinfo where placement='" + placement + "' and District=" + direct + "").ToString() != "0") { district = AddOrderDataDAL.GetDistrict(placement, 1); if (district == 1) { if (DBHelper.ExecuteScalar("select count(0) from memberinfo where placement='" + placement + "' and District=2").ToString() != "0") { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("000000", "安置人所选区位已有人安置!") + "');</script>", false); return; } } else if (district == 2) { if (DBHelper.ExecuteScalar("select count(0) from memberinfo where placement='" + placement + "' and District=1").ToString() != "0") { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("000000", "安置人所选区位已有人安置!") + "');</script>", false); return; } } else { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("000000", "安置人所选区位已有人安置!") + "');</script>", false); return; } } RegistermemberBLL registermemberBLL = new RegistermemberBLL(); string CheckMember = registermemberBLL.CheckMemberInProc(number, placement, direct, storeid); CheckMember = new GroupRegisterBLL().GerCheckErrorInfo(CheckMember); if (CheckMember != null) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + CheckMember + "');</script>", false); return; } string p_info = registermemberBLL.GetHavePlacedOrDriect(number, "", placement, direct); if (p_info != null) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + p_info + "');</script>", false); return; } //判断该编号是否有安置,推荐 string GetError = registermemberBLL.GetError(direct, placement); if (GetError != null) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetError + "');</script>", false); return; } string GetError1 = new AjaxClass().CheckNumberNetAn(direct, placement); if (GetError1 != null && GetError1 != "") { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("005986", "安置编号必须在推荐编号的安置网络下面!") + "');</script>", false); return; } #region 安置推荐人必须要激活 if (Convert.ToInt32(DAL.DBHelper.ExecuteScalar("select COUNT(0) from MemberInfo where MemberState=1 and Number='" + direct + "'")) == 0) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("000000", "招商编号未激活!") + "');</script>", false); return; } if (Convert.ToInt32(DAL.DBHelper.ExecuteScalar("select COUNT(0) from MemberInfo where MemberState=1 and Number='" + placement + "'")) == 0) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("000000", "互助编号未激活!") + "');</script>", false); return; } #endregion } bool ispass = false; if (ViewState["placement"].ToString() != placement || ViewState["direct"].ToString() != direct) { Application.Lock(); string msg = ChangeTeamBLL.UpdateNet(number, placement, direct, oldplacement, olddirect, district, ChangeTeamBLL.GetFlag(number), out ispass); Application.UnLock(); ScriptHelper.SetAlert(Page, msg); } else { ScriptHelper.SetAlert(Page, this.GetTran("000000", "推荐、安置人编号未变化!")); } }
public void getMemberInfo() { string Number = DisposeString.DisString(this.Number.Text.Trim()); //去空格后赋值 string Name = Encryption.Encryption.GetEncryptionName(DisposeString.DisString(this.Name.Text.Trim())); string Recommended = DisposeString.DisString(this.Recommended.Text.Trim()); string DName = DisposeString.DisString(this.DName.Text.Trim()); string PName = DisposeString.DisString(this.Name.Text.Trim()); int ExpectNum = 0; if (this.DropDownExpectNum.SelectedValue.ToString() == "") { ExpectNum = 0; } else { ExpectNum = Convert.ToInt32(this.DropDownExpectNum.SelectedItem.Value); } StringBuilder sb = new StringBuilder(); sb.Append(" 1=1 "); if (Number.Length > 0) { sb.Append(" and m.mobiletele like'%" + Number + "%'"); } if (Name.Length > 0) { sb.Append(" and m.Name like'%" + Name + "%'"); } if (Recommended.Length > 0) { sb.Append(" and m.Direct like'%" + Recommended + "%'"); } if (DName.Length > 0) { sb.Append(" and d.name like'%" + DName + "%'"); } //if (Placement.Length > 0) //{ // sb.Append(" and m.Placement like'%" + Placement + "%'"); //} if (PName.Length > 0) { sb.Append(" and p.name like'%" + PName + "%'"); } if (ddl_zxState.SelectedValue != "-1") { sb.Append(" and m.MemberState=" + ddl_zxState.SelectedValue); } if (type == 0) { if (ExpectNum > 0) { sb.Append(" and m.ExpectNum=" + ExpectNum); } } //首页传过来时候读取当日的会员 if (type == 1) { if (Request.QueryString["dd"] != null && Request.QueryString["dd"] != "") { sb.Append(" and Convert(varchar,m.RegisterDate,23) ='" + Request.QueryString["dd"].ToString() + "'"); } } string totalDataStart = txtBox_OrderDateTimeStart.Text.Trim(); string totalDataEnd = txtBox_OrderDateTimeEnd.Text.Trim(); if (totalDataStart != "") { Convert.ToDateTime(totalDataStart); sb.Append(" and dateadd(hour," + sphours + ",m.RegisterDate)>='" + totalDataStart + " 00:00:00'"); } if (totalDataEnd != "") { Convert.ToDateTime(totalDataEnd); sb.Append(" and dateadd(hour," + sphours + ",m.RegisterDate)<='" + totalDataEnd + " 23:59:59'"); } //string advtimeStart = txtBox_AdvTimeStart.Text.Trim(); //string advtimeEnd = txtBox_AdvTimeEnd.Text.Trim(); //if (advtimeStart != "") //{ // Convert.ToDateTime(advtimeStart); // sb.Append(" and dateadd(hour," + sphours + ",m.ActiveDate)>='" + advtimeStart + " 00:00:00'"); //} //if (advtimeEnd != "") //{ // Convert.ToDateTime(advtimeEnd); // sb.Append(" and dateadd(hour," + sphours + ",m.ActiveDate)<='" + advtimeEnd + " 23:59:59'"); //} if (sb.ToString().Contains("ActiveDate")) { sb.Append(" and m.MemberState=1"); } ViewState["SQLSTR"] = "SELECT m.MemberState, m.Number,m.Name , d.mobiletele dtele, m.Direct,d.name as directName,m.ExpectNum,m.RegisterDate,m.ActiveDate,(select top 1 PayMoney from MemberOrder where Number=m.Number) as zcPrice FROM MemberInfo m left join Memberinfo d on m.direct=d.number WHERE " + sb.ToString() + " order by m.id desc"; Pager pager = Page.FindControl("Pager1") as Pager; //pager.Pageindex = 0; //pager.PageSize = 10; //pager.PageTable = "MemberInfo"; //pager.Condition = sb.ToString(); //pager.PageColumn = "*"; //pager.ControlName = "GridView1"; //pager.key = "ID"; pager.PageBind(0, 10, " MemberInfo m left join Memberinfo d on m.direct=d.number ", "m.MemberState, m.number,m.mobiletele,m.Name , d.mobiletele dtele,m.Direct,d.name as directName,m.ExpectNum,m.RegisterDate,m.ActiveDate,(select top 1 PayMoney from MemberOrder where Number=m.Number) as zcPrice", sb.ToString(), "m.ID", "GridView1"); ViewState["condition"] = sb.ToString(); Translations(); }
//绑定会员汇款 private void GetShopList2() { StringBuilder condition = new StringBuilder(); string table = " StoreAccount "; condition.Append(" 1=1 "); if (this.TxtBh.Text.Trim() != "") { condition.Append(" and Number='" + this.TxtBh.Text.Trim() + "'"); } //condition.Append(" and sftype=" + (int)D_AccountSftype.StoreType + ""); string BeginRiQi = ""; string EndRiQi = ""; if (this.Datepicker1.Text != "") { DateTime time1 = DateTime.Now.ToUniversalTime(); bool bb = DateTime.TryParse(this.Datepicker2.Text, out time1); if (!bb) { Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("000827", "时间格式不正确!") + "')</script>"); return; } BeginRiQi = this.Datepicker1.Text.Trim().ToString(); DisposeString.DisString(BeginRiQi, "'", ""); if (this.Datepicker2.Text != "") { DateTime time = DateTime.Now.ToUniversalTime(); bool b = DateTime.TryParse(this.Datepicker2.Text, out time); if (!b) { Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("000827", "时间格式不正确!") + "')</script>"); return; } EndRiQi = (DateTime.Parse(this.Datepicker2.Text).AddHours(23).AddMinutes(59).AddSeconds(59)).ToString(); DisposeString.DisString(EndRiQi, "'", ""); condition.Append(" and happentime>= '" + BeginRiQi + "' and happentime<='" + EndRiQi + "'"); } else { condition.Append(" and happentime>= '" + BeginRiQi + "'"); } } else { if (this.Datepicker2.Text != "") { DateTime time = DateTime.Now.ToUniversalTime(); bool b = DateTime.TryParse(this.Datepicker2.Text, out time); if (!b) { Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("000827", "时间格式不正确!") + "')</script>"); return; } EndRiQi = (DateTime.Parse(this.Datepicker2.Text.Trim()).AddHours(23).AddMinutes(59).AddSeconds(59)).ToString(); condition.Append(" and happentime<='" + EndRiQi + "'"); } } string happenmoney = "happenmoney"; string Balancemoney = "Balancemoney"; string cloumns = "id,number,happentime,Direction,sftype,kmtype,remark" + "," + happenmoney + "," + Balancemoney; string key = "id"; ViewState["key"] = key; ViewState["PageColumn"] = cloumns; ViewState["table"] = table; ViewState["condition"] = condition.ToString(); this.GridView2.DataSourceID = null; this.Pager1.ControlName = "GridView2"; this.Pager1.key = key; this.Pager1.PageColumn = cloumns; this.Pager1.Pageindex = 0; this.Pager1.PageTable = table; this.Pager1.Condition = condition.ToString(); this.Pager1.PageSize = 10; this.Pager1.PageCount = 0; this.Pager1.PageBind(); Translations(); }