Esempio n. 1
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);
            }
        }
Esempio n. 2
0
        public JsonResult changeBank()
        {
            Hashtable aHT = Authorizes.GetAuthorizeCache(Request);

            if (aHT != null)
            {
                DictSetUtil ds_digest = new DictSetUtil(new DataSet());
                ds_digest.SetValue("realname", Request["realname"]);
                ds_digest.SetValue("bankno", Request["bankno"]);
                ds_digest.SetValue("bankname", Request["bankname"]);
                ds_digest.SetValue("province", Request["province"]);
                ds_digest.SetValue("province_name", Request["province_name"]);
                ds_digest.SetValue("city", Request["city"]);
                ds_digest.SetValue("city_name", Request["city_name"]);
                ds_digest.SetValue("subbank", Request["subbank"]);
                ds_digest.SetValue("cardnum", Request["cardnum"]);

                ParamUtil aPU = new ParamUtil()
                                .SetCmd(AAccountUtil.CChangeBank)
                                .SetParam(aHT["DOMAINUSER"]).SetParam("c_pass", Request["c_pass"]).SetParam("realname", Request["realname"]).SetParam("digest", ds_digest.MyDS)
                                .ExecuteCmd(new AAccountUtil());
                if (aPU.IsOK())
                {
                    return(Json(new { flag = "y", message = "success" }));
                }
                else
                {
                    return(Json(new { flag = "n", message = aPU.GetError() }));
                }
            }

            return(Json(new { flag = "n", message = "账户登录状态失效" }));
        }
Esempio n. 3
0
        public JsonResult postMember()
        {
            Hashtable aHT = Authorizes.GetAuthorizeCache(Request);

            if (aHT != null)
            {
                DictSetUtil ds_member = new DictSetUtil(new DataSet());
                ds_member.SetValue("nickname", Request["nickname"]);
                ds_member.SetValue("email", Request["email"]);
                ds_member.SetValue("realname", Request["realname"]);
                ds_member.SetValue("idtype", Request["idtype"]);
                ds_member.SetValue("id", Request["id"]);
                ds_member.SetValue("ask", Request["ask"]);
                ds_member.SetValue("answer", Request["answer"]);

                ParamUtil aPU = new ParamUtil()
                                .SetCmd(AAccountUtil.CPostMemberInfo)
                                .SetParam(aHT["DOMAINUSER"]).SetParam("c_pass", Request["c_pass"]).SetParam("member", ds_member.MyDS)
                                .ExecuteCmd(new AAccountUtil());
                if (aPU.IsOK())
                {
                    return(Json(new { flag = "y", message = "success" }));
                }
                else
                {
                    return(Json(new { flag = "n", message = aPU.GetError() }));
                }
            }

            return(Json(new { flag = "n", message = "账户登录状态失效" }));
        }
Esempio n. 4
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);
        }
Esempio n. 5
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());
                    }
                }
            }
        }
Esempio n. 6
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("注册失败");
            }
        }