Example #1
0
        public static DataSet GetMessageList(string account, string pageno = "")
        {
            if (string.IsNullOrEmpty(pageno))
            {
                pageno = "1";
            }

            try
            {
                string  sql_core = string.Format("SELECT TOP 100 PERCENT  MSGID,MSGTYPE,MSGTITLE,CTIME,STATE FROM CAIKA_MEMBER_MESSAGE WHERE SSOPST='{0}@caika.com' ORDER BY CTIME", account);
                string  sql      = string.Format(@"SELECT TOP 30 * FROM (SELECT ROW_NUMBER() OVER (ORDER BY MSGID DESC) ROWNUM,T1.* FROM ({0}) T1) AS A WHERE ROWNUM > 30*({1}-1)", sql_core, pageno);
                DataSet ds       = new ParamUtil()
                                   .SQLCmdLoadData()
                                   .SQLWithOutSchema()
                                   .SQLEntityScript("list", sql)
                                   .SQLEntityScript("pages", string.Format("SELECT CEILING(CAST(COUNT(*) AS FLOAT)/30) FROM CAIKA_MEMBER_MESSAGE WHERE SSOPST='{0}@caika.com'", account))
                                   .ExecuteCmd(ADataLoader.DataLoader())
                                   .GetValueAsDataSet();

                return(ds);
            }
            catch (Exception)
            {
                return(null);
            }
        }
Example #2
0
        private void ChangeBank(Hashtable Params)
        {
            string  account   = PickParam(Params).GetValueAsString();
            string  c_pass    = PickParam(Params).GetValueAsString("c_pass");
            string  realname  = PickParam(Params).GetValueAsString("realname");
            DataSet ds_digest = PickParam(Params).GetValueAsDataSet("digest");

            try
            {
                if (string.IsNullOrEmpty(account))
                {
                    throw new ArgumentNullException("account", "未传入账户名");
                }

                if (string.IsNullOrEmpty(c_pass))
                {
                    throw new ArgumentNullException("c_pass", "未传入支付密码");
                }

                if (string.IsNullOrEmpty(realname))
                {
                    throw new ArgumentNullException("realname", "未传入开户人姓名");
                }

                if (ds_digest == null)
                {
                    throw new ArgumentNullException("digest", "未传入银行卡签名数据");
                }

                // 验证密码
                ParamUtil verifyPwd = new ParamUtil().SetCmd(CVerifyPasswrod).SetParam(account).SetParam("pwd", c_pass).SetParam("type", "pay").ExecuteCmd(this);
                if (verifyPwd.GetValueAsBool() == false)
                {
                    throw new Exception(verifyPwd.GetError());
                }
                else
                {
                    // 修改银行卡信息
                    string  passport = string.Format("{0}@caika.com", account);
                    DataSet dsMember = new ParamUtil()
                                       .SQLCmdLoadData()
                                       .SQLEntityScript("CAIKA_MEMBER", string.Format("SELECT * FROM CAIKA_MEMBER WHERE SSOPST='{0}'", passport))
                                       .ExecuteCmd(ADataLoader.DataLoader())
                                       .GetValueAsDataSet();

                    string key = new DictSetUtil(null).PushSLItem(passport).PushSLItem(c_pass).PushSLItem("Bank").DoSignature();
                    if (AEntryDic.Pick(GetControl()).SetDic(ds_digest, key))
                    {
                        dsMember.Tables[0].Rows[0]["REALNAME"]   = realname;
                        dsMember.Tables[0].Rows[0]["BANKDIGEST"] = key;
                        dsMember.Tables[0].Rows[0]["ETIME"]      = DateTime.Now;
                        new ParamUtil().SQLCmdPersistent().SetParam(dsMember).ExecuteCmd(ADataLoader.DataLoader());
                    }
                }
            }
            catch (Exception ex1)
            {
                PickParam(Params).Clear().SetError(ex1.Message);
            }
        }
Example #3
0
        public static string GetMessageBody(string msgid)
        {
            DataSet dsPersistent = new ParamUtil()
                                   .SQLCmdLoadData()
                                   .SQLEntityScript("CAIKA_MEMBER_MESSAGE", string.Format("SELECT * FROM CAIKA_MEMBER_MESSAGE WHERE MSGID='{0}'", msgid))
                                   .ExecuteCmd(ADataLoader.DataLoader())
                                   .GetValueAsDataSet();

            if (dsPersistent.Tables[0].Rows.Count > 0)
            {
                try
                {
                    if (dsPersistent.Tables[0].Rows[0]["STATE"].ToString() != message_state.Read)
                    {
                        dsPersistent.Tables[0].Rows[0]["STATE"] = message_state.Read;
                        new ParamUtil().SQLCmdPersistent().SetParam(dsPersistent).ExecuteCmd(ADataLoader.DataLoader());
                    }

                    return(dsPersistent.Tables[0].Rows[0]["MSGBODY"].ToString());
                }
                catch (Exception)
                {
                }
            }

            return("");
        }
Example #4
0
        public static DataTable GetAreas(string parentId = "")
        {
            DataTable dtResult = null;

            try
            {
                string filter = "";
                if (string.IsNullOrEmpty(parentId))
                {
                    filter = "LEVEL = 1";
                }
                else
                {
                    filter = "PARENTID='" + parentId + "'";
                }

                ParamUtil aPU = new ParamUtil()
                                .SQLCmdLoadData()
                                .SQLWithOutSchema()
                                .SQLEntityScript("CAIKA_AREAS", string.Format("SELECT * FROM CAIKA_AREAS WHERE {0} ORDER BY ID", filter))
                                .ExecuteCmd(ADataLoader.DataLoader());
                if (aPU.IsOK())
                {
                    dtResult = aPU.GetValueAsDataSet().Tables[0];
                }
            }
            catch (Exception)
            {
            }

            return(dtResult);
        }
Example #5
0
        /// <summary>
        /// 返回会员账号的信息
        /// </summary>
        /// <param name="objControl"></param>
        /// <param name="accountId"></param>
        /// <returns></returns>
        public static Hashtable GetMemberInfo(IControl objControl, string accountId)
        {
            // 判断会员账户是否存在?
            if (!MemberIsExist(objControl, accountId))
            {
                return(new Hashtable());
            }

            try
            {
                ParamUtil aPU = new ParamUtil();
                aPU.SQLCmdLoadData();
                aPU.SQLWithOutSchema();
                aPU.SQLEntityScript("CAIKA_MEMBER", string.Format("SELECT ACCOUNTID,NICKNAME,TYPE,LEVEL,PHONE,EMAIL,REALNAME,CERTTYPE,CERTNUMS,ASKID1,ANSWER1,ASKID2,ANSWER2,DIGEST,STATE FROM CAIKA_MEMBER WHERE ACCOUNTID='{0}'", accountId));
                if (aPU.ExecuteCmd(ADataLoader.DataLoader()).IsOK())
                {
                    return(new UriUtil()
                           .ImportRow(aPU.GetValueAsDataSet().Tables["CAIKA_MEMBER"].Rows[0])
                           .ImportHashtable(ParamUtil.Pick().ImportSets(GetMemberDigest(objControl, accountId)).ParamTable)
                           .ExportHashtable());
                }
            }
            catch (Exception)
            {
            }

            return(new Hashtable());
        }
Example #6
0
        private void AppendJournal(Hashtable Params)
        {
            string username     = PickParam(Params).GetValueAsString("username");
            string t_id         = PickParam(Params).GetValueAsString("t_id");
            string journal_type = PickParam(Params).GetValueAsString();

            try
            {
                if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(t_id) || string.IsNullOrEmpty(journal_type))
                {
                    throw new ArgumentException("接收到的参数列表存在错误!");
                }

                string  passport     = string.Format("{0}@caika.com", username);
                DataSet dsPersistent = new ParamUtil()
                                       .SQLCmdLoadData()
                                       .SQLEntityScript("CAIKA_MEMBER_JOURNAL", string.Format("SELECT * FROM CAIKA_MEMBER_JOURNAL WHERE ID='{0}' AND SSOPST='{1}'", t_id, passport))
                                       .ExecuteCmd(ADataLoader.DataLoader()).GetValueAsDataSet();

                DataRow row_joural = null;
                if (dsPersistent.Tables["CAIKA_MEMBER_JOURNAL"].Rows.Count == 0)
                {
                    row_joural           = dsPersistent.Tables["CAIKA_MEMBER_JOURNAL"].NewRow();
                    row_joural["ID"]     = t_id;
                    row_joural["SSOPST"] = passport;
                    row_joural["CTIME"]  = DateTime.Now;
                    dsPersistent.Tables["CAIKA_MEMBER_JOURNAL"].Rows.Add(row_joural);
                }

                row_joural = dsPersistent.Tables["CAIKA_MEMBER_JOURNAL"].Rows[0];
                row_joural["JOURNALTIME"] = DateTime.Now;
                row_joural["TYPE"]        = BASE.journal_type.充值;
                row_joural["AMOUNT"]      = PickParam(Params).GetValue("amount");

                // 通行证+超级密码
                string key = new DictSetUtil(null).PushSLItem(passport).PushSLItem("6B276432FFAF4FD4E086E739009256B3")
                             .DoSignature();

                row_joural["AVAILABLE"]      = new DictSetUtil(AEntryDic.Pick().GetDic(key)).GetValue("AVAILABLE");
                row_joural["CHECKSIGNATURE"] = new DictSetUtil(null).PushSLItem(passport).PushSLItem(t_id).DoSignature();
                row_joural["STATE"]          = journal_state.待审核;
                row_joural["ETIME"]          = DateTime.Now;

                // 生成一个流水账的对账单
                DictSetUtil ds_record = new DictSetUtil(new DataSet());
                ds_record.SetValue("channel", PickParam(Params).GetValueAsString("channel"));
                ds_record.SetValue("bank", PickParam(Params).GetValueAsString("bank"));
                ds_record.SetValue("amount", PickParam(Params).GetValueAsString("amount"));
                if (AEntryDic.Pick().SetDic(ds_record.MyDS, row_joural.Field <string>("CHECKSIGNATURE")))
                {
                    new ParamUtil().SQLCmdPersistent().SetParam(dsPersistent).ExecuteCmd(ADataLoader.DataLoader());
                }
            }
            catch (Exception ex1)
            {
                PickParam(Params).Clear().SetError(ex1.Message);
            }
        }
Example #7
0
        private void PostMemberInfo(Hashtable Params)
        {
            string  account   = PickParam(Params).GetValueAsString();
            string  c_pass    = PickParam(Params).GetValueAsString("c_pass");
            DataSet ds_member = PickParam(Params).GetValueAsDataSet("member");

            try
            {
                if (string.IsNullOrEmpty(account))
                {
                    throw new ArgumentNullException("account", "未传入账户名");
                }

                if (string.IsNullOrEmpty(c_pass))
                {
                    throw new ArgumentNullException("c_pass", "未传入登录密码");
                }

                if (ds_member == null)
                {
                    throw new ArgumentNullException("member", "未传入会员数据");
                }

                DictSetUtil dsinfo = new DictSetUtil(ds_member);

                // 验证密码
                ParamUtil verifyPwd = new ParamUtil().SetCmd(CVerifyPasswrod).SetParam(account).SetParam("pwd", c_pass).SetParam("type", "pay").ExecuteCmd(this);
                if (verifyPwd.GetValueAsBool() == false)
                {
                    throw new Exception(verifyPwd.GetError());
                }
                else
                {
                    // 修改会员信息
                    string  passport = string.Format("{0}@caika.com", account);
                    DataSet dsMember = new ParamUtil()
                                       .SQLCmdLoadData()
                                       .SQLEntityScript("CAIKA_MEMBER", string.Format("SELECT * FROM CAIKA_MEMBER WHERE SSOPST='{0}'", passport))
                                       .ExecuteCmd(ADataLoader.DataLoader())
                                       .GetValueAsDataSet();

                    dsMember.Tables[0].Rows[0]["NICKNAME"] = dsinfo.GetValue("nickname");
                    dsMember.Tables[0].Rows[0]["EMAIL"]    = dsinfo.GetValue("email");
                    dsMember.Tables[0].Rows[0]["REALNAME"] = dsinfo.GetValue("realname");
                    dsMember.Tables[0].Rows[0]["IDTYPE"]   = dsinfo.GetValue("idtype");
                    dsMember.Tables[0].Rows[0]["UID"]      = dsinfo.GetValue("id");
                    dsMember.Tables[0].Rows[0]["ASKID"]    = dsinfo.GetValue("ask");
                    dsMember.Tables[0].Rows[0]["ANSWER"]   = dsinfo.GetValue("answer");
                    dsMember.Tables[0].Rows[0]["ETIME"]    = DateTime.Now;
                    new ParamUtil().SQLCmdPersistent().SetParam(dsMember).ExecuteCmd(ADataLoader.DataLoader());
                }
            }
            catch (Exception ex1)
            {
                PickParam(Params).Clear().SetError(ex1.Message);
            }
        }
Example #8
0
        /// <summary>
        /// 会员账号是否存在?
        /// </summary>
        /// <param name="objControl"></param>
        /// <param name="accountId"></param>
        /// <returns></returns>
        public static bool MemberIsExist(IControl objControl, string accountId)
        {
            ParamUtil aPU = new ParamUtil();

            aPU.SQLCmdLoadData();
            aPU.SQLWithOutSchema();
            aPU.SQLEntityScript("CAIKA_MEMBER", string.Format("SELECT ACCOUNTID FROM CAIKA_MEMBER WHERE ACCOUNTID='{0}'", accountId));
            if (aPU.ExecuteCmd(ADataLoader.DataLoader()).IsOK())
            {
                return(aPU.GetValueAsDataSet().Tables["CAIKA_MEMBER"].Rows.Count > 0);
            }

            return(false);
        }
Example #9
0
        /// <summary>
        /// 返回会员账户信息及通行证数据
        /// </summary>
        /// <param name="objControl"></param>
        /// <param name="account"></param>
        /// <param name="domain"></param>
        /// <returns></returns>
        public static DataSet GetMemberAndPassport(IControl objControl, string account, string domain)
        {
            Hashtable aHT = new Hashtable();

            ParamUtil.Pick(aHT).SQLEntityScript("CAIKA_MEMBER", string.Format("SELECT * FROM CAIKA_MEMBER WHERE ACCOUNTID='{0}'", account));
            ParamUtil.Pick(aHT).SQLEntityScript("SSODOMAINREF", string.Format("SELECT * FROM SSODOMAINREF WHERE DOMAINUSER='******' AND DOMAINNAME='{1}'", account, domain));
            ParamUtil.Pick(aHT).SQLEntityScript("SSOPASSPORT", string.Format("SELECT * FROM SSOPASSPORT WHERE SSOPST=(SELECT SSOPST FROM SSODOMAINREF WHERE DOMAINUSER='******' AND DOMAINNAME='{1}')", account, domain));

            // 得到会员账户信息(包括通行证)
            if (ParamUtil.Pick(aHT).SQLCmdLoadData().ExecuteCmd(ADataLoader.DataLoader()).IsOK())
            {
                return((DataSet)aHT[ActionUtil.RetResult]);
            }

            return(null);
        }
Example #10
0
        public static int NewMsgCount(string account)
        {
            try
            {
                DataSet ds = new ParamUtil()
                             .SQLCmdLoadData()
                             .SQLWithOutSchema()
                             .SQLEntityScript("CAIKA_MEMBER_MESSAGE", string.Format("SELECT COUNT(*) FROM CAIKA_MEMBER_MESSAGE WHERE SSOPST='{0}@caika.com' AND STATE='{1}'", account, message_state.UnRead))
                             .ExecuteCmd(ADataLoader.DataLoader())
                             .GetValueAsDataSet();

                return(Convert.ToInt32(ds.Tables[0].Rows[0][0]));
            }
            catch
            {
                return(0);
            }
        }
Example #11
0
        public static DataTable GetPaymentList()
        {
            try
            {
                ParamUtil paramUtil = new ParamUtil().SQLCmdLoadData().SQLWithOutSchema()
                                      .SQLEntityScript("CAIKA_PAYMENT", string.Format("SELECT PAYID,NAME,PAYLINK,PAYMETHOD,CSSNAME,SEQNO FROM CAIKA_PAYMENT WHERE STATE='{0}'", state.Enabled))
                                      .ExecuteCmd(ADataLoader.DataLoader());
                if (paramUtil.IsOK())
                {
                    return(paramUtil.GetValueAsDataSet().Tables["CAIKA_PAYMENT"]);
                }
            }
            catch (Exception)
            {
            }

            return(null);
        }
Example #12
0
        public static DataSet GetBankData(string account)
        {
            try
            {
                DataSet dsMember = new ParamUtil()
                                   .SQLCmdLoadData()
                                   .SQLWithOutSchema()
                                   .SQLEntityScript("CAIKA_MEMBER", string.Format("SELECT * FROM CAIKA_MEMBER WHERE SSOPST='{0}@caika.com'", account))
                                   .ExecuteCmd(ADataLoader.DataLoader())
                                   .GetValueAsDataSet();

                string key = dsMember.Tables[0].Rows[0]["BANKDIGEST"].ToString().Trim();
                return(new DictSetUtil(AEntryDic.Pick().GetDic(key)).MyDS);
            }
            catch (Exception)
            {
                return(null);
            }
        }
Example #13
0
        public static DataSet GetMemberInfo(string account)
        {
            try
            {
                DataSet dsMember = new ParamUtil()
                                   .SQLCmdLoadData()
                                   .SQLWithOutSchema()
                                   .SQLEntityScript("CAIKA_MEMBER", string.Format("SELECT * FROM CAIKA_MEMBER WHERE SSOPST='{0}'", account))
                                   .ExecuteCmd(ADataLoader.DataLoader())
                                   .GetValueAsDataSet();

                DictSetUtil dsInfo = new DictSetUtil(new UriUtil().ImportRow(dsMember.Tables[0].Rows[0]).DSQueryItem);
                return(dsInfo.MyDS);
            }
            catch (Exception)
            {
                return(null);
            }
        }
Example #14
0
        private void GetAccountSummary(Hashtable Params)
        {
            string passport = PickParam(Params).GetValueAsString();

            if (string.IsNullOrEmpty(passport))
            {
                PickParam(Params).Clear().SetError("未传入通行证");
            }
            else
            {
                // 得到会员信息
                DataSet dsMember = new ParamUtil().SQLCmdLoadData().SQLEntityScript("CAIKA_MEMBER", string.Format("SELECT * FROM CAIKA_MEMBER WHERE SSOPST='{0}'", passport))
                                   .ExecuteCmd(ADataLoader.DataLoader()).GetValueAsDataSet();
                if (dsMember.Tables["CAIKA_MEMBER"].Rows.Count == 0)
                {
                    PickParam(Params).Clear().SetError("未找到会员记录");
                }
                else
                {
                    // 通行证+超级密码
                    string key = new DictSetUtil(null).PushSLItem(passport).PushSLItem("6B276432FFAF4FD4E086E739009256B3")
                                 .DoSignature();

                    DictSetUtil dsSummary = new DictSetUtil(AEntryDic.Pick().GetDic(key));
                    dsSummary.SetValue("NICKNAME", dsMember.Tables["CAIKA_MEMBER"].Rows[0]["NICKNAME"].ToString());

                    PickParam(Params).Clear();
                    PickParam(Params).SetParam(dsSummary.MyDS);

                    // 将账户摘要同步到Member表中
                    if (dsMember.Tables["CAIKA_MEMBER"].Rows[0]["UPDFLAG"].ToString() != "N")
                    {
                        dsMember.Tables["CAIKA_MEMBER"].Rows[0]["TOTALAMOUNT"] = dsSummary.GetValue("TOTALAMOUNT");
                        dsMember.Tables["CAIKA_MEMBER"].Rows[0]["AVAILABLE"]   = dsSummary.GetValue("AVAILABLE");
                        dsMember.Tables["CAIKA_MEMBER"].Rows[0]["FREEZED"]     = dsSummary.GetValue("FREEZED");
                        dsMember.Tables["CAIKA_MEMBER"].Rows[0]["SCORE"]       = dsSummary.GetValue("SCORE");
                        dsMember.Tables["CAIKA_MEMBER"].Rows[0]["UPDFLAG"]     = "N";

                        new ParamUtil().SQLCmdPersistent().SetParam(dsMember).ExecuteCmd(ADataLoader.DataLoader());
                    }
                }
            }
        }
Example #15
0
        /// <summary>
        /// 获取会员账号的资金摘要信息
        /// </summary>
        /// <param name="objControl"></param>
        /// <param name="accountId"></param>
        /// <returns></returns>
        public static DataSet GetMemberDigest(IControl objControl, string accountId = "")
        {
            DictSetUtil digestDS = new DictSetUtil(new DataSet());

            try
            {
                digestDS.SetValue("TOTALAMOUNT", "0.00"); // 账户总额
                digestDS.SetValue("AVAILABLE", "0.00");   // 可用余额
                digestDS.SetValue("FREEZED", "0.00");     // 冻结金额
                digestDS.SetValue("SCORE", "0");          // 积分
                digestDS.SetValue("DEPOSITED", "0.0");    // 充值金额
                digestDS.SetValue("BONUS", "0.0");        // 中奖金额
                digestDS.SetValue("EXCHANGED", "0.0");    // 积分兑换
                digestDS.SetValue("RETURNED", "0.0");     // 游戏返点
                digestDS.SetValue("CONSUME", "0.0");      // 投注金额
                digestDS.SetValue("WITHDRAW", "0.0");     // 提款金额

                // 得到会员账号的资金摘要信息
                if (!string.IsNullOrEmpty(accountId))
                {
                    ParamUtil aPU = new ParamUtil()
                                    .SQLCmdLoadData()
                                    .SQLEntityScript("CAIKA_MEMBER", string.Format("SELECT * FROM CAIKA_MEMBER WHERE ACCOUNTID='{0}'", accountId))
                                    .SQLWithOutSchema()
                                    .ExecuteCmd(ADataLoader.DataLoader());
                    if (aPU.IsOK())
                    {
                        DataSet dsDigest = AEntryDic.Pick(objControl).GetDic(aPU.GetValueAsDataSet().Tables["CAIKA_MEMBER"].Rows[0].Field <string>("DIGEST"));
                        if (dsDigest != null)
                        {
                            digestDS.MyDS.Merge(dsDigest);
                            digestDS.AcceptChanges();
                        }
                    }
                }
            }
            catch (Exception)
            {
            }

            return(digestDS.MyDS);
        }
Example #16
0
        public static void DeleteMessage(string msgid)
        {
            DataSet dsPersistent = new ParamUtil()
                                   .SQLCmdLoadData()
                                   .SQLEntityScript("CAIKA_MEMBER_MESSAGE", string.Format("SELECT * FROM CAIKA_MEMBER_MESSAGE WHERE MSGID='{0}'", msgid))
                                   .ExecuteCmd(ADataLoader.DataLoader())
                                   .GetValueAsDataSet();

            if (dsPersistent.Tables[0].Rows.Count > 0)
            {
                try
                {
                    dsPersistent.Tables[0].Rows[0].Delete();
                    new ParamUtil().SQLCmdPersistent().SetParam(dsPersistent).ExecuteCmd(ADataLoader.DataLoader());
                }
                catch (Exception)
                {
                }
            }
        }
Example #17
0
        public static Hashtable GetPaymethod2Hashtable(string channel, string payId)
        {
            Hashtable aHT = new Hashtable();

            try
            {
                ParamUtil paramUtil = new ParamUtil().SQLCmdLoadData()
                                      .SQLEntityScript("CAIKA_PAYMENT", string.Format("SELECT PAYID,VENDORID,PAYLINK,PAYMETHOD,PAYPARAMS,RATE,TOTALREQUEST,TOTALRECEIVED FROM CAIKA_PAYMENT WHERE PAYID='{0}' AND PAYMETHOD='{1}' AND STATE='{2}'", payId, channel, AosuApp.state.Enabled))
                                      .ExecuteCmd(ADataLoader.DataLoader());
                if (paramUtil.IsOK())
                {
                    ParamUtil.Pick(aHT)
                    .Merge(new UriUtil().ImportRow(paramUtil.GetValueAsDataSet().Tables[0].Rows[0]).ExportHashtable())
                    .ImportSets(AEntryDic.Pick().GetDic(ParamUtil.Pick(aHT).GetValueAsString("PAYPARAMS")));
                }
            }
            catch (Exception)
            {
            }

            return(aHT);
        }
Example #18
0
        public static Hashtable GetPaymentInfo(string payid)
        {
            Hashtable aHT = null;

            try
            {
                ParamUtil paramUtil = new ParamUtil().SQLCmdLoadData().SQLWithOutSchema()
                                      .SQLEntityScript("CAIKA_PAYMENT", string.Format("SELECT TOP 1 * FROM CAIKA_PAYMENT WHERE STATE='{0}' AND PAYID='{1}'", state.Enabled, payid))
                                      .ExecuteCmd(ADataLoader.DataLoader());
                if (paramUtil.IsOK())
                {
                    if (paramUtil.GetValueAsDataSet().Tables["CAIKA_PAYMENT"].Rows.Count == 1)
                    {
                        aHT = new UriUtil().ImportRow(paramUtil.GetValueAsDataSet().Tables["CAIKA_PAYMENT"].Rows[0])
                              .ExportHashtable();
                    }
                }
            }
            catch (Exception)
            {
            }

            return(aHT);
        }
Example #19
0
 public static bool WithdrawIsEmpty(string account)
 {
     try
     {
         // 得到会员信息
         DataSet dsMember = new ParamUtil()
                            .SQLCmdLoadData()
                            .SQLEntityScript("CAIKA_MEMBER", string.Format("SELECT ISNULL(WITHDRAWALS,'') FROM CAIKA_MEMBER WHERE SSOPST='{0}@caika.com'", account))
                            .SQLWithOutSchema()
                            .ExecuteCmd(ADataLoader.DataLoader()).GetValueAsDataSet();
         if (dsMember.Tables["CAIKA_MEMBER"].Rows.Count == 0)
         {
             return(false);
         }
         else
         {
             return(string.IsNullOrEmpty(dsMember.Tables[0].Rows[0].Field <string>(0).Trim()));
         }
     }
     catch
     {
         return(false);
     }
 }
Example #20
0
        /// <summary>
        /// 创建一个新的会员账号
        /// </summary>
        /// <param name="objControl"></param>
        /// <param name="Params"></param>
        public static void CreateMemberRecord(IControl objControl, Hashtable Params)
        {
            Hashtable aHT = new Hashtable();

            ParamUtil.Pick(aHT).SQLEntityScript("CAIKA_MEMBER", string.Format("SELECT * FROM CAIKA_MEMBER WHERE ACCOUNTID='{0}'", Params["DOMAINUSER"]));
            ParamUtil.Pick(aHT).SQLEntityScript("BASE_CATEGORY", string.Format("SELECT * FROM BASE_CATEGORY WHERE CATEGORYID LIKE '{0}%' ORDER BY CATEGORYID DESC", Params["PARENTAGENT"]));

            // 得到一个待持久化的记录集
            if (ParamUtil.Pick(aHT).SQLCmdLoadData().ExecuteCmd(ADataLoader.DataLoader()).IsOK())
            {
                DataSet dsPersistent = ParamUtil.Pick(aHT).GetValueAsDataSet();
                if (dsPersistent.Tables["CAIKA_MEMBER"].Rows.Count == 0)
                {
                    // 生成当前账号的代理编号
                    if (ParamUtil.Pick(Params).IsNullOrEmpty("PARENTAGENT") || dsPersistent.Tables["BASE_CATEGORY"].Rows.Count == 0)
                    {
                        throw new Exception("参数列表中没有解析到上级代理商编号。");
                    }

                    string strAgentCode = "";
                    int    intLevel     = 0;
                    int    intSeqNo     = 0;
                    if (dsPersistent.Tables["BASE_CATEGORY"].Rows.Count == 1)
                    {
                        strAgentCode = string.Format("{0}001", Params["PARENTAGENT"]);
                        intLevel     = Convert.ToInt32(dsPersistent.Tables["BASE_CATEGORY"].Rows[0]["LEVEL"]) + 1;
                        intSeqNo     = 1;
                    }
                    else
                    {
                        int    idx     = 0;
                        string curCode = dsPersistent.Tables["BASE_CATEGORY"].Rows[0]["CATEGORYID"] + "";
                        if (!int.TryParse(curCode.Substring(curCode.Length - 3), out idx))
                        {
                            throw new Exception(string.Format("解析代理商{0}的索引值出错。", dsPersistent.Tables["BASE_CATEGORY"].Rows[0]["CATEGORYID"]));
                        }

                        if ((idx + 1) > 998)
                        {
                            throw new Exception(string.Format("代理商{0}的下级代理数量已满。", Params["PARENTAGENT"]));
                        }

                        strAgentCode = Params["PARENTAGENT"] + (idx + 1).ToString().PadLeft(3, '0');
                        intLevel     = Convert.ToInt32(dsPersistent.Tables["BASE_CATEGORY"].Rows[0]["LEVEL"]);
                        intSeqNo     = Convert.ToInt32(dsPersistent.Tables["BASE_CATEGORY"].Rows[0]["SEQNO"]) + 1;
                    }

                    DataRow rowNew = dsPersistent.Tables["CAIKA_MEMBER"].NewRow();
                    rowNew["ACCOUNTID"] = Params["DOMAINUSER"];
                    rowNew["NICKNAME"]  = Params["DOMAINUSER"];
                    rowNew["TYPE"]      = Params["TYPE"];
                    if (Params["TYPE"].ToString() == account_type.AgentAccount)
                    {
                        rowNew["LEVEL"] = member_level.L3;
                    }
                    else
                    {
                        rowNew["LEVEL"] = member_level.L5;
                    }

                    rowNew["AGENTCODE"] = strAgentCode;
                    rowNew["CERTTYPE"]  = "身份证";
                    rowNew["STATE"]     = state.Enabled;
                    rowNew["CTIME"]     = DateTime.Now;
                    rowNew["CUSER"]     = objControl.GetContext().MyInfo["USERID"];
                    rowNew["ETIME"]     = DateTime.Now;
                    rowNew["EUSER"]     = objControl.GetContext().MyInfo["USERID"];

                    // 通行证+超级密码
                    string key = new DictSetUtil(null)
                                 .PushSLItem(string.Format("{0}@{1}", Params["DOMAINUSER"], Params["DOMAINNAME"]))
                                 .DoSignature();

                    rowNew["DIGEST"] = key;

                    DictSetUtil dictDigest = new DictSetUtil(ParamUtil.Pick(Params).GetValueAsDataSet());
                    rowNew["TOTALAMOUNT"] = dictDigest.GetValue("TOTALAMOUNT");
                    rowNew["AVAILABLE"]   = dictDigest.GetValue("AVAILABLE");
                    rowNew["FREEZED"]     = dictDigest.GetValue("FREEZED");
                    rowNew["SCORE"]       = dictDigest.GetValue("SCORE");

                    dsPersistent.Tables["CAIKA_MEMBER"].Rows.Add(rowNew);

                    DataRow rowAgent = dsPersistent.Tables["BASE_CATEGORY"].NewRow();
                    rowAgent["CATEGORYID"] = strAgentCode;
                    rowAgent["NAME"]       = Params["DOMAINUSER"];
                    rowAgent["DESC"]       = Params["DOMAINUSER"];
                    rowAgent["PARENTID"]   = Params["PARENTAGENT"];
                    rowAgent["LEVEL"]      = intLevel;
                    rowAgent["SEQNO"]      = intSeqNo;
                    rowAgent["ISEND"]      = "Y";
                    rowAgent["CTYPE"]      = category.CType_Label;
                    rowAgent["STATE"]      = state.Enabled;
                    rowAgent["CTIME"]      = DateTime.Now;
                    rowAgent["CUSER"]      = objControl.GetContext().MyInfo["USERID"];
                    rowAgent["ETIME"]      = DateTime.Now;
                    rowAgent["EUSER"]      = objControl.GetContext().MyInfo["USERID"];

                    dsPersistent.Tables["BASE_CATEGORY"].Rows.Add(rowAgent);
                    dsPersistent.Tables["BASE_CATEGORY"].Rows[dsPersistent.Tables["BASE_CATEGORY"].Rows.Count - 1]["ISEND"] = "N";

                    if (new ParamUtil().SQLCmdPersistent().SetParam(dsPersistent).ExecuteCmd(ADataLoader.DataLoader()).IsOK())
                    {
                        // 会员账户的金额摘要数据
                        if (AEntryDic.Pick(objControl).SetDic(dictDigest.MyDS, key))
                        {
                            ParamUtil.Pick(Params).Clear();
                            ParamUtil.Pick(Params).SetError(ActionUtil.DefaultError);
                        }
                    }
                }
            }
        }
Example #21
0
        private void Controls_RequestValidationEvent(object sender, EventArgs e)
        {
            IControlValidation objControl = (IControlValidation)sender;

            objControl.IsValid     = true;
            objControl.IsValidated = true;

            switch (((Control)sender).Name)
            {
            case "TxtAgentCode":
                if (objControl.IsEmpty)
                {
                    objControl.IsValid            = false;
                    objControl.ValidationErrorMsg = "上级代理商编号不能为空!";
                }
                else
                {
                    ParamUtil aPU = new ParamUtil().SQLCmdLoadData().SQLWithOutSchema()
                                    .SQLEntityScript("BASE_CATEGORY", string.Format("SELECT CATEGORYID FROM BASE_CATEGORY WHERE CATEGORYID='{0}'", objControl.CurrentText))
                                    .ExecuteCmd(ADataLoader.DataLoader());
                    if (!aPU.IsOK())
                    {
                        objControl.IsValid            = false;
                        objControl.ValidationErrorMsg = aPU.GetError();
                    }
                    else
                    {
                        if (aPU.GetValueAsDataSet().Tables["BASE_CATEGORY"].Rows.Count == 0)
                        {
                            objControl.IsValid            = false;
                            objControl.ValidationErrorMsg = string.Format("代理商编号[{0}]无效!", objControl.CurrentText);
                        }
                    }
                }
                break;

            case "TxtAccountID":
                if (objControl.IsEmpty)
                {
                    objControl.IsValid            = false;
                    objControl.ValidationErrorMsg = "账户名不能为空!";
                }
                else
                {
                    if (objControl.CurrentText.Length < 4 || objControl.CurrentText.Length > 18)
                    {
                        objControl.IsValid            = false;
                        objControl.ValidationErrorMsg = "账户名长度必须在(4-18)之间!";
                    }
                    else
                    {
                        // 是否存在?
                        if (MemberDBUtils.MemberIsExist(GetControl(), TxtAccountID.Text))
                        {
                            objControl.IsValid            = false;
                            objControl.ValidationErrorMsg = string.Format("账号[{0}]已经存在!", TxtAccountID.Text);
                        }
                    }
                }
                break;

            case "TxtPassword":
            case "TxtConfirm":
                if (objControl.IsEmpty)
                {
                    objControl.IsValid            = false;
                    objControl.ValidationErrorMsg = "密码不能为空!";
                }
                else
                {
                    if (objControl.CurrentText.Length < 4 || objControl.CurrentText.Length > 18)
                    {
                        objControl.IsValid            = false;
                        objControl.ValidationErrorMsg = "密码长度必须在(4-18)之间!";
                    }
                }

                if (objControl.IsValidated && objControl.IsValid)
                {
                    if (TxtPassword.Text != TxtConfirm.Text)
                    {
                        objControl.IsValid            = false;
                        objControl.ValidationErrorMsg = "两次密码输入不一致!";
                        if (objControl == TxtPassword && string.IsNullOrEmpty(TxtConfirm.Text))
                        {
                            objControl.IsValid = true;
                        }
                    }
                    else
                    {
                        TxtPassword.IsValid = true;
                        TxtConfirm.IsValid  = true;
                    }
                }
                break;
            }

            if (!objControl.IsValid && objControl.IsValidated)
            {
                ((Control)objControl).Focus();
            }
        }
Example #22
0
        private void AppendNode4List(Hashtable Params)
        {
            IModelForm instance = PickParam(Params).GetValue <IModelForm>(ActionUtil.ActionID);

            if (instance != null)
            {
                string userId = GetControl().GetContext().GetValue <string>("USERID");

                StandardGrid gridList = instance.GetActived <ListModelFormProxy>().GridControl;
                if (gridList.CurrentRow != null)
                {
                    DataRowView curRow = (DataRowView)gridList.CurrentRow.DataBoundItem;

                    // 得到当前层级最大编号
                    DataView curLevel = new DataView(((DataSet)gridList.DataSource).Tables[gridList.DataMember], "PARENTID='" + curRow["PARENTID"] + "'", "CATEGORYID DESC", DataViewRowState.CurrentRows);
                    if (curLevel.Count == 0)
                    {
                        return;
                    }

                    int    idx;
                    string cId = curLevel[0]["CATEGORYID"].ToString().Trim();
                    if (int.TryParse(cId.Substring(cId.Length - 3), out idx))
                    {
                        if (idx + 1 > 999)
                        {
                            AlertBox.ShowTips("已超过最大编码范围(0-999)!", instance, MessageBoxButtons.OK);
                            return;
                        }

                        // 新编码
                        string    nId = string.Format("{0}{1:000}", cId.Substring(0, cId.Length - 3), idx + 1);
                        ParamUtil aPU = new ParamUtil()
                                        .SQLCmdLoadData().SQLEntityScript("BASE_CATEGORY", string.Format("SELECT * FROM BASE_CATEGORY WHERE CATEGORYID='{0}'", nId))
                                        .ExecuteCmd(ADataLoader.DataLoader());
                        if (aPU.IsOK())
                        {
                            bool isNew = false;

                            #region 构建分类数据

                            DataRow rowNew = ((DataSet)gridList.DataSource).Tables[gridList.DataMember].NewRow();
                            if (aPU.GetValueAsDataSet().Tables["BASE_CATEGORY"].Rows.Count == 0)
                            {
                                rowNew["CATEGORYID"] = nId;
                                rowNew["PARENTID"]   = curRow["PARENTID"];
                                rowNew["CTYPE"]      = curRow["CTYPE"];
                                rowNew["SEQNO"]      = curRow.Row.Field <int>("SEQNO") + 1;
                                rowNew["LEVEL"]      = curRow["LEVEL"];
                                rowNew["ISEND"]      = "Y";
                                rowNew["STATE"]      = AosuApp.state.Enabled;
                                rowNew["CTIME"]      = DateTime.Now;
                                rowNew["CUSER"]      = userId;
                                rowNew["ETIME"]      = DateTime.Now;
                                rowNew["EUSER"]      = userId;

                                isNew = true;
                            }
                            else
                            {
                                if (AlertBox.ShowWarning(string.Format("{0}编号已经存在,是否将数据放入当前窗体上下文中?", nId), instance, MessageBoxButtons.YesNo) != DialogResult.Yes)
                                {
                                    return;
                                }

                                rowNew.ItemArray = aPU.GetValueAsDataSet().Tables["BASE_CATEGORY"].Rows[0].ItemArray;
                                rowNew["STATE"]  = AosuApp.state.Enabled;
                                rowNew["ETIME"]  = DateTime.Now;
                                rowNew["EUSER"]  = userId;
                            }

                            #endregion

                            #region 插入到列表

                            int      newIdx  = 0;
                            DataView dvChild = new DataView(((DataSet)gridList.DataSource).Tables[gridList.DataMember], "CATEGORYID LIKE '" + cId + "%'", "CATEGORYID DESC", DataViewRowState.CurrentRows);
                            if (dvChild.Count > 0)
                            {
                                DataGridViewRow gridRow = gridList.Rows.OfType <DataGridViewRow>().FirstOrDefault(cm => ((DataRowView)cm.DataBoundItem)["CATEGORYID"] == dvChild[0]["CATEGORYID"]);
                                if (gridRow != null)
                                {
                                    newIdx = gridRow.Index + 1;
                                }
                            }
                            else
                            {
                                DataGridViewRow gridRow = gridList.Rows.OfType <DataGridViewRow>().FirstOrDefault(cm => ((DataRowView)cm.DataBoundItem)["CATEGORYID"] == curLevel[0]["CATEGORYID"]);
                                if (gridRow != null)
                                {
                                    newIdx = gridRow.Index + 1;
                                }
                            }

                            ((DataSet)gridList.DataSource).Tables[gridList.DataMember].Rows.InsertAt(rowNew, newIdx);
                            if (!isNew)
                            {
                                // 行状态改为"Modified"
                                rowNew.AcceptChanges();
                                rowNew["EUSER"] = userId;
                                rowNew["ETIME"] = DateTime.Now;
                            }

                            gridList.CurrentCell = gridList[0, newIdx];

                            #endregion
                        }
                        else
                        {
                            AlertBox.ShowError(aPU.GetError(), instance, MessageBoxButtons.OK);
                        }
                    }
                    else
                    {
                        AlertBox.ShowTips(string.Format("无效的分类编号{0}!"), instance, MessageBoxButtons.OK);
                    }
                }
            }
        }
Example #23
0
        private void PostRequest(Hashtable Params)
        {
            string account = PickParam(Params).GetValueAsString();
            string type    = PickParam(Params).GetValueAsString("type");
            string msgid   = PickParam(Params).GetValueAsString("msgid");

            try
            {
                if (string.IsNullOrEmpty(account))
                {
                    throw new ArgumentNullException("account", "未传入账户名");
                }

                if (string.IsNullOrEmpty(type))
                {
                    throw new ArgumentNullException("type", "未传入请求类型");
                }

                if (string.IsNullOrEmpty(msgid))
                {
                    throw new ArgumentNullException("msgid", "未传入请求ID");
                }

                string uid = new DictSetUtil(null).DoSignature(msgid);

                // 修改会员信息
                string  passport     = string.Format("{0}@caika.com", account);
                DataSet dsPersistent = new ParamUtil()
                                       .SQLCmdLoadData()
                                       .SQLEntityScript("CAIKA_MEMBER_MESSAGE", string.Format("SELECT * FROM CAIKA_MEMBER_MESSAGE WHERE MSGID='{0}'", uid))
                                       .ExecuteCmd(ADataLoader.DataLoader())
                                       .GetValueAsDataSet();
                if (dsPersistent.Tables[0].Rows.Count == 0)
                {
                    DataRow row_message1 = dsPersistent.Tables["CAIKA_MEMBER_MESSAGE"].NewRow();
                    row_message1["MSGID"]  = uid;
                    row_message1["SSOPST"] = "*****@*****.**";
                    switch (type)
                    {
                    case "1":
                        row_message1["MSGTYPE"]  = message_id.UserRequest_ChangeMemberInfo;
                        row_message1["MSGTITLE"] = string.Format("{0}提交修改个人资料的请求", passport);
                        break;

                    case "2":
                        row_message1["MSGTYPE"]  = message_id.UserRequest_ChangePayPassword;
                        row_message1["MSGTITLE"] = string.Format("{0}提交修改支付密码的请求", passport);
                        break;
                    }
                    row_message1["MSGBODY"] = "";
                    row_message1["STATE"]   = message_state.UnRead;
                    row_message1["CTIME"]   = DateTime.Now;
                    dsPersistent.Tables["CAIKA_MEMBER_MESSAGE"].Rows.Add(row_message1);

                    new ParamUtil().SQLCmdPersistent().SetParam(dsPersistent).ExecuteCmd(ADataLoader.DataLoader());
                }
            }
            catch (Exception ex1)
            {
                PickParam(Params).Clear().SetError(ex1.Message);
            }
        }
Example #24
0
        private void CreateNewAccount(Hashtable Params)
        {
            string account = PickParam(Params).GetValueAsString("DOMAINUSER");
            string domain  = PickParam(Params).GetValueAsString("DOMAINNAME");

            try
            {
                // 注册通行证
                ParamUtil register = PickParam(Params).SetCmd(APassport.CRegister).ExecuteCmd(new APassport());
                if (register.IsOK())
                {
                    ParamUtil aPU = new ParamUtil()
                                    .SQLCmdLoadData()
                                    .SQLEntityScript("CAIKA_MEMBER", string.Format("SELECT * FROM CAIKA_MEMBER WHERE SSOPST='{0}'", register.GetValue()))
                                    .SQLEntityScript("CAIKA_MEMBER_MESSAGE", string.Format("SELECT * FROM CAIKA_MEMBER_MESSAGE WHERE SSOPST='{0}'", register.GetValue()))
                                    .ExecuteCmd(ADataLoader.DataLoader());
                    if (aPU.IsOK())
                    {
                        DataSet dsPersistent = aPU.GetValueAsDataSet();
                        if (dsPersistent.Tables["CAIKA_MEMBER"].Rows.Count == 0)
                        {
                            DataRow rowNew = dsPersistent.Tables["CAIKA_MEMBER"].NewRow();
                            rowNew["SSOPST"]   = register.GetValue();
                            rowNew["NICKNAME"] = account;
                            rowNew["UPDFLAG"]  = "Y";
                            rowNew["STATE"]    = AosuApp.state.Enabled;
                            rowNew["CTIME"]    = DateTime.Now;
                            rowNew["ETIME"]    = DateTime.Now;
                            dsPersistent.Tables["CAIKA_MEMBER"].Rows.Add(rowNew);

                            // 添加提示信息 - 详细资料
                            DataRow row_message1 = AosuApp.Functions.FindRow(string.Format("MSGTYPE={0}", message_id.Account_KeyIn_DetailInfo), dsPersistent.Tables["CAIKA_MEMBER_MESSAGE"]);
                            if (row_message1 == null)
                            {
                                row_message1             = dsPersistent.Tables["CAIKA_MEMBER_MESSAGE"].NewRow();
                                row_message1["MSGID"]    = Guid.NewGuid();
                                row_message1["SSOPST"]   = register.GetValue();
                                row_message1["MSGTYPE"]  = message_id.Account_KeyIn_DetailInfo;
                                row_message1["MSGTITLE"] = "请完善用户基本资料";
                                row_message1["MSGBODY"]  = "<strong>完善用户基本资料提醒</strong><br/></br/>为了确保彩咖网更好的服务于您,请您完善<a href='/member/usercenter/grzl'><strong>个人资料信息</strong></a>。";
                                row_message1["STATE"]    = message_state.UnRead;
                                row_message1["CTIME"]    = DateTime.Now;
                                dsPersistent.Tables["CAIKA_MEMBER_MESSAGE"].Rows.Add(row_message1);
                            }

                            // 添加提示信息 - 设置提款密码
                            DataRow row_message2 = AosuApp.Functions.FindRow(string.Format("MSGTYPE={0}", message_id.Account_KeyIn_Withdrawals), dsPersistent.Tables["CAIKA_MEMBER_MESSAGE"]);
                            if (row_message2 == null)
                            {
                                row_message2             = dsPersistent.Tables["CAIKA_MEMBER_MESSAGE"].NewRow();
                                row_message2["MSGID"]    = Guid.NewGuid();
                                row_message2["SSOPST"]   = register.GetValue();
                                row_message2["MSGTYPE"]  = message_id.Account_KeyIn_Withdrawals;
                                row_message2["MSGTITLE"] = "请设置提款密码";
                                row_message2["MSGBODY"]  = "<strong>设置提款密码提醒</strong><br/></br/>提款密码用于提取彩咖网账户可用余额的安全密码,请您务必设置<a href='/member/usercenter/zhmm'><strong>提款密码</strong></a>。定期重新设置提款密码能提高您的账户安全性!";
                                row_message2["STATE"]    = message_state.UnRead;
                                row_message2["CTIME"]    = DateTime.Now;
                                dsPersistent.Tables["CAIKA_MEMBER_MESSAGE"].Rows.Add(row_message2);
                            }

                            // 添加提示信息 - 绑定银行卡
                            DataRow row_message3 = AosuApp.Functions.FindRow(string.Format("MSGTYPE={0}", message_id.Account_KeyIn_BankCard), dsPersistent.Tables["CAIKA_MEMBER_MESSAGE"]);
                            if (row_message3 == null)
                            {
                                row_message3             = dsPersistent.Tables["CAIKA_MEMBER_MESSAGE"].NewRow();
                                row_message3["MSGID"]    = Guid.NewGuid();
                                row_message3["SSOPST"]   = register.GetValue();
                                row_message3["MSGTYPE"]  = message_id.Account_KeyIn_BankCard;
                                row_message3["MSGTITLE"] = "请绑定银行卡";
                                row_message3["MSGBODY"]  = "<strong>绑定银行卡提醒</strong><br/></br/>当您购彩中奖后,彩咖网将会依据您提交的银行卡信息将彩金转入你的真实有效的银行卡账户中;所以请您务必<a href='/member/usercenter/bdyhk'><strong>绑定银行卡</strong></a>,并确保银行卡的真实有效。";
                                row_message3["STATE"]    = message_state.UnRead;
                                row_message3["CTIME"]    = DateTime.Now;
                                dsPersistent.Tables["CAIKA_MEMBER_MESSAGE"].Rows.Add(row_message3);
                            }

                            if (new ParamUtil().SQLCmdPersistent().SetParam(dsPersistent).ExecuteCmd(ADataLoader.DataLoader()).IsOK())
                            {
                                // 生成账户的摘要集
                                DictSetUtil ds_summary = new DictSetUtil(new DataSet());
                                ds_summary.SetValue("TOTALAMOUNT", "0.00"); // 账户总额
                                ds_summary.SetValue("AVAILABLE", "0.00");   // 可用余额
                                ds_summary.SetValue("FREEZED", "0.00");     // 冻结金额
                                ds_summary.SetValue("SCORE", "0");          // 积分
                                ds_summary.SetValue("DEPOSITED", "0.0");    // 充值金额
                                ds_summary.SetValue("BONUS", "0.0");        // 中奖金额
                                ds_summary.SetValue("EXCHANGED", "0.0");    // 积分兑换
                                ds_summary.SetValue("RETURNED", "0.0");     // 游戏返点
                                ds_summary.SetValue("CONSUME", "0.0");      // 投注金额
                                ds_summary.SetValue("WITHDRAW", "0.0");     // 提款金额

                                // 通行证+超级密码
                                string key = new DictSetUtil(null).PushSLItem(PickParam(Params).GetValueAsString()).PushSLItem("6B276432FFAF4FD4E086E739009256B3")
                                             .DoSignature();

                                AEntryDic.Pick(GetControl()).SetDic(ds_summary.MyDS, key);
                            }
                            else
                            {
                                PickParam(Params).Clear().SetError("注册失败");
                            }
                        }
                        else
                        {
                            PickParam(Params).Clear().SetError("账户名已存在");
                        }
                    }
                    else
                    {
                        PickParam(Params).Clear().SetError(aPU.GetError());
                    }
                }
                else
                {
                    PickParam(Params).Clear().SetError(register.GetError());
                }
            }
            catch
            {
                PickParam(Params).Clear().SetError("注册失败");
            }
        }
Example #25
0
        private void ChangePassword(Hashtable Params)
        {
            string account = PickParam(Params).GetValueAsString();
            string type    = PickParam(Params).GetValueAsString("type");

            try
            {
                string c_pwd = PickParam(Params).GetValueAsString("c_pass");
                string n_pwd = PickParam(Params).GetValueAsString("n_pass");
                if (string.IsNullOrEmpty(n_pwd))
                {
                    throw new ArgumentNullException("n_pwd", "未传入新密码");
                }

                if (type == "pay")
                {
                    // 是否设置过提款密码?
                    if (AAccountUtil.WithdrawIsEmpty(account) == false)
                    {
                        if (string.IsNullOrEmpty(c_pwd))
                        {
                            throw new ArgumentNullException("c_pwd", "未传入当前密码");
                        }

                        // 验证密码
                        ParamUtil verifyPwd = new ParamUtil().SetCmd(CVerifyPasswrod).SetParam(account).SetParam("pwd", c_pwd).SetParam("type", type).ExecuteCmd(this);
                        if (verifyPwd.GetValueAsBool() == false)
                        {
                            throw new Exception(verifyPwd.GetError());
                        }
                    }

                    // 修改密码
                    DataSet dsMember = new ParamUtil()
                                       .SQLCmdLoadData()
                                       .SQLEntityScript("CAIKA_MEMBER", string.Format("SELECT * FROM CAIKA_MEMBER WHERE SSOPST='{0}@caika.com'", account))
                                       .ExecuteCmd(ADataLoader.DataLoader())
                                       .GetValueAsDataSet();

                    dsMember.Tables[0].Rows[0]["WITHDRAWALS"] = new DictSetUtil(null).DoSignature(n_pwd);
                    dsMember.Tables[0].Rows[0]["ETIME"]       = DateTime.Now;
                    new ParamUtil().SQLCmdPersistent().SetParam(dsMember).ExecuteCmd(ADataLoader.DataLoader());
                }
                else
                {
                    if (string.IsNullOrEmpty(c_pwd))
                    {
                        throw new ArgumentNullException("c_pwd", "未传入当前密码");
                    }

                    ParamUtil aPU = new ParamUtil()
                                    .SetCmd(CChangePassword)
                                    .SetParam("DOMAINUSER", account)
                                    .SetParam("DOMAINNAME", BaseControl.GlobalControl.GetContext()[Context.CAppName])
                                    .SetParam("PSTPWD", c_pwd)
                                    .SetParam("NEWPWD", n_pwd)
                                    .ExecuteCmd(new APassport());

                    PickParam(Params).Clear().SetError(aPU.GetError());
                }
            }
            catch (Exception ex1)
            {
                PickParam(Params).Clear().SetError(ex1.Message);
            }
        }
Example #26
0
        private void VerifyPasswrod(Hashtable Params)
        {
            string account = PickParam(Params).GetValueAsString();
            string pwd     = PickParam(Params).GetValueAsString("pwd");
            string type    = PickParam(Params).GetValueAsString("type");

            try
            {
                if (type == "pay")
                {
                    DataSet dsMember = new ParamUtil()
                                       .SQLCmdLoadData()
                                       .SQLWithOutSchema()
                                       .SQLEntityScript("CAIKA_MEMBER", string.Format("SELECT * FROM CAIKA_MEMBER WHERE SSOPST='{0}@caika.com'", account))
                                       .ExecuteCmd(ADataLoader.DataLoader())
                                       .GetValueAsDataSet();

                    DataRow rowMember = dsMember.Tables[0].Rows[0];
                    string  signature = new DictSetUtil(null).DoSignature(pwd);
                    if (signature == rowMember.Field <string>("WITHDRAWALS").Trim())
                    {
                        PickParam(Params).Clear().SetParam(true);
                    }
                    else
                    {
                        PickParam(Params).Clear().SetError("密码输入不正确");
                        PickParam(Params).SetParam(false);
                    }
                }
                else
                {
                    // 得到通行证数据
                    DataSet dsPassport = new ParamUtil()
                                         .SQLCmdLoadData()
                                         .SQLEntityScript("SSODOMAINREF", string.Format("SELECT * FROM SSODOMAINREF WHERE DOMAINNAME='caika.com' AND DOMAINUSER='******'", account))
                                         .SQLEntityScript("SSOPASSPORT", string.Format("SELECT * FROM SSOPASSPORT WHERE SSOPST = '{0}@caika.com'", account))
                                         .ExecuteCmd(ADataLoader.DataLoader())
                                         .GetValueAsDataSet();

                    if (dsPassport.Tables["SSODOMAINREF"].Rows.Count == 0 || dsPassport.Tables["SSOPASSPORT"].Rows.Count == 0)
                    {
                        PickParam(Params).Clear().SetError("用户名或密码错误");
                        PickParam(Params).SetParam(false);
                    }
                    else
                    {
                        ParamUtil aPU = new ParamUtil().SetCmd(CVerifyPasswrod).SetParam(dsPassport).SetParam("PSTPWD", pwd).ExecuteCmd(new APassport());
                        if (aPU.IsOK())
                        {
                            PickParam(Params).Clear();
                            PickParam(Params).SetParam(aPU.GetValue());
                        }
                        else
                        {
                            PickParam(Params).Clear().SetError(aPU.GetError());
                            PickParam(Params).SetParam(false);
                        }
                    }
                }
            }
            catch (Exception)
            {
                PickParam(Params).Clear().SetError("校验密码出错");
                PickParam(Params).SetParam(false);
            }
        }
Example #27
0
        private void GetJournalList(Hashtable Params)
        {
            string account = PickParam(Params).GetValueAsString();

            if (string.IsNullOrEmpty(account))
            {
                throw new ArgumentException("接收到的参数列表存在错误!");
            }

            string type   = PickParam(Params).GetValueAsString("type");
            string time   = PickParam(Params).GetValueAsString("time");
            string pageno = PickParam(Params).GetValueAsString("pageno");

            if (string.IsNullOrEmpty(pageno))
            {
                pageno = "1";
            }

            try
            {
                switch (time)
                {
                case "day1":
                    time = DateTime.Now.ToString("yyyy-MM-dd");
                    break;

                case "month1":
                    time = DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd");
                    break;

                case "month3":
                    time = DateTime.Now.AddMonths(-3).ToString("yyyy-MM-dd");
                    break;

                case "month6":
                    time = DateTime.Now.AddMonths(-6).ToString("yyyy-MM-dd");
                    break;

                default:
                    time = DateTime.Now.AddDays(-6).ToString("yyyy-MM-dd");
                    break;
                }

                string script = string.Format("SELECT * FROM CAIKA_MEMBER_JOURNAL WHERE ACCOUNTID='{0}' AND JOURNALTIME>='{1}'", account, time);
                switch (type)
                {
                case "deposit":
                    script += string.Format(" AND TYPE='{0}'", journal_type.充值);
                    break;

                case "withdraw":
                    script += string.Format(" AND TYPE='{0}'", journal_type.提现);
                    break;

                case "consume":
                    script += string.Format(" AND TYPE='{0}'", journal_type.投注);
                    break;

                case "bonus":
                    script += string.Format(" AND TYPE='{0}'", journal_type.中奖);
                    break;

                case "cancel":
                    script += string.Format(" AND TYPE='{0}'", journal_type.撤单);
                    break;

                case "returned":
                    script += string.Format(" AND TYPE='{0}'", journal_type.返点);
                    break;

                case "exchanged":
                    script += string.Format(" AND TYPE='{0}'", journal_type.积分兑换);
                    break;

                case "activity":
                    script += string.Format(" AND TYPE='{0}'", journal_type.活动派送);
                    break;
                }

                DataSet ds_list = new ParamUtil()
                                  .SQLCmdLoadData()
                                  .SQLWithOutSchema()
                                  .SQLEntityScript(DictSet.FN_MCCanShu, string.Format("SELECT TYPE MCCanShu,SUM(REQAMOUNT) CanShuZhi FROM CAIKA_MEMBER_JOURNAL WHERE ACCOUNTID='{0}' AND JOURNALTIME>='{1}' AND STATE='{2}' GROUP BY TYPE", account, time, journal_state.已审核))
                                  .SQLEntityScript("list", string.Format(@"SELECT TOP 30 * FROM (SELECT ROW_NUMBER() OVER (ORDER BY JOURNALTIME DESC) ROWNUM,T1.* FROM ({0}) T1) AS A WHERE ROWNUM > 30*({1}-1)", script, pageno))
                                  .SQLEntityScript("pages", string.Format("SELECT CEILING(CAST(COUNT(*) AS FLOAT)/30) FROM CAIKA_MEMBER_JOURNAL WHERE ACCOUNTID='{0}' AND JOURNALTIME>='{1}'", account, time))
                                  .ExecuteCmd(ADataLoader.DataLoader())
                                  .GetValueAsDataSet();

                PickParam(Params).Clear();
                PickParam(Params).SetParam(ds_list);
            }
            catch (Exception ex1)
            {
                PickParam(Params).SetError(ex1.Message);
            }
        }