Exemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         string    sqlf = "select xuhao,Pwd,type,states,contents from messageset where type = 'sms'";
         DataTable dt   = this.bc.ReadTable(sqlf);
         if (dt.Rows.Count > 0)
         {
             StringBuilder balance   = new StringBuilder("0000000000");
             int           result    = EUCPComm.GetBalance(dt.Rows[0]["xuhao"].ToString(), balance);
             string        _Response = "";
             string        mybalance = balance.ToString(0, balance.Length);
             if (result == 1)
             {
                 _Response = mybalance;
             }
             base.Response.Write(dt.Rows[0]["xuhao"].ToString() + "&" + dt.Rows[0]["Pwd"].ToString() + "&" + dt.Rows[0]["states"].ToString() + "&" + _Response + "&" + dt.Rows[0]["contents"].ToString());
         }
         else
         {
             base.Response.Write("false");
         }
     }
     catch
     {
         base.Response.Write("false");
     }
 }
Exemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string mnum   = base.Request.QueryString["mnum"].ToString();
        string chong  = base.Request.QueryString["chong"].ToString();
        string give   = base.Request.QueryString["give"].ToString();
        string heji   = base.Request.QueryString["heji"].ToString();
        string remark = base.Server.UrlDecode(base.Request.QueryString["remark"].ToString());
        string name   = base.Server.UrlDecode(base.Request.QueryString["name"].ToString());

        try
        {
            string    sqlf = "select * from membersinfo where  mNum ='" + base.Request.QueryString["mnum"].ToString() + "'";
            DataTable dt   = this.bc.ReadTable(sqlf);
            if (dt.Rows.Count > 0)
            {
                string cnum  = "CZ" + DateTime.Now.ToString("yyyyMMddHHmmss");
                double yue   = double.Parse(heji) + double.Parse(dt.Rows[0]["mBalance"].ToString());
                object name9 = string.Concat(new object[] {
                    "insert into memberchong(cNum,cType,cDate,cChongMoney,cMake,cShopnum,cRemark,cYue,cGive,cmNum,cmName) values('", cnum, "','会员充值','", DateTime.Now.ToString(), "','", chong, "','", PublicMethod.GetSessionValue("username"), "','", PublicMethod.GetSessionValue("shopnum"), "','", remark, "','", yue, "','", give,
                    "','", mnum, "','", name, "')"
                });
                string sqlin = string.Concat(new object[] { name9, "update membersinfo set mBalance ='", yue, "' where mNum = '", base.Request.QueryString["mnum"].ToString(), "' " });
                this.bc.execsql(sqlin);
                string    sqlsms = "select xuhao,Pwd,type,states,contents from messageset where type = 'sms'";
                DataTable dtsms  = this.bc.ReadTable(sqlsms);
                if (dtsms.Rows[0]["states"].ToString() == "1")
                {
                    StringBuilder balance   = new StringBuilder("0000000000");
                    int           result    = EUCPComm.GetBalance(dtsms.Rows[0]["xuhao"].ToString(), balance);
                    string        _Response = "";
                    string        mybalance = balance.ToString(0, balance.Length - 2);
                    if (result == 1)
                    {
                        _Response = mybalance;
                    }
                    if (int.Parse(_Response) > 1)
                    {
                        string sms = string.Concat(new object[] { "尊敬的", dt.Rows[0]["mName"].ToString(), ",您于", DateTime.Now.ToString("yyyy-MM-dd HH:mm"), "在店面", PublicMethod.GetSessionValue("shopname"), "充值", chong, "元,赠送", give, "元,卡内余额", yue, "元。", dtsms.Rows[0]["contents"].ToString() });
                        EUCPComm.SendSMS(dtsms.Rows[0]["xuhao"].ToString(), dt.Rows[0]["mMobile"].ToString(), sms, "");
                    }
                }
                base.Response.Write("true");
            }
            else
            {
                base.Response.Write("false");
            }
        }
        catch
        {
            base.Response.Write("false");
        }
    }
Exemplo n.º 3
0
    protected void Button2_Click(object sender, EventArgs e)
    {
        string    lNblance = "0";
        string    lNjifen  = "0";
        string    paymo    = "0";
        double    give     = 0.0;
        string    sqfl     = "select lNblance,lNjifen,lBuyprice from memberlevel where lNum ='" + this.ddllevel.SelectedValue + "'";
        DataTable dtl      = this.bc.ReadTable(sqfl);

        if (dtl.Rows.Count > 0)
        {
            lNblance = dtl.Rows[0]["lNblance"].ToString();
            lNjifen  = dtl.Rows[0]["lNjifen"].ToString();
            paymo    = dtl.Rows[0]["lBuyprice"].ToString();
            give     = double.Parse(lNblance) - double.Parse(paymo);
        }
        string[] addre  = this.txtadd.Value.Split(new char[] { ',' });
        string   sqladd = "insert into membersinfo(mNum,mName,mLevel,mSex,mPwd,mNoId,mBirth,mMobile,mQQ,mWeChat,mEmail,mProvince,mCity,mTown,mAddress,mMakecard,mMakedate,mPastdate,mShopNum,mRemark,mBalance,mIntegral,mStates,mType,mTuiJian,mTuiJIanName) values";
        string   name2  = sqladd;

        sqladd = name2 + "('" + this.txtmNum.Value + "','" + this.txtname.Value + "','" + this.ddllevel.SelectedValue + "','" + this.ddlsex.Text + "','" + DESEncrypt.Encrypt(this.txtPasswords.Value) + "','" + this.txtnoid.Value + "','" + this.txtbirth.Value + "','" + this.txtmobile.Value + "','" + this.txtqq.Value + "','" + this.txtwechat.Value + "','" + this.txtemail.Value + "','" + addre[0] + "','" + addre[1] + "','" + addre[2] + "','" + this.txtaddress.Value + "','" + this.ddlmakecard.SelectedValue + "','" + DateTime.Now.ToString() + "','" + this.txtpastdate.Value + "','" + PublicMethod.GetSessionValue("shopnum") + "','" + this.txtremark.Text + "','" + lNblance + "','" + lNjifen + "','0','会员卡','" + this.txttuijian.Value + "','" + this.txttuijianname.Value + "')";
        this.bc.execsql(sqladd);
        string cnum  = "CZ" + DateTime.Now.ToString("yyyyMMddHHmmss");
        string sqlin = string.Concat(new object[] {
            "insert into memberchong(cNum,cType,cDate,cChongMoney,cMake,cShopnum,cRemark,cYue,cGive,cmNum) values('", cnum, "','会员发卡','", DateTime.Now.ToString(), "','", paymo, "','", PublicMethod.GetSessionValue("username"), "','", PublicMethod.GetSessionValue("shopnum"), "','会员发卡初始金额','", lNblance, "','", give, "','", this.txtmNum.Value,
            "')"
        });

        this.bc.execsql(sqlin);
        string    sqlsms = "select xuhao,Pwd,type,states from messageset where type = 'sms'";
        DataTable dtsms  = this.bc.ReadTable(sqlsms);

        if (dtsms.Rows[0]["states"].ToString() == "1")
        {
            StringBuilder balance   = new StringBuilder("0000000000");
            int           result    = EUCPComm.GetBalance(dtsms.Rows[0]["xuhao"].ToString(), balance);
            string        _Response = "";
            string        mybalance = balance.ToString(0, balance.Length - 2);
            if (result == 1)
            {
                _Response = mybalance;
            }
            if (int.Parse(_Response) > 1)
            {
                string sms = "尊敬的" + this.txtname.Value + this.ddlsex.Text + ",您于" + DateTime.Now.ToString("yyyy-MM-dd HH:mm") + "在店面[" + PublicMethod.GetSessionValue("shopname") + "]成功注册成为幸福一方的会员,会员卡密码:" + this.txtPasswords.Value + ",请保管好,谢谢!客服:22682888【幸福一方】";
                EUCPComm.SendSMS(dtsms.Rows[0]["xuhao"].ToString(), this.txtmobile.Value, sms, "");
            }
        }
        base.ClientScript.RegisterStartupScript(base.ClientScript.GetType(), "myscript", "<script>  $.ligerDialog.confirm('保存成功,是否马上充值?',function(type) {if (type)chongzhi('" + this.txtmNum.Value + "');});</script>");
    }
Exemplo n.º 4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         string    cnum  = "YH" + DateTime.Now.ToString("yyyyMMddHHmmssffff");
         string    mnum  = base.Request.QueryString["mnum"].ToString();
         string    jifen = base.Request.QueryString["jifen"].ToString();
         string    gid   = base.Request.QueryString["gid"].ToString();
         string    sqlft = "select * from membersinfo where  mNum ='" + base.Request.QueryString["mnum"].ToString() + "'";
         DataTable dt    = this.bc.ReadTable(sqlft);
         if (dt.Rows.Count > 0)
         {
             double jifens = double.Parse(dt.Rows[0]["mIntegral"].ToString()) - double.Parse(base.Request.QueryString["jifen"]);
             string name9  = "update  membersinfo set  mIntegral=convert(decimal(18, 0),mIntegral)-" + jifen + " where mNum ='" + base.Request.QueryString["mnum"].ToString() + "' ";
             string sqlf   = (name9 + "insert into prsentchange(cNum,cMnum,cGnum,cShopname,cDate,cMaker,jifen) values('" + cnum + "','" + mnum + "','" + gid + "','" + PublicMethod.GetSessionValue("shopname") + "','" + DateTime.Now.ToString("yyyy-MM-dd") + "','" + PublicMethod.GetSessionValue("names") + "','" + jifen + "')") + " update present set gCount=gCount-1 where gNum='" + gid + "' ";
             this.bc.execsql(sqlf);
             string    sqlsms = "select xuhao,Pwd,type,states,contents from messageset where type = 'sms'";
             DataTable dtsms  = this.bc.ReadTable(sqlsms);
             if (dtsms.Rows[0]["states"].ToString() == "1")
             {
                 StringBuilder balance   = new StringBuilder("0000000000");
                 int           result    = EUCPComm.GetBalance(dtsms.Rows[0]["xuhao"].ToString(), balance);
                 string        _Response = "";
                 string        mybalance = balance.ToString(0, balance.Length - 2);
                 if (result == 1)
                 {
                     _Response = mybalance;
                 }
                 if (int.Parse(_Response) > 1)
                 {
                     string sms = string.Concat(new object[] { "尊敬的", dt.Rows[0]["mName"].ToString(), dt.Rows[0]["mSex"].ToString(), ",您于", DateTime.Now.ToString("yyyy-MM-dd HH:mm"), "在店面[", PublicMethod.GetSessionValue("shopname"), "]兑换礼品,扣除积分", base.Request.QueryString["jifen"], ",剩余积分为", jifens, ",谢谢惠顾!", dtsms.Rows[0]["contents"].ToString() });
                     EUCPComm.SendSMS(dtsms.Rows[0]["xuhao"].ToString(), dt.Rows[0]["mMobile"].ToString(), sms, "");
                 }
             }
             base.Response.Write("true");
         }
         else
         {
             base.Response.Write("false");
         }
     }
     catch
     {
         base.Response.Write("false");
     }
 }
Exemplo n.º 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        DataTable dt;
        string    name11;

        if (base.Request.QueryString["Type"] == "load")
        {
            try
            {
                dt = PublicMethod.QueryDataset("select Id from TemporaryCard where C_Id='" + base.Request.QueryString["Id"] + "'").Tables[0];
                if (dt.Rows.Count > 0)
                {
                    base.Response.Write("临时卡@");
                }
                else
                {
                    string    strsp;
                    DataTable dtLevel;
                    DataTable dtMbr = PublicMethod.QueryDataset("select mNum,mLevel,mName,mBalance,convert(varchar(100), mPastdate,23) as 'mPastdate',mType,mPwd,mIntegral,mStates from membersinfo where mNum='" + base.Request.QueryString["Id"] + "'").Tables[0];
                    if (dtMbr.Rows.Count > 0)
                    {
                        if (dtMbr.Rows[0]["mStates"].ToString() == "0")
                        {
                            if ((dtMbr.Rows[0]["mPastdate"].ToString() == "永久有效") || (DateTime.Parse(dtMbr.Rows[0]["mPastdate"].ToString()) > DateTime.Now))
                            {
                                strsp   = dtMbr.Rows[0]["mType"].ToString() + "@" + dtMbr.Rows[0]["mLevel"].ToString() + "@" + dtMbr.Rows[0]["mName"].ToString() + "@" + dtMbr.Rows[0]["mBalance"].ToString() + "@" + dtMbr.Rows[0]["mPastdate"].ToString() + "@" + dtMbr.Rows[0]["mNum"].ToString() + "@" + DESEncrypt.Decrypt(dtMbr.Rows[0]["mPwd"].ToString()) + "@" + dtMbr.Rows[0]["mIntegral"].ToString();
                                dtLevel = PublicMethod.QueryDataset("select lName,lDiscount,ljifen from memberlevel where lNum='" + dtMbr.Rows[0]["mLevel"].ToString() + "'").Tables[0];
                                if (dtLevel.Rows.Count > 0)
                                {
                                    name11 = strsp;
                                    strsp  = name11 + "@" + dtLevel.Rows[0]["lName"].ToString() + "@" + dtLevel.Rows[0]["lDiscount"].ToString() + "@" + dtLevel.Rows[0]["ljifen"].ToString();
                                }
                                base.Response.Write(strsp);
                            }
                            else
                            {
                                base.Response.Write("过期@");
                            }
                        }
                        else
                        {
                            base.Response.Write("挂失@");
                        }
                    }
                    else
                    {
                        DataTable dtMbrs = PublicMethod.QueryDataset("select mNum,mLevel,mName,mBalance,convert(varchar(100), mPastdate,23) as 'mPastdate',mType,mPwd,mIntegral,mStates,mMobile from membersinfo where mMobile='" + base.Request.QueryString["Id"] + "'").Tables[0];
                        if (dtMbrs.Rows.Count > 0)
                        {
                            if (dtMbrs.Rows[0]["mStates"].ToString() == "0")
                            {
                                if ((dtMbrs.Rows[0]["mPastdate"].ToString() == "永久有效") || (DateTime.Parse(dtMbrs.Rows[0]["mPastdate"].ToString()) > DateTime.Now))
                                {
                                    strsp   = dtMbrs.Rows[0]["mType"].ToString() + "@" + dtMbrs.Rows[0]["mLevel"].ToString() + "@" + dtMbrs.Rows[0]["mName"].ToString() + "@" + dtMbrs.Rows[0]["mBalance"].ToString() + "@" + dtMbrs.Rows[0]["mPastdate"].ToString() + "@" + dtMbrs.Rows[0]["mNum"].ToString() + "@" + DESEncrypt.Decrypt(dtMbrs.Rows[0]["mPwd"].ToString()) + "@" + dtMbrs.Rows[0]["mIntegral"].ToString();
                                    dtLevel = PublicMethod.QueryDataset("select lName,lDiscount,ljifen from memberlevel where lNum='" + dtMbrs.Rows[0]["mLevel"].ToString() + "'").Tables[0];
                                    if (dtLevel.Rows.Count > 0)
                                    {
                                        name11 = strsp;
                                        strsp  = name11 + "@" + dtLevel.Rows[0]["lName"].ToString() + "@" + dtLevel.Rows[0]["lDiscount"].ToString() + "@" + dtLevel.Rows[0]["ljifen"].ToString();
                                    }
                                    base.Response.Write(strsp);
                                }
                                else
                                {
                                    base.Response.Write("过期@");
                                }
                            }
                            else
                            {
                                base.Response.Write("挂失@");
                            }
                        }
                        else
                        {
                            base.Response.Write("不存在@");
                        }
                    }
                }
            }
            catch
            {
            }
        }
        else if (base.Request.QueryString["Type"] == "sub")
        {
            DataTable     dtPwd;
            string        sqlf;
            double        jifen;
            string        C_Id;
            string        str;
            string        sqlsms;
            DataTable     dtsms;
            StringBuilder balance;
            int           result;
            string        _Response;
            string        mybalance;
            string        sms;
            object        name12;
            if ((base.Request.QueryString["CardType"] != "临时卡") && (base.Request.QueryString["PayType"] == "储值支付"))
            {
                dtPwd = PublicMethod.QueryDataset("select mNum from membersinfo where mNum='" + base.Request.QueryString["Id"] + "' and mPwd='" + DESEncrypt.Encrypt(base.Request.QueryString["pwd"]) + "'").Tables[0];
                if (dtPwd.Rows.Count > 0)
                {
                    sqlf = "select * from membersinfo where  mNum ='" + base.Request.QueryString["Id"].ToString() + "'";
                    dt   = this.bc.ReadTable(sqlf);
                    if (dt.Rows.Count > 0)
                    {
                        jifen  = double.Parse(base.Request.QueryString["JiFen"]) + double.Parse(dt.Rows[0]["mIntegral"].ToString());
                        C_Id   = "XF" + DateTime.Now.ToString("yyyyMMddHHmmssffff");
                        str    = " insert into Consumption_Back_select (C_Id,Card_Id,Type,Addtime,Users,Remark,Shop,ShopId,Money,PayType,Consum_Type,ClientName,CardType,BlancePay,CashPay,BankPay,JifenPay,ElsePay,hjifen) values (";
                        name12 = str;
                        name12 = string.Concat(new object[] { name12, "'", C_Id, "','", base.Request.QueryString["Id"], "','快速消费','", DateTime.Now.ToString(), "','", HttpContext.Current.Session["names"], "','", base.Request.QueryString["Remark"], "'" });
                        name11 = string.Concat(new object[] { name12, ",'", HttpContext.Current.Session["shopname"], "','", HttpContext.Current.Session["shopnum"], "','", base.Request.QueryString["txtXFMoney"], "','", base.Request.QueryString["PayType"], "','','", base.Request.QueryString["txtname"], "','", base.Request.QueryString["CardType"], "'," });
                        name11 = name11 + "'" + base.Request.QueryString["txtXFMoney"] + "','0','0','0','0','" + base.Request.QueryString["JiFen"] + "') ";
                        PublicMethod.Execute(name11 + "  update membersinfo set mBalance=mBalance-" + base.Request.QueryString["txtXFMoney"] + ",mIntegral=mIntegral+" + base.Request.QueryString["JiFen"] + " where mNum='" + base.Request.QueryString["Id"] + "'");
                        sqlsms = "select xuhao,Pwd,type,states,contents from messageset where type = 'sms'";
                        dtsms  = this.bc.ReadTable(sqlsms);
                        if (dtsms.Rows[0]["states"].ToString() == "1")
                        {
                            balance   = new StringBuilder("0000000000");
                            result    = EUCPComm.GetBalance(dtsms.Rows[0]["xuhao"].ToString(), balance);
                            _Response = "";
                            mybalance = balance.ToString(0, balance.Length - 2);
                            if (result == 1)
                            {
                                _Response = mybalance;
                            }
                            if (int.Parse(_Response) > 1)
                            {
                                sms = string.Concat(new object[] { "尊敬的", dt.Rows[0]["mName"].ToString(), dt.Rows[0]["mSex"].ToString(), ",您于", DateTime.Now.ToString("yyyy-MM-dd HH:mm"), "在店面[", PublicMethod.GetSessionValue("shopname"), "]快速消费", base.Request.QueryString["txtXFMoney"], "元,获得积分", base.Request.QueryString["JiFen"], ",总积分为", jifen, ",", dtsms.Rows[0]["contents"].ToString() });
                                EUCPComm.SendSMS(dtsms.Rows[0]["xuhao"].ToString(), dt.Rows[0]["mMobile"].ToString(), sms, "");
                            }
                        }
                        base.Response.Write("true");
                    }
                    else
                    {
                        base.Response.Write("false");
                    }
                }
                else
                {
                    base.Response.Write("false");
                }
            }
            else if ((base.Request.QueryString["CardType"] != "临时卡") && (base.Request.QueryString["PayType"] == "银行卡"))
            {
                dtPwd = PublicMethod.QueryDataset("select mNum from membersinfo where mNum='" + base.Request.QueryString["Id"] + "' and mPwd='" + DESEncrypt.Encrypt(base.Request.QueryString["pwd"]) + "'").Tables[0];
                if (dtPwd.Rows.Count > 0)
                {
                    sqlf = "select * from membersinfo where  mNum ='" + base.Request.QueryString["Id"].ToString() + "'";
                    dt   = this.bc.ReadTable(sqlf);
                    if (dt.Rows.Count > 0)
                    {
                        jifen  = double.Parse(base.Request.QueryString["JiFen"]) + double.Parse(dt.Rows[0]["mIntegral"].ToString());
                        C_Id   = "XF" + DateTime.Now.ToString("yyyyMMddHHmmssffff");
                        str    = " insert into Consumption_Back_select (C_Id,Card_Id,Type,Addtime,Users,Remark,Shop,ShopId,Money,PayType,Consum_Type,ClientName,CardType,BlancePay,CashPay,BankPay,JifenPay,ElsePay,hjifen) values (";
                        name12 = str;
                        name12 = string.Concat(new object[] { name12, "'", C_Id, "','", base.Request.QueryString["Id"], "','快速消费','", DateTime.Now.ToString(), "','", HttpContext.Current.Session["names"], "','", base.Request.QueryString["Remark"], "'" });
                        name11 = string.Concat(new object[] { name12, ",'", HttpContext.Current.Session["shopname"], "','", HttpContext.Current.Session["shopnum"], "','", base.Request.QueryString["txtXFMoney"], "','", base.Request.QueryString["PayType"], "','','", base.Request.QueryString["txtname"], "','", base.Request.QueryString["CardType"], "'," });
                        name11 = name11 + "'0','0','" + base.Request.QueryString["txtXFMoney"] + "','0','0','" + base.Request.QueryString["JiFen"] + "') ";
                        PublicMethod.Execute(name11 + "  update membersinfo set mBalance=mBalance-" + base.Request.QueryString["txtXFMoney"] + ",mIntegral=mIntegral+" + base.Request.QueryString["JiFen"] + " where mNum='" + base.Request.QueryString["Id"] + "'");
                        sqlsms = "select xuhao,Pwd,type,states,contents from messageset where type = 'sms'";
                        dtsms  = this.bc.ReadTable(sqlsms);
                        if (dtsms.Rows[0]["states"].ToString() == "1")
                        {
                            balance   = new StringBuilder("0000000000");
                            result    = EUCPComm.GetBalance(dtsms.Rows[0]["xuhao"].ToString(), balance);
                            _Response = "";
                            mybalance = balance.ToString(0, balance.Length - 2);
                            if (result == 1)
                            {
                                _Response = mybalance;
                            }
                            if (int.Parse(_Response) > 1)
                            {
                                sms = string.Concat(new object[] { "尊敬的", dt.Rows[0]["mName"].ToString(), dt.Rows[0]["mSex"].ToString(), ",您于", DateTime.Now.ToString("yyyy-MM-dd HH:mm"), "在店面[", PublicMethod.GetSessionValue("shopname"), "]快速消费", base.Request.QueryString["txtXFMoney"], "元,获得积分", base.Request.QueryString["JiFen"], ",总积分为", jifen, ",", dtsms.Rows[0]["contents"].ToString() });
                                EUCPComm.SendSMS(dtsms.Rows[0]["xuhao"].ToString(), dt.Rows[0]["mMobile"].ToString(), sms, "");
                            }
                        }
                        base.Response.Write("true");
                    }
                    else
                    {
                        base.Response.Write("false");
                    }
                }
                else
                {
                    base.Response.Write("false");
                }
            }
            else if ((base.Request.QueryString["CardType"] != "临时卡") && (base.Request.QueryString["PayType"] == "现金"))
            {
                sqlf = "select * from membersinfo where  mNum ='" + base.Request.QueryString["Id"].ToString() + "'";
                dt   = this.bc.ReadTable(sqlf);
                if (dt.Rows.Count > 0)
                {
                    jifen  = double.Parse(base.Request.QueryString["JiFen"]) + double.Parse(dt.Rows[0]["mIntegral"].ToString());
                    C_Id   = "XF" + DateTime.Now.ToString("yyyyMMddHHmmssffff");
                    str    = " insert into Consumption_Back_select (C_Id,Card_Id,Type,Addtime,Users,Remark,Shop,ShopId,Money,PayType,Consum_Type,ClientName,CardType,BlancePay,CashPay,BankPay,JifenPay,ElsePay,hjifen) values (";
                    name12 = str;
                    name12 = string.Concat(new object[] { name12, "'", C_Id, "','", base.Request.QueryString["Id"], "','快速消费','", DateTime.Now.ToString(), "','", HttpContext.Current.Session["names"], "','", base.Request.QueryString["Remark"], "'" });
                    name11 = string.Concat(new object[] { name12, ",'", HttpContext.Current.Session["shopname"], "','", HttpContext.Current.Session["shopnum"], "','", base.Request.QueryString["txtXFMoney"], "','", base.Request.QueryString["PayType"], "','','", base.Request.QueryString["txtname"], "','", base.Request.QueryString["CardType"], "'," });
                    name11 = name11 + "'0','" + base.Request.QueryString["txtXFMoney"] + "','0','0','0','" + base.Request.QueryString["JiFen"] + "') ";
                    PublicMethod.Execute(name11 + "  update membersinfo set mIntegral=mIntegral+" + base.Request.QueryString["JiFen"] + " where mNum='" + base.Request.QueryString["Id"] + "'");
                    sqlsms = "select xuhao,Pwd,type,states,contents from messageset where type = 'sms'";
                    dtsms  = this.bc.ReadTable(sqlsms);
                    if (dtsms.Rows[0]["states"].ToString() == "1")
                    {
                        balance   = new StringBuilder("0000000000");
                        result    = EUCPComm.GetBalance(dtsms.Rows[0]["xuhao"].ToString(), balance);
                        _Response = "";
                        mybalance = balance.ToString(0, balance.Length - 2);
                        if (result == 1)
                        {
                            _Response = mybalance;
                        }
                        if (int.Parse(_Response) > 1)
                        {
                            sms = string.Concat(new object[] { "尊敬的", dt.Rows[0]["mName"].ToString(), dt.Rows[0]["mSex"].ToString(), ",您于", DateTime.Now.ToString("yyyy-MM-dd HH:mm"), "在店面[", PublicMethod.GetSessionValue("shopname"), "]快速消费", base.Request.QueryString["txtXFMoney"], "元,获得积分", base.Request.QueryString["JiFen"], ",总积分为", jifen, ",", dtsms.Rows[0]["contents"].ToString() });
                            EUCPComm.SendSMS(dtsms.Rows[0]["xuhao"].ToString(), dt.Rows[0]["mMobile"].ToString(), sms, "");
                        }
                    }
                    base.Response.Write("true");
                }
                else
                {
                    base.Response.Write("false");
                }
            }
            else
            {
                C_Id   = "XF" + DateTime.Now.ToString("yyyyMMddHHmmssffff");
                str    = "insert into Consumption_Back (C_Id,Card_Id,Type,Addtime,Users,Remark,Shop,ShopId,Money,PayType,Consum_Type,ClientName,CardType,BlancePay,CashPay,BankPay,JifenPay,ElsePay) values (";
                name12 = str;
                name12 = string.Concat(new object[] { name12, "'", C_Id, "','", base.Request.QueryString["Id"], "','快速消费','", DateTime.Now.ToString(), "','", HttpContext.Current.Session["names"], "','", base.Request.QueryString["Remark"], "'" });
                name12 = (string.Concat(new object[] { name12, ",'", HttpContext.Current.Session["shopname"], "','", HttpContext.Current.Session["shopnum"], "','", base.Request.QueryString["txtXFMoney"], "','", base.Request.QueryString["PayType"], "','','", base.Request.QueryString["txtname"], "','", base.Request.QueryString["CardType"], "'," }) + "'0','" + base.Request.QueryString["txtXFMoney"] + "','0','0','0') ") + " insert into Consumption_Back_select (C_Id,Card_Id,Type,Addtime,Users,Remark,Shop,ShopId,Money,PayType,Consum_Type,ClientName,CardType,BlancePay,CashPay,BankPay,JifenPay,ElsePay) values (";
                name12 = string.Concat(new object[] { name12, "'", C_Id, "','", base.Request.QueryString["Id"], "','快速消费','", DateTime.Now.ToString(), "','", HttpContext.Current.Session["names"], "','", base.Request.QueryString["Remark"], "'" });
                PublicMethod.Execute(string.Concat(new object[] { name12, ",'", HttpContext.Current.Session["shopname"], "','", HttpContext.Current.Session["shopnum"], "','", base.Request.QueryString["txtXFMoney"], "','", base.Request.QueryString["PayType"], "','','", base.Request.QueryString["txtname"], "','", base.Request.QueryString["CardType"], "'," }) + "'0','" + base.Request.QueryString["txtXFMoney"] + "','0','0','0') ");
                base.Response.Write("true");
            }
        }
    }
Exemplo n.º 6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        DataTable dt;

        if (base.Request.QueryString["type"] == "addshop")
        {
            dt = PublicMethod.QueryDataset("select cId,cNum,cName,cPrice from consumes where cNum='" + base.Request.QueryString["cNum"] + "'").Tables[0];
            if (dt.Rows.Count > 0)
            {
                base.Response.Write(dt.Rows[0]["cId"].ToString() + "@" + dt.Rows[0]["cName"].ToString() + "@" + dt.Rows[0]["cPrice"].ToString());
            }
            else
            {
                base.Response.Write("false");
            }
        }
        else
        {
            string name31;
            if (base.Request.QueryString["type"] == "postDate")
            {
                try
                {
                    string    strsp;
                    DataTable dtLevel;
                    DataTable dtMbr = PublicMethod.QueryDataset("select mNum,mLevel,mName,mBalance,convert(varchar(100), mPastdate,23) as 'mPastdate',mType,mPwd,mIntegral,mStates from membersinfo where mNum='" + base.Request.QueryString["cNum"] + "'").Tables[0];
                    if (dtMbr.Rows.Count > 0)
                    {
                        if (dtMbr.Rows[0]["mStates"].ToString() == "0")
                        {
                            if ((dtMbr.Rows[0]["mPastdate"].ToString() == "永久有效") || (DateTime.Parse(dtMbr.Rows[0]["mPastdate"].ToString()) > DateTime.Now))
                            {
                                strsp   = dtMbr.Rows[0]["mType"].ToString() + "@" + dtMbr.Rows[0]["mLevel"].ToString() + "@" + dtMbr.Rows[0]["mName"].ToString() + "@" + dtMbr.Rows[0]["mBalance"].ToString() + "@" + dtMbr.Rows[0]["mPastdate"].ToString() + "@" + dtMbr.Rows[0]["mNum"].ToString() + "@" + DESEncrypt.Decrypt(dtMbr.Rows[0]["mPwd"].ToString()) + "@" + dtMbr.Rows[0]["mIntegral"].ToString();
                                dtLevel = PublicMethod.QueryDataset("select lName,lDiscount,ljifen from memberlevel where lNum='" + dtMbr.Rows[0]["mLevel"].ToString() + "'").Tables[0];
                                if (dtLevel.Rows.Count > 0)
                                {
                                    name31 = strsp;
                                    strsp  = name31 + "@" + dtLevel.Rows[0]["lName"].ToString() + "@" + dtLevel.Rows[0]["lDiscount"].ToString() + "@" + dtLevel.Rows[0]["ljifen"].ToString();
                                }
                                base.Response.Write(strsp);
                            }
                            else
                            {
                                base.Response.Write("过期@");
                            }
                        }
                        else
                        {
                            base.Response.Write("挂失@");
                        }
                    }
                    else
                    {
                        DataTable dtMbrs = PublicMethod.QueryDataset("select mNum,mLevel,mName,mBalance,convert(varchar(100), mPastdate,23) as 'mPastdate',mType,mPwd,mIntegral,mStates,mMobile from membersinfo where mMobile='" + base.Request.QueryString["cNum"] + "'").Tables[0];
                        if (dtMbrs.Rows.Count > 0)
                        {
                            if (dtMbrs.Rows[0]["mStates"].ToString() == "0")
                            {
                                if ((dtMbrs.Rows[0]["mPastdate"].ToString() == "永久有效") || (DateTime.Parse(dtMbrs.Rows[0]["mPastdate"].ToString()) > DateTime.Now))
                                {
                                    strsp   = dtMbrs.Rows[0]["mType"].ToString() + "@" + dtMbrs.Rows[0]["mLevel"].ToString() + "@" + dtMbrs.Rows[0]["mName"].ToString() + "@" + dtMbrs.Rows[0]["mBalance"].ToString() + "@" + dtMbrs.Rows[0]["mPastdate"].ToString() + "@" + dtMbrs.Rows[0]["mNum"].ToString() + "@" + DESEncrypt.Decrypt(dtMbrs.Rows[0]["mPwd"].ToString()) + "@" + dtMbrs.Rows[0]["mIntegral"].ToString();
                                    dtLevel = PublicMethod.QueryDataset("select lName,lDiscount,ljifen from memberlevel where lNum='" + dtMbrs.Rows[0]["mLevel"].ToString() + "'").Tables[0];
                                    if (dtLevel.Rows.Count > 0)
                                    {
                                        name31 = strsp;
                                        strsp  = name31 + "@" + dtLevel.Rows[0]["lName"].ToString() + "@" + dtLevel.Rows[0]["lDiscount"].ToString() + "@" + dtLevel.Rows[0]["ljifen"].ToString();
                                    }
                                    base.Response.Write(strsp);
                                }
                                else
                                {
                                    base.Response.Write("过期@");
                                }
                            }
                            else
                            {
                                base.Response.Write("挂失@");
                            }
                        }
                        else
                        {
                            base.Response.Write("不存在@");
                        }
                    }
                }
                catch
                {
                }
            }
            else if (base.Request.QueryString["type"] == "change")
            {
                try
                {
                    string sqlf = "select * from membersinfo where  mNum ='" + base.Request.QueryString["CardId"].ToString() + "'";
                    dt = this.bc.ReadTable(sqlf);
                    if (dt.Rows.Count > 0)
                    {
                        double jifen  = double.Parse(base.Request.QueryString["SJiFen"]) + double.Parse(dt.Rows[0]["mIntegral"].ToString());
                        string C_Id   = "XF" + base.Request.QueryString["liushui"];
                        double cash   = double.Parse(base.Request.QueryString["cash"]) - double.Parse(base.Request.QueryString["zhaoling"]);
                        string blance = base.Request.QueryString["blance"];
                        string bank   = base.Request.QueryString["bank"];
                        string jifens = base.Request.QueryString["jifen"];
                        string elsee  = base.Request.QueryString["elses"];
                        string str    = " insert into Consumption_Back_select (C_Id,Card_Id,Type,Addtime,Users,Remark,Shop,ShopId,Money,PayType,Consum_Type,ClientName,CardType,BlancePay,CashPay,BankPay,JifenPay,ElsePay,hjifen) values (";
                        object name32 = str;
                        name32 = string.Concat(new object[] { name32, "'", C_Id, "','", base.Request.QueryString["CardId"], "','冲次消费','", DateTime.Now.ToString(), "','", HttpContext.Current.Session["names"], "','", base.Request.QueryString["Remark"], "'" });
                        name32 = string.Concat(new object[] { name32, ",'", HttpContext.Current.Session["shopname"], "','", HttpContext.Current.Session["shopnum"], "','", base.Request.QueryString["PayMoney"], "','", base.Request.QueryString["PayType"], "','','", base.Request.QueryString["txtname"], "','", base.Request.QueryString["CardType"], "'," });
                        name31 = string.Concat(new object[] { name32, "'", blance, "','", cash, "','", bank, "','", jifens, "','", elsee, "','", base.Request.QueryString["SJiFen"], "') " });
                        PublicMethod.Execute(name31 + "  update membersinfo set mBalance=mBalance-" + base.Request.QueryString["txtchuz"] + ",mIntegral=mIntegral+" + base.Request.QueryString["SJiFen"] + " where mNum='" + base.Request.QueryString["CardId"] + "'");
                        string        ddnow  = DateTime.Now.ToString();
                        StringBuilder st     = new StringBuilder();
                        string        detal  = base.Server.UrlDecode(base.Request.QueryString["detail"].ToString());
                        string[]      detals = detal.Substring(0, detal.Length - 1).Split(new char[] { '|' });
                        for (int i = 0; i < detals.Length; i++)
                        {
                            string[] strs = detals[i].Split(new char[] { ',' });
                            st.Append("insert into conscishu(uNum,uName,uPrice,uCount,uMoney,uDate,ucId,uZhe,uJifen,uMnum,uPastdate,uXiao,uAllcount)values('" + strs[4] + "','" + strs[0] + "','" + strs[1] + "','" + strs[2] + "','" + strs[3] + "','" + ddnow + "','" + C_Id + "','" + strs[5] + "','" + strs[6] + "','" + base.Request.QueryString["CardId"] + "','" + strs[7] + "','0','" + strs[2] + "')");
                        }
                        PublicMethod.Execute(st.ToString());
                        string    sqlsms = "select xuhao,Pwd,type,states,contents from messageset where type = 'sms'";
                        DataTable dtsms  = this.bc.ReadTable(sqlsms);
                        if (dtsms.Rows[0]["states"].ToString() == "1")
                        {
                            StringBuilder balance   = new StringBuilder("0000000000");
                            int           result    = EUCPComm.GetBalance(dtsms.Rows[0]["xuhao"].ToString(), balance);
                            string        _Response = "";
                            string        mybalance = balance.ToString(0, balance.Length - 2);
                            if (result == 1)
                            {
                                _Response = mybalance;
                            }
                            if (int.Parse(_Response) > 1)
                            {
                                string sms = string.Concat(new object[] { "尊敬的", dt.Rows[0]["mName"].ToString(), dt.Rows[0]["mSex"].ToString(), ",您于", DateTime.Now.ToString("yyyy-MM-dd HH:mm"), "在店面[", PublicMethod.GetSessionValue("shopname"), "]冲次消费", base.Request.QueryString["PayMoney"], "元,获得积分", base.Request.QueryString["SJiFen"], ",总积分为", jifen, ",", dtsms.Rows[0]["contents"].ToString() });
                                EUCPComm.SendSMS(dtsms.Rows[0]["xuhao"].ToString(), dt.Rows[0]["mMobile"].ToString(), sms, "");
                            }
                        }
                        base.Response.Write("true");
                    }
                    else
                    {
                        base.Response.Write("false");
                    }
                }
                catch
                {
                    base.Response.Write("false");
                }
            }
        }
    }
Exemplo n.º 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            string        sqlf;
            DataTable     dt;
            string        sqlsms;
            DataTable     dtsms;
            StringBuilder balance;
            int           result;
            string        _Response;
            string        mybalance;
            string        sms;
            string        type = base.Request.QueryString["type"].ToString();
            switch (type)
            {
            case "001":
                sqlf = "select * from membersinfo where  mNum ='" + base.Request.QueryString["mnum"].ToString() + "'";
                dt   = this.bc.ReadTable(sqlf);
                if (dt.Rows.Count > 0)
                {
                    sqlsms = "select xuhao,Pwd,type,states,contents from messageset where type = 'sms'";
                    dtsms  = this.bc.ReadTable(sqlsms);
                    if (dtsms.Rows[0]["states"].ToString() == "1")
                    {
                        balance   = new StringBuilder("0000000000");
                        result    = EUCPComm.GetBalance(dtsms.Rows[0]["xuhao"].ToString(), balance);
                        _Response = "";
                        mybalance = balance.ToString(0, balance.Length - 2);
                        if (result == 1)
                        {
                            _Response = mybalance;
                        }
                        if (int.Parse(_Response) > 1)
                        {
                            sms = "尊敬的" + dt.Rows[0]["mName"].ToString() + dt.Rows[0]["mSex"].ToString() + ",您的会员卡已经过期,请及时到本店续期,以免影响你的使用,谢谢。" + dtsms.Rows[0]["contents"].ToString();
                            EUCPComm.SendSMS(dtsms.Rows[0]["xuhao"].ToString(), dt.Rows[0]["mMobile"].ToString(), sms, "");
                        }
                    }
                    base.Response.Write("true");
                }
                return;

            case "002":
                sqlf = "select * from membersinfo where  mNum ='" + base.Request.QueryString["mnum"].ToString() + "'";
                dt   = this.bc.ReadTable(sqlf);
                if (dt.Rows.Count > 0)
                {
                    sqlsms = "select xuhao,Pwd,type,states,contents from messageset where type = 'sms'";
                    dtsms  = this.bc.ReadTable(sqlsms);
                    if (dtsms.Rows[0]["states"].ToString() == "1")
                    {
                        balance   = new StringBuilder("0000000000");
                        result    = EUCPComm.GetBalance(dtsms.Rows[0]["xuhao"].ToString(), balance);
                        _Response = "";
                        mybalance = balance.ToString(0, balance.Length - 2);
                        if (result == 1)
                        {
                            _Response = mybalance;
                        }
                        if (int.Parse(_Response) > 1)
                        {
                            sms = "尊敬的" + dt.Rows[0]["mName"].ToString() + dt.Rows[0]["mSex"].ToString() + ",您的会员卡已经有3个月的没有到本店消费了,本店目前有许多优惠活动,欢迎您的光临。" + dtsms.Rows[0]["contents"].ToString();
                            EUCPComm.SendSMS(dtsms.Rows[0]["xuhao"].ToString(), dt.Rows[0]["mMobile"].ToString(), sms, "");
                        }
                    }
                    base.Response.Write("true");
                }
                return;

            case "003":
                sqlf = "select * from membersinfo where  mNum ='" + base.Request.QueryString["mnum"].ToString() + "'";
                dt   = this.bc.ReadTable(sqlf);
                if (dt.Rows.Count > 0)
                {
                    sqlsms = "select xuhao,Pwd,type,states,contents from messageset where type = 'sms'";
                    dtsms  = this.bc.ReadTable(sqlsms);
                    if (dtsms.Rows[0]["states"].ToString() == "1")
                    {
                        balance   = new StringBuilder("0000000000");
                        result    = EUCPComm.GetBalance(dtsms.Rows[0]["xuhao"].ToString(), balance);
                        _Response = "";
                        mybalance = balance.ToString(0, balance.Length - 2);
                        if (result == 1)
                        {
                            _Response = mybalance;
                        }
                        if (int.Parse(_Response) > 1)
                        {
                            sms = "尊敬的" + dt.Rows[0]["mName"].ToString() + dt.Rows[0]["mSex"].ToString() + ",您的会员卡余额已经低于10元,请及时到本店充值,以免影响你的使用,谢谢。" + dtsms.Rows[0]["contents"].ToString();
                            EUCPComm.SendSMS(dtsms.Rows[0]["xuhao"].ToString(), dt.Rows[0]["mMobile"].ToString(), sms, "");
                        }
                    }
                    base.Response.Write("true");
                }
                return;
            }
            if (type == "004")
            {
                sqlf = "select * from membersinfo where  mNum ='" + base.Request.QueryString["mnum"].ToString() + "'";
                dt   = this.bc.ReadTable(sqlf);
                if (dt.Rows.Count > 0)
                {
                    sqlsms = "select xuhao,Pwd,type,states,contents from messageset where type = 'sms'";
                    dtsms  = this.bc.ReadTable(sqlsms);
                    if (dtsms.Rows[0]["states"].ToString() == "1")
                    {
                        balance   = new StringBuilder("0000000000");
                        result    = EUCPComm.GetBalance(dtsms.Rows[0]["xuhao"].ToString(), balance);
                        _Response = "";
                        mybalance = balance.ToString(0, balance.Length - 2);
                        if (result == 1)
                        {
                            _Response = mybalance;
                        }
                        if (int.Parse(_Response) > 1)
                        {
                            sms = "尊敬的" + dt.Rows[0]["mName"].ToString() + dt.Rows[0]["mSex"].ToString() + ",您的即将生日,我们公司为你提供许多生日优惠活动,欢迎你的光临,谢谢。" + dtsms.Rows[0]["contents"].ToString();
                            EUCPComm.SendSMS(dtsms.Rows[0]["xuhao"].ToString(), dt.Rows[0]["mMobile"].ToString(), sms, "");
                        }
                    }
                    base.Response.Write("true");
                }
            }
        }
        catch
        {
            base.Response.Write("false");
        }
    }