示例#1
0
        public static Hashtable Insert(Model.SHMoney model, Hashtable MyHs)
        {
            string        guid   = Guid.NewGuid().ToString();
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into SHMoney(");
            strSql.Append("MAgencyType,MColor,ViewLevel,TJCount,TJAgency,TemaCount,DTopMoney,SQHelpCount,XYLastMemberCount,XFMouthMinHelpMoney,XFMounthMoney,MAgencyName,InitMaxTZ,XYFloat,Money,BTFloat,TJFloat,TXFloat,TakeOffFloat,ReBuyFloat,MCWFloat");
            strSql.Append(") values (");
            strSql.Append("@MAgencyType,@MColor,@ViewLevel,@TJCount,@TJAgency,@TemaCount,@DTopMoney,@SQHelpCount,@XYLastMemberCount,@XFMouthMinHelpMoney,@XFMounthMoney,@MAgencyName,@InitMaxTZ,@XYFloat,@Money,@BTFloat,@TJFloat,@TXFloat,@TakeOffFloat,@ReBuyFloat,@MCWFloat");
            strSql.Append(") ");
            strSql.AppendFormat(";select '{0}'", guid);
            SqlParameter[] parameters =
            {
                new SqlParameter("@MAgencyType",         SqlDbType.VarChar, 10),
                new SqlParameter("@MColor",              SqlDbType.VarChar, 10),
                new SqlParameter("@ViewLevel",           SqlDbType.Int,      4),
                new SqlParameter("@TJCount",             SqlDbType.Int,      4),
                new SqlParameter("@TJAgency",            SqlDbType.VarChar, 10),
                new SqlParameter("@TemaCount",           SqlDbType.Int,      4),
                new SqlParameter("@DTopMoney",           SqlDbType.Decimal,  9),
                new SqlParameter("@SQHelpCount",         SqlDbType.Int,      4),
                new SqlParameter("@XYLastMemberCount",   SqlDbType.Int,      4),
                new SqlParameter("@XFMouthMinHelpMoney", SqlDbType.Decimal,  9),
                new SqlParameter("@XFMounthMoney",       SqlDbType.Decimal,  9),
                new SqlParameter("@MAgencyName",         SqlDbType.VarChar, 20),
                new SqlParameter("@InitMaxTZ",           SqlDbType.Int,      4),
                new SqlParameter("@XYFloat",             SqlDbType.Decimal,  9),
                new SqlParameter("@Money",               SqlDbType.VarChar, 50),
                new SqlParameter("@BTFloat",             SqlDbType.Decimal,  9),
                new SqlParameter("@TJFloat",             SqlDbType.Decimal,  9),
                new SqlParameter("@TXFloat",             SqlDbType.Decimal,  9),
                new SqlParameter("@TakeOffFloat",        SqlDbType.Decimal,  9),
                new SqlParameter("@ReBuyFloat",          SqlDbType.Decimal,  9),
                new SqlParameter("@MCWFloat",            SqlDbType.Decimal, 9)
            };

            parameters[0].Value  = model.MAgencyType;
            parameters[1].Value  = model.MColor;
            parameters[2].Value  = model.ViewLevel;
            parameters[3].Value  = model.TJCount;
            parameters[4].Value  = model.TJAgency;
            parameters[5].Value  = model.TemaCount;
            parameters[6].Value  = model.DTopMoney;
            parameters[7].Value  = model.SQHelpCount;
            parameters[8].Value  = model.XYLastMemberCount;
            parameters[9].Value  = model.XFMouthMinHelpMoney;
            parameters[10].Value = model.XFMounthMoney;
            parameters[11].Value = model._MAgencyName;
            parameters[12].Value = model.InitMaxTZ;
            parameters[13].Value = model.XYFloat;
            parameters[14].Value = model.Money;
            parameters[15].Value = model.BTFloat;
            parameters[16].Value = model.TJFloat;
            parameters[17].Value = model.TXFloat;
            parameters[18].Value = model.TakeOffFloat;
            parameters[19].Value = model.ReBuyFloat;
            parameters[20].Value = model.MCWFloat;
            MyHs.Add(strSql.ToString(), parameters);
            return(MyHs);
        }
示例#2
0
        protected override void SetValue()
        {
            sjmodel     = TModel;
            hdmid.Value = sjmodel.MID;
            Model.SHMoney shmoney = null;
            foreach (Model.SHMoney item in BLL.Configuration.Model.SHMoneyList.Values.Where(emp => emp.MAgencyType != "001"))
            {
                MAgencyTypeColor += "<td style='width:60px;color:#00CCFF;'>" + item.MAgencyName + "<br />[" + item.Money + "]</td>";
                if (shmoney == null && item.Money > sjmodel.MAgencyType.Money)
                {
                    shmoney = item;
                }
            }
            //获取次数
            int count = BLL.LuckyMoney.GetModelList(" FHTimes = " + Convert.ToInt32(sjmodel.AgencyCode) + " and MID = '" + sjmodel.MID + "' ").Count;

            if (shmoney != null && count >= sjmodel.MAgencyType.TeamCount)
            {
                //可以升级下一级
                MyMAgencyTypeRdo += "<input name='AgencyTypeList' id='" + shmoney.MAgencyType + "' value='" + shmoney.MAgencyType + "' type='radio' />" + shmoney.MAgencyName + "[" + (shmoney.Money - sjmodel.MAgencyType.Money) + "]&nbsp;";
            }
            if (string.IsNullOrEmpty(MyMAgencyTypeRdo))
            {
                MyMAgencyTypeRdo += "暂不可升级";
            }
        }
示例#3
0
        public string UpMAgencyType(Model.SHMoney shmoney, string mid, string moneyType, Model.Member shmodel, decimal appendMoney, string bdmid = "")
        {
            Model.Member model = DAL.Member.GetModel(mid);
            if (model == null)
            {
                return("升级会员不存在");
            }

            decimal   sjmoney = appendMoney;
            Hashtable MyHs    = new Hashtable();

            lock (DAL.Member.tempMemberList)
            {
                DAL.Member.tempMemberList.Clear();
                DAL.Member.tempMemberAdd(model);

                {
                    string PCode = "005";//升级
                    if (!model.MState)
                    {
                        string error = Validation2(model, shmoney);
                        if (!string.IsNullOrEmpty(error))
                        {
                            return(error);
                        }
                        PCode = "001";//激活升级
                        model.MConfig.YJCount += 1;
                        DAL.MemberConfig.UpdateConfigTran(model.MID, "YJCount", "1", model, false, SqlDbType.Int, MyHs);
                        model.MConfig.JTFHState = true;
                        DAL.MemberConfig.UpdateConfigTran(model.MID, "JTFHState", "1", model, true, SqlDbType.Bit, MyHs);
                        model.MConfig.DTFHState = true;
                        DAL.MemberConfig.UpdateConfigTran(model.MID, "DTFHState", "1", model, true, SqlDbType.Bit, MyHs);

                        model.RoleCode  = "Nomal";
                        model.Role      = BLL.Roles.RolsList["Nomal"];
                        model.MDate     = DateTime.Now;
                        model.MState    = true;
                        model.FHState   = false;
                        model.ValidTime = DateTime.Now;
                    }
                    if (shmoney != null)
                    {
                        // 二次升级的奖金按照升级之前的级别拿比例
                        model.AgencyCode  = shmoney.MAgencyType;
                        model.MAgencyType = shmoney;
                    }

                    DAL.Member.UpdateRole(model, MyHs);
                    if (DAL.CommonBase.RunHashtable(MyHs))
                    {
                        DAL.Member.tempMemberList.Clear();   //清空临时字典
                        DAL.BMember.tempBMemberList.Clear(); //清空临时字典

                        return("1");
                    }
                }
            }
            return("升级失败");
        }
示例#4
0
        public static string Validation2(Model.Member shmodel, Model.SHMoney sh = null)
        {
            Model.Member MTJ = DAL.Member.GetModel(shmodel.MTJ);
            //Model.Member MSH = DAL.Member.GetModel(shmodel.MSH);
            Model.Member MBD = DAL.Member.GetModel(shmodel.MBD);


            return("");
        }
示例#5
0
        public static Hashtable Insert(Model.SHMoney model, Hashtable MyHs)
        {
            string        guid   = Guid.NewGuid().ToString();
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into SHMoney(");
            strSql.Append("MAgencyType,MAgencyName,Money,BTFloat,TJFloat,TXFloat,TakeOffFloat,ReBuyFloat,MCWFloat,MColor,ViewLevel,TJCount,YJMoney,TeamCount,teamPer,MinTeamMoney,SubCount,DPFloat,DPTopMoney)");
            strSql.Append(" values (");
            strSql.Append("@MAgencyType,@MAgencyName,@Money,@BTFloat,@TJFloat,@TXFloat,@TakeOffFloat,@ReBuyFloat,@MCWFloat,@MColor,@ViewLevel,@TJCount,@YJMoney,@TeamCount,@teamPer,@MinTeamMoney,@SubCount,@DPFloat,@DPTopMoney)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@MAgencyType",  SqlDbType.VarChar, 10),
                new SqlParameter("@MAgencyName",  SqlDbType.VarChar, 20),
                new SqlParameter("@Money",        SqlDbType.VarChar, 50),
                new SqlParameter("@BTFloat",      SqlDbType.Decimal,  9),
                new SqlParameter("@TJFloat",      SqlDbType.Decimal,  9),
                new SqlParameter("@TXFloat",      SqlDbType.Decimal,  9),
                new SqlParameter("@TakeOffFloat", SqlDbType.Decimal,  9),
                new SqlParameter("@ReBuyFloat",   SqlDbType.Decimal,  9),
                new SqlParameter("@MCWFloat",     SqlDbType.Decimal,  9),
                new SqlParameter("@MColor",       SqlDbType.VarChar, 10),
                new SqlParameter("@ViewLevel",    SqlDbType.Int,      4),
                new SqlParameter("@TJCount",      SqlDbType.Int,      4),
                new SqlParameter("@YJMoney",      SqlDbType.Decimal,  9),
                new SqlParameter("@TeamCount",    SqlDbType.Int,      4),
                new SqlParameter("@teamPer",      SqlDbType.Decimal,  9),
                new SqlParameter("@MinTeamMoney", SqlDbType.Decimal,  9),
                new SqlParameter("@SubCount",     SqlDbType.Int,      4),
                new SqlParameter("@DPFloat",      SqlDbType.Decimal,  9),
                new SqlParameter("@DPTopMoney",   SqlDbType.Decimal, 9)
            };
            parameters[0].Value  = model.MAgencyType;
            parameters[1].Value  = model._MAgencyName;
            parameters[2].Value  = model.Money;
            parameters[3].Value  = model.BTFloat;
            parameters[4].Value  = model.TJFloat;
            parameters[5].Value  = model.TXFloat;
            parameters[6].Value  = model.TakeOffFloat;
            parameters[7].Value  = model.ReBuyFloat;
            parameters[8].Value  = model.MCWFloat;
            parameters[9].Value  = model.MColor;
            parameters[10].Value = model.ViewLevel;
            parameters[11].Value = model.TJCount;
            parameters[12].Value = model.YJMoney;
            parameters[13].Value = model.TeamCount;
            parameters[14].Value = model.teamPer;
            parameters[15].Value = model.MinTeamMoney;
            parameters[16].Value = model.SubCount;
            parameters[17].Value = model.DPFloat;
            parameters[18].Value = model.DPTopMoney;

            strSql.AppendFormat(";select '{0}'", guid);
            MyHs.Add(strSql.ToString(), parameters);
            return(MyHs);
        }
示例#6
0
        public static List <Model.SHMoney> GetSHMoneyList()
        {
            List <Model.SHMoney> list = new List <Model.SHMoney>();
            DataTable            dt   = GetSHMoneyListDataTable();

            foreach (DataRow dr in dt.Rows)
            {
                Model.SHMoney model = TranEntity(dr);
                list.Add(model);
            }

            return(list);
        }
示例#7
0
        protected override string btnModify_Click()
        {
            //判断是否信息完整
            if (string.IsNullOrEmpty(TModel.BankCardName) || (string.IsNullOrEmpty(TModel.BankNumber) && string.IsNullOrEmpty(TModel.NumID)))
            {
                return("请先完善资料");
            }

            //校验激活码
            string activeCode = Request.Form["txtActiveCode"];

            Model.ActiveCode list = BLL.ActiveCode.GetList("Code='" + activeCode + "' and UseState not in (2,4)").FirstOrDefault();
            if (list == null)
            {
                return("激活码无效");
            }

            Model.SHMoney shmoney = BLL.Configuration.Model.SHMoneyList["002"];//默认002
            //if (BLL.ChangeMoney.EnoughChange(TModel.MID, BLL.Configuration.Model.YLMoney, "MHB"))
            //{
            try
            {
                if (BLL.Member.upmidlist.Contains(TModel.MID))
                {
                    return("2");
                }
                else
                {
                    BLL.Member.upmidlist.Add(TModel.MID);
                }

                Hashtable MyHs = new Hashtable();
                list.UseMID   = TModel.MID;
                list.UseState = 2;
                list.UseTime  = DateTime.Now;
                BLL.ActiveCode.Update(list, MyHs);
                return(BllModel.UpMAgencyType(shmoney, TModel.MID, TModel, 0, MyHs));
            }
            finally
            {
                if (BLL.Member.upmidlist.Contains(TModel.MID))
                {
                    BLL.Member.upmidlist.Remove(TModel.MID);
                }
            }
            //}
            //else
            //{
            //    return "您的激活币账号余额不足";
            //}
        }
示例#8
0
 protected override string btnModify_Click()
 {
     //if (Check_SQ_Answer())
     //{
     sjmodel = TModel;
     if (!string.IsNullOrEmpty(Request.Form["hdmid"]))
     {
         sjmodel = BllModel.GetModel(Request.Form["hdmid"]);
     }
     if (BLL.Configuration.Model.SHMoneyList.ContainsKey(Request.Form["AgencyTypeList"]))
     {
         Model.SHMoney shmoney = BLL.Configuration.Model.SHMoneyList[Request.Form["AgencyTypeList"]];
         if (BLL.ChangeMoney.EnoughChange(TModel.MID, shmoney.Money - sjmodel.MAgencyType.Money, "MJB"))
         {
             try
             {
                 if (BLL.Member.upmidlist.Contains(sjmodel.MID))
                 {
                     return("升级处理中,请等待!");
                 }
                 else
                 {
                     BLL.Member.upmidlist.Add(sjmodel.MID);
                 }
                 Hashtable MyHs = new Hashtable();
                 return(BllModel.UpMAgencyType(shmoney, Request.Form["hdmid"], TModel, shmoney.Money - sjmodel.MConfig.SHMoney, MyHs));
             }
             finally
             {
                 if (BLL.Member.upmidlist.Contains(sjmodel.MID))
                 {
                     BLL.Member.upmidlist.Remove(sjmodel.MID);
                 }
             }
         }
         else
         {
             return("您的账号余额不足");
         }
     }
     else
     {
         return("未知会员级别");
     }
     //}
     //else
     //    return "密保问题错误*";
 }
示例#9
0
 public static Model.SHMoney GetModelByStr(string strWhere)
 {
     Model.SHMoney model = null;
     if (!string.IsNullOrEmpty(strWhere))
     {
         StringBuilder strSql = new StringBuilder();
         strSql.Append("select *,Money + ' (' + MAgencyName + ')' as 'MoneyMAgencyName' ");
         strSql.AppendFormat(" FROM SHMoney where {0} ", strWhere);
         DataTable dt = DbHelperSQL.Query(strSql.ToString()).Tables[0];
         if (dt != null && dt.Rows.Count > 0)
         {
             model = TranEntity(dt.Rows[0]);
         }
     }
     return(model);
 }
示例#10
0
        /// <summary>
        /// 得到绑定列表
        /// </summary>
        /// <returns></returns>
        public static Dictionary <string, Model.SHMoney> GetSHMoneyList(DataTable table)
        {
            Dictionary <string, Model.SHMoney> SHMoneyList = new Dictionary <string, Model.SHMoney>();

            if (table == null)
            {
                table = GetSHMoneyListDataTable();
            }

            foreach (DataRow dr in table.Rows)
            {
                Model.SHMoney model = TranEntity(dr);
                SHMoneyList.Add(model.MAgencyType, model);
            }

            return(SHMoneyList);
        }
示例#11
0
 protected override string btnModify_Click()
 {
     sjmodel = TModel;
     if (!string.IsNullOrEmpty(Request.Form["hdmid"]))
     {
         sjmodel = BllModel.GetModel(Request.Form["hdmid"]);
     }
     if (BLL.Configuration.Model.SHMoneyList.ContainsKey(Request.Form["AgencyTypeList"]))
     {
         Model.SHMoney shmoney = BLL.Configuration.Model.SHMoneyList[Request.Form["AgencyTypeList"]];
         if (BLL.ChangeMoney.EnoughChange(TModel.MID, shmoney.Money - sjmodel.MAgencyType.Money, "MJB"))
         {
             try
             {
                 if (BLL.Member.upmidlist.Contains(sjmodel.MID))
                 {
                     return("升级处理中,请等待!");
                 }
                 else
                 {
                     BLL.Member.upmidlist.Add(sjmodel.MID);
                 }
                 return(BllModel.UpMAgencyType(shmoney, Request.Form["hdmid"], "MJB", TModel, shmoney.Money - sjmodel.MConfig.SHMoney));
             }
             finally
             {
                 if (BLL.Member.upmidlist.Contains(sjmodel.MID))
                 {
                     BLL.Member.upmidlist.Remove(sjmodel.MID);
                 }
             }
         }
         else
         {
             return("您的报单币账户余额不足");
         }
     }
     else
     {
         return("未知会员级别");
     }
 }
示例#12
0
        protected override string btnAdd_Click()
        {
            //查询是否申请过了
            Model.MemberApply app = BLL.MemberApply.CheckHasApplyed(TModel.MID, 0, Request.Form["rdoupmagecy"]);
            if (app != null)
            {
                return("您已经申请过了,请等待管理员审核。");
            }

            Model.SHMoney shmoney = BLL.Configuration.Model.SHMoneyList[Request.Form["rdoupmagecy"]];
            //查看直推人数
            if (TModel.MConfig.TJCount < shmoney.TJCount || TModel.MConfig.YJCount < shmoney.TemaCount)
            {
                return("申请失败,要申请到" + shmoney.MAgencyName + ",必须达到推荐人数" + shmoney.TJCount + ",团队人数" + shmoney.TemaCount);
            }
            else
            {
                //查询推荐人数中有多少经理,高级经理,
                string sql      = "select count(1) from Member WHERE MTJ='" + TModel.MID + "' AND AgencyCode='" + shmoney.TJAgency + "'";
                object objCount = BLL.CommonBase.GetSingle(sql);
                if (Convert.ToInt16(objCount) < shmoney.TJCount || TModel.MConfig.YJCount < shmoney.TemaCount)
                {
                    return("申请失败,您的推荐人数不足或团队人数不足");
                }
                else
                {
                    Model.MemberApply apply = new Model.MemberApply();
                    apply.ApplyTime = DateTime.Now;
                    apply.ApplyType = shmoney.MAgencyType;
                    apply.MID       = TModel.MID;
                    apply.MTel      = TModel.Tel;
                    apply.State     = 0;
                    if (BLL.MemberApply.Insert(apply))
                    {
                        return("申请成功,请等待管理员审核。");
                    }
                }
            }
            return("申请失败");
        }
示例#13
0
        /// <summary>
        /// 转换数据实体
        /// </summary>
        /// <param name="table"></param>
        /// <returns></returns>
        private static Model.SHMoney TranEntity(DataRow row)
        {
            if (row != null)
            {
                Model.SHMoney model = new Model.SHMoney();

                if (row["MAgencyType"] != null)
                {
                    model.MAgencyType = row["MAgencyType"].ToString();
                }
                if (row["MAgencyName"] != null)
                {
                    model._MAgencyName = row["MAgencyName"].ToString();
                }
                if (row["Money"] != null && row["Money"].ToString() != "")
                {
                    model.Money = int.Parse(row["Money"].ToString());
                }
                if (row["BTFloat"] != null && row["BTFloat"].ToString() != "")
                {
                    model.BTFloat = decimal.Parse(row["BTFloat"].ToString());
                }
                if (row["TJFloat"] != null && row["TJFloat"].ToString() != "")
                {
                    model.TJFloat = decimal.Parse(row["TJFloat"].ToString());
                }
                if (row["TXFloat"] != null && row["TXFloat"].ToString() != "")
                {
                    model.TXFloat = decimal.Parse(row["TXFloat"].ToString());
                }
                if (row["TakeOffFloat"] != null && row["TakeOffFloat"].ToString() != "")
                {
                    model.TakeOffFloat = decimal.Parse(row["TakeOffFloat"].ToString());
                }
                if (row["ReBuyFloat"] != null && row["ReBuyFloat"].ToString() != "")
                {
                    model.ReBuyFloat = decimal.Parse(row["ReBuyFloat"].ToString());
                }
                if (row["MCWFloat"] != null && row["MCWFloat"].ToString() != "")
                {
                    model.MCWFloat = decimal.Parse(row["MCWFloat"].ToString());
                }
                if (row["MColor"] != null)
                {
                    model.MColor = row["MColor"].ToString();
                }
                if (row["ViewLevel"] != null && row["ViewLevel"].ToString() != "")
                {
                    model.ViewLevel = int.Parse(row["ViewLevel"].ToString());
                }
                if (row["TJCount"] != null && row["TJCount"].ToString() != "")
                {
                    model.TJCount = int.Parse(row["TJCount"].ToString());
                }
                if (row["YJMoney"] != null && row["YJMoney"].ToString() != "")
                {
                    model.YJMoney = decimal.Parse(row["YJMoney"].ToString());
                }
                if (row["TeamCount"] != null && row["TeamCount"].ToString() != "")
                {
                    model.TeamCount = int.Parse(row["TeamCount"].ToString());
                }
                if (row["teamPer"] != null && row["teamPer"].ToString() != "")
                {
                    model.teamPer = decimal.Parse(row["teamPer"].ToString());
                }
                if (row["MinTeamMoney"] != null && row["MinTeamMoney"].ToString() != "")
                {
                    model.MinTeamMoney = decimal.Parse(row["MinTeamMoney"].ToString());
                }
                if (row["SubCount"] != null && row["SubCount"].ToString() != "")
                {
                    model.SubCount = int.Parse(row["SubCount"].ToString());
                }
                if (row["DPFloat"] != null && row["DPFloat"].ToString() != "")
                {
                    model.DPFloat = decimal.Parse(row["DPFloat"].ToString());
                }
                if (row["DPTopMoney"] != null && row["DPTopMoney"].ToString() != "")
                {
                    model.DPTopMoney = decimal.Parse(row["DPTopMoney"].ToString());
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }
示例#14
0
        protected override string btnModify_Click()
        {
            //if (Check_SQ_Answer())
            //{

            sjmodel = TModel;
            if (!string.IsNullOrEmpty(Request.Form["hdmid"]))
            {
                sjmodel = BllModel.GetModel(Request.Form["hdmid"]);
            }

            //if (!sjmodel.MState)
            //{
            //    if (string.IsNullOrWhiteSpace(Request.Form["txtMBD"]))
            //    {
            //        return "接点人不能为空";
            //    }
            //}

            if (BLL.Configuration.Model.SHMoneyList.ContainsKey(Request.Form["AgencyTypeList"]))
            {
                Model.SHMoney shmoney = BLL.Configuration.Model.SHMoneyList[Request.Form["AgencyTypeList"]];
                if (BLL.ChangeMoney.EnoughChange(TModel.MID, shmoney.Money - sjmodel.MAgencyType.Money, "MJB"))
                {
                    try
                    {
                        if (BLL.Member.upmidlist.Contains(sjmodel.MID))
                        {
                            return("升级处理中,请等待!");
                        }
                        else
                        {
                            BLL.Member.upmidlist.Add(sjmodel.MID);
                        }
                        var result = BllModel.UpMAgencyType(shmoney, Request.Form["hdmid"], "MJB", TModel, shmoney.Money - sjmodel.MConfig.SHMoney, Request.Form["txtMBD"]);
                        if (TModel.Role.IsAdmin)
                        {
                            BLL.OperationRecordBLL.Add(TModel.MID, ChangeType.O_SJHY, "升级会员");
                        }
                        return(result);
                    }
                    finally
                    {
                        if (BLL.Member.upmidlist.Contains(sjmodel.MID))
                        {
                            BLL.Member.upmidlist.Remove(sjmodel.MID);
                        }
                    }
                }
                else
                {
                    return("您的" + BLL.Reward.List["MJB"].RewardName + "账户余额不足");
                }
            }
            else
            {
                return("未知会员级别");
            }
            //}
            //else
            //    return "密保问题错误*";
        }
示例#15
0
        /// <summary>
        /// 转换数据实体
        /// </summary>
        /// <param name="table"></param>
        /// <returns></returns>
        private static Model.SHMoney TranEntity(DataRow dr)
        {
            if (dr != null)
            {
                Model.SHMoney model = new Model.SHMoney();

                model.MAgencyType = dr["MAgencyType"].ToString();
                model.MColor      = dr["MColor"].ToString();
                if (!string.IsNullOrEmpty(dr["ViewLevel"].ToString()))
                {
                    model.ViewLevel = int.Parse(dr["ViewLevel"].ToString());
                }
                if (!string.IsNullOrEmpty(dr["TJCount"].ToString()))
                {
                    model.TJCount = int.Parse(dr["TJCount"].ToString());
                }
                model.TJAgency = dr["TJAgency"].ToString();
                if (!string.IsNullOrEmpty(dr["TemaCount"].ToString()))
                {
                    model.TemaCount = int.Parse(dr["TemaCount"].ToString());
                }
                if (!string.IsNullOrEmpty(dr["DTopMoney"].ToString()))
                {
                    model.DTopMoney = decimal.Parse(dr["DTopMoney"].ToString());
                }
                if (!string.IsNullOrEmpty(dr["SQHelpCount"].ToString()))
                {
                    model.SQHelpCount = int.Parse(dr["SQHelpCount"].ToString());
                }
                if (!string.IsNullOrEmpty(dr["XYLastMemberCount"].ToString()))
                {
                    model.XYLastMemberCount = int.Parse(dr["XYLastMemberCount"].ToString());
                }
                if (!string.IsNullOrEmpty(dr["XFMouthMinHelpMoney"].ToString()))
                {
                    model.XFMouthMinHelpMoney = decimal.Parse(dr["XFMouthMinHelpMoney"].ToString());
                }
                if (!string.IsNullOrEmpty(dr["XFMounthMoney"].ToString()))
                {
                    model.XFMounthMoney = decimal.Parse(dr["XFMounthMoney"].ToString());
                }
                model.MAgencyName = dr["MAgencyName"].ToString();
                if (!string.IsNullOrEmpty(dr["InitMaxTZ"].ToString()))
                {
                    model.InitMaxTZ = int.Parse(dr["InitMaxTZ"].ToString());
                }
                if (!string.IsNullOrEmpty(dr["XYFloat"].ToString()))
                {
                    model.XYFloat = decimal.Parse(dr["XYFloat"].ToString());
                }
                if (!string.IsNullOrEmpty(dr["Money"].ToString()))
                {
                    model.Money = int.Parse(dr["Money"].ToString());
                }
                if (!string.IsNullOrEmpty(dr["BTFloat"].ToString()))
                {
                    model.BTFloat = decimal.Parse(dr["BTFloat"].ToString());
                }
                if (!string.IsNullOrEmpty(dr["TJFloat"].ToString()))
                {
                    model.TJFloat = decimal.Parse(dr["TJFloat"].ToString());
                }
                if (!string.IsNullOrEmpty(dr["TXFloat"].ToString()))
                {
                    model.TXFloat = decimal.Parse(dr["TXFloat"].ToString());
                }
                if (!string.IsNullOrEmpty(dr["TakeOffFloat"].ToString()))
                {
                    model.TakeOffFloat = decimal.Parse(dr["TakeOffFloat"].ToString());
                }
                if (!string.IsNullOrEmpty(dr["ReBuyFloat"].ToString()))
                {
                    model.ReBuyFloat = decimal.Parse(dr["ReBuyFloat"].ToString());
                }
                if (!string.IsNullOrEmpty(dr["MCWFloat"].ToString()))
                {
                    model.MCWFloat = decimal.Parse(dr["MCWFloat"].ToString());
                }

                return(model);
            }
            else
            {
                return(null);
            }
        }
示例#16
0
        public static string UpMAgencyType(Model.SHMoney shmoney, string mid, string moneyType, Model.Member shmodel, decimal appendMoney, Hashtable MyHs)
        {
            Model.Member model = DAL.Member.GetModel(mid);
            if (model == null)
            {
                return("升级会员不存在");
            }
            if (string.IsNullOrEmpty(model.MTJ))
            {
                return("请联系管理员设置您的推荐人");
            }
            decimal sjmoney = appendMoney;

            lock (DAL.Member.tempMemberList)
            {
                DAL.Member.tempMemberList.Clear();
                DAL.Member.tempMemberAdd(model);
                DAL.Member._CPList.Clear();
                if (!BLL.ChangeMoney.EnoughChange(shmodel.MID, sjmoney, moneyType))
                {
                    return("您的" + BLL.Reward.List[moneyType].RewardName + "不足");
                }
                if (BLL.ChangeMoney.HBChangeTran(sjmoney, shmodel.MID, ManageMember.TModel.MID, "SH", model, moneyType, model.MAgencyType._MAgencyName + " -> " + shmoney._MAgencyName, MyHs) > 0)
                {
                    model.MConfig.YJMoney += (int)sjmoney;
                    DAL.MemberConfig.UpdateConfigTran(model.MID, "YJMoney", sjmoney.ToString(), model, false, SqlDbType.Int, MyHs);

                    model.SHMoney += (int)sjmoney;
                    string PCode = "005";//升级
                    if (!model.MState)
                    {
                        string error = Validation2(model, shmoney);
                        if (!string.IsNullOrEmpty(error))
                        {
                            return(error);
                        }
                        PCode = "001";//激活升级
                        model.MConfig.YJCount += 1;
                        DAL.MemberConfig.UpdateConfigTran(model.MID, "YJCount", "1", model, false, SqlDbType.Int, MyHs);
                        model.MConfig.JTFHState = true;
                        DAL.MemberConfig.UpdateConfigTran(model.MID, "JTFHState", "1", model, true, SqlDbType.Bit, MyHs);
                        model.MConfig.DTFHState = true;
                        DAL.MemberConfig.UpdateConfigTran(model.MID, "DTFHState", "1", model, true, SqlDbType.Bit, MyHs);
                        model.MConfig.UpSumMoney += (int)sjmoney;
                        DAL.MemberConfig.UpdateConfigTran(model.MID, "UpSumMoney", sjmoney.ToString(), model, false, SqlDbType.Int, MyHs);

                        model.RoleCode  = "Nomal";
                        model.Role      = BLL.Roles.RolsList["Nomal"];
                        model.MDate     = DateTime.Now;
                        model.MState    = true;
                        model.FHState   = false;
                        model.ValidTime = DateTime.Now;
                    }
                    if (shmoney != null)
                    {
                        // 二次升级的奖金按照升级之前的级别拿比例
                        model.AgencyCode  = shmoney.MAgencyType;
                        model.MAgencyType = shmoney;
                        if (model.AgencyCode == "004")
                        {
                            model.RoleCode = "VIP";
                        }
                    }

                    DAL.Member.UpdateRole(model, MyHs);

                    Model.Accounts account = new Model.Accounts()
                    {
                        AccountsDate = DateTime.MaxValue,
                        ACode        = model.MID + "_" + DateTime.Now.ToString("yyyyMMddHHmmss"),
                        CreateDate   = DateTime.Now,
                        IfAccount    = false,
                        IsAuto       = true,
                        PCode        = PCode,
                        TotalFHMoney = 0,
                        FHCount      = 0,
                        ARemark      = model.MID
                    };

                    BLL.Accounts.BDInsert(account, MyHs);

                    if (DAL.CommonBase.RunHashtable(MyHs))
                    {
                        DAL.Member.tempMemberList.Clear();   //清空临时字典
                        DAL.BMember.tempBMemberList.Clear(); //清空临时字典
                        DAL.Member._CPList.Clear();

                        return("恭喜您升级成功,本次消耗" + sjmoney.ToString("F2"));
                    }
                }
            }
            return("");
        }
示例#17
0
        public string UpMAgencyTypeJZZ(Model.SHMoney shmoney, string mid, Model.Member shmodel, int appendMoney)
        {
            Hashtable MyHs = new Hashtable();

            Model.Member model      = DAL.Member.GetModel(mid);
            string       agencyCode = model.AgencyCode;

            if (model == null)
            {
                return("升级会员不存在");
            }
            if (string.IsNullOrEmpty(model.MTJ))
            {
                return("请联系管理员设置您的推荐人");
            }
            int sjmoney = shmoney.Money - model.MAgencyType.Money;

            lock (DAL.Member.tempMemberList)
            {
                //DAL.Member.tempMemberList.Clear();
                //DAL.Member.tempMemberAdd(model);
                //if (!BLL.ChangeMoney.EnoughChange(shmodel.MID, BLL.Configuration.Model.JTFHMoney, "MCW"))
                //    return "您的金种子积分不足,不能激活金种子会员";
                //if (BLL.ChangeMoney.HBChangeTran(BLL.Configuration.Model.JTFHMoney, shmodel.MID, ManageMember.TModel.MID, "SH", model, "MCW", model.MAgencyType.MAgencyName + "->" + shmoney.MAgencyName, MyHs) > 0)
                //{
                //    model.MConfig.YJMoney += sjmoney;
                //    DAL.MemberConfig.UpdateConfigTran(model.MID, "YJMoney", sjmoney.ToString(), model, false, SqlDbType.Int, MyHs);
                //    model.SHMoney += sjmoney;
                //    string PCode = "005";//升级
                //    if (!model.MState)
                //    {
                //        PCode = "001";//激活升级
                //        model.MSH = shmodel.MID;
                //        string error = Validation2(model);
                //        if (!string.IsNullOrEmpty(error))
                //        {
                //            return error;
                //        }
                //        model.MConfig.YJCount += 1;
                //        DAL.MemberConfig.UpdateConfigTran(model.MID, "YJCount", "1", model, false, SqlDbType.Int, MyHs);
                //        model.MConfig.JTFHState = true;
                //        DAL.MemberConfig.UpdateConfigTran(model.MID, "JTFHState", "1", model, true, SqlDbType.Bit, MyHs);
                //        model.MConfig.DTFHState = false;
                //        DAL.MemberConfig.UpdateConfigTran(model.MID, "DTFHState", "0", model, true, SqlDbType.Bit, MyHs);
                //        model.MConfig.UpSumMoney += 1;
                //        DAL.MemberConfig.UpdateConfigTran(model.MID, "UpSumMoney", "1", model, false, SqlDbType.Int, MyHs);

                //        model.RoleCode = "Nomal";
                //        model.Role = BLL.Roles.RolsList["Nomal"];
                //        model.MDate = DateTime.Now;
                //        model.MState = true;
                //        model.FHState = true;
                //        model.ValidTime = DateTime.Now;
                //    }
                //    // 二次升级的奖金按照升级之前的级别拿比例
                //    model.AgencyCode = shmoney.MAgencyType;
                //    model.MAgencyType = shmoney;
                //    model.MSH = shmodel.MID;

                //    DAL.Member.UpdateRole(model, MyHs);
                //    Model.Accounts account = new Model.Accounts()
                //    {
                //        AccountsDate = DateTime.MaxValue,
                //        ACode = model.MID + "_" + DateTime.Now.ToString("yyyyMMddHHmmss"),
                //        CreateDate = DateTime.Now,
                //        IfAccount = false,
                //        IsAuto = true,
                //        PCode = PCode,
                //        TotalFHMoney = 0,
                //        FHCount = 0,
                //        ARemark = model.MID
                //    };
                //    if (model.MSH != shmodel.MID)
                //        account.ID = -1;
                //    BLL.Accounts.BDInsert(account, MyHs, false);

                //    if (DAL.CommonBase.RunHashtable(MyHs))
                //    {
                //        DAL.Member.tempMemberList.Clear();//清空临时字典
                //        return "恭喜您成功升级至" + shmoney.MAgencyName + ",本次消耗" + sjmoney;
                //    }
                //}
            }
            return("升级失败");
        }