Example #1
0
 public static Hashtable Insert(Model.Member member, Hashtable MyHs)
 {
     Model.BMember model = new Model.BMember();
     model.AMID         = member.MID;
     model.AMember      = member;
     model.BMCreateDate = DateTime.Now;
     model.BMDate       = DateTime.Now;
     model.BMState      = true;
     model.YJCount      = 0;
     model.YJMoney      = 0;
     model.BIsClock     = false;
     model.BCount       = 0;
     model.sort         = GetMaxCount() + 1;       //获取编号
     model.BMBD         = GetBMBDTemp(model.sort); //获取接点人
     model.BMID         = GetBMIDTemp(member);     //获取B网编号
     Insert(model, MyHs);
     //BLL.ChangeMoney.R_BJD(model, member, 1, MyHs);
     return(MyHs);
 }
Example #2
0
        public override void ProcessRequest(HttpContext context)
        {
            #region 双轨
            StringBuilder tempsb = new StringBuilder();
            tempsb.Append("<li><table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" class=\"tablefilter\"><tbody>");
            if (TModel.Role.IsAdmin)
            {
                tempsb.Append("<tr align=\"center\" bgcolor=\"{7}\"><td colspan=\"2\" class=\"tdfilter\"><a href=\"javascript:void(0);\" onclick=\"GetAjaxInfoB('{0}')\">ID:{1}</a></td></tr>");
            }
            else
            {
                tempsb.Append("<tr align=\"center\" bgcolor=\"{7}\"><td colspan=\"2\" class=\"tdfilter\"><a href=\"javascript:void(0);\">ID:{1}</a></td></tr>");
            }
            tempsb.Append("<tr align=\"center\"><td colspan=\"2\" class=\"tdfilter\"><table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" width=\"100%\"><tbody>");
            tempsb.Append("<tr bgcolor=\"#C0C0C0\" style=\"display: none;\"><td colspan=\"3\">{2}</td></tr>");
            tempsb.Append("<tr bgcolor=\"#C0C0C0\" style=\"display: none;\"><td class=\"l\">{3}人</td><td class=\"m\">市场</td><td class=\"r\">{4}人</td></tr>");
            tempsb.Append("<tr bgcolor=\"#C0C0C0\" style=\"display: none;\"><td class=\"l\">{5}</td><td class=\"m\">业绩</td><td class=\"r\">{6}</td></tr>");
            tempsb.Append("</tbody></table></td></tr></tbody></table>");
            tempMysb    = tempsb.ToString();
            tempEmptysb = "<li><table cellspacing=\"0\" cellpadding=\"0\" style='width:60px;'><tbody><tr align=\"center\" style=\"display: none;\"><td valign=\"middle\" height=\"100%\"><a href=\"javascript:void(0);\" onclick=\"javascript:callhtml('Member/Add.aspx?mid={0}')\">[空位]<br/><br/>注册</a></td></tr></tbody></table>";
            tempkwsb    = "<li><table cellspacing=\"0\" cellpadding=\"0\" style='width:60px;'><tbody><tr align=\"center\" style=\"display: none;\"><td valign=\"middle\" height=\"100%\"><br>[空位]</td></tr></tbody></table>";
            #endregion

            #region 太阳线
            //StringBuilder tempsb = new StringBuilder();
            //tempsb.Append("<li><table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" class=\"tablefilter\"><tbody>");
            //tempsb.Append("<tr align=\"center\" bgcolor=\"{7}\"><td colspan=\"2\" class=\"tdfilter\"><a href=\"javascript:void(0);\" onclick=\"GetAjaxInfo('{0}')\">ID:{1}</a></td></tr>");
            //tempsb.Append("<tr align=\"center\"><td colspan=\"2\" class=\"tdfilter\"><table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" width=\"100%\"><tbody>");
            //tempsb.Append("<tr bgcolor=\"#C0C0C0\"><td colspan=\"3\">{2}</td></tr>");
            //tempsb.Append("<tr bgcolor=\"#C0C0C0\"><td class=\"l\">{3}</td><td class=\"m\">人数</td><td class=\"r\">{4}</td></tr>");
            //tempsb.Append("<tr bgcolor=\"#C0C0C0\"><td class=\"l\">¥{5}</td><td class=\"m\">业绩</td><td class=\"r\">¥{6}</td></tr>");
            //tempsb.Append("</tbody></table></td></tr></tbody></table>");
            //tempMysb = tempsb.ToString();
            //tempEmptysb = "<li><table cellspacing=\"0\" cellpadding=\"0\" class=\"tablefilter\"><tbody><tr align=\"center\"><td valign=\"middle\" height=\"100%\"><a href=\"javascript:AddMember('{0}')\">[空位]<br/><br/>注册</a></td></tr></tbody></table>";
            //tempkwsb = "<li><table cellspacing=\"0\" cellpadding=\"0\" class=\"tablefilter\"><tbody><tr align=\"center\"><td valign=\"middle\" height=\"100%\"><br>[空位]</td></tr></tbody></table>";
            #endregion

            int    level = 3;
            string mkey  = TModel.MID;
            string color = "Agency";
            if (!string.IsNullOrEmpty(context.Request["level"]))
            {
                level = int.Parse(context.Request["level"]);
            }
            if (!string.IsNullOrEmpty(context.Request["mkey"]))
            {
                mkey = context.Request["mkey"];
            }
            if (!string.IsNullOrEmpty(context.Request["color"]))
            {
                color = context.Request["color"];
            }

            level = GetLevel(level, ref mkey, true);

            Model.BMember tempmodel   = BLL.BMember.GetModel(mkey);
            string        mbd         = tempmodel.BMBD;
            Model.Member  memberModel = (TModel == null ? BllModel.TModel : TModel);
            if (!memberModel.Role.IsAdmin && mkey == memberModel.MID)
            {
                mbd = "";
            }

            StringBuilder sb = new StringBuilder();
            #region 双轨
            List <Model.BMember> MyListMember  = new List <Model.BMember>();
            List <Model.BMember> AllListMember = new List <Model.BMember>();
            string chileStr = GetStructure(tempmodel.BMID, level, color, ref MyListMember);
            for (int i = 0; i < BLL.Configuration.Model.BDCount; i++)
            {
                if (MyListMember.Count > i)
                {
                    AllListMember.Add(MyListMember[i]);
                }
                else
                {
                    AllListMember.Add(new Model.BMember {
                        YJMoney = 0, YJCount = 0
                    });
                }
            }
            ;
            sb.Append(string.Format(tempMysb, mbd, tempmodel.BMID, GetName(tempmodel.AMember, color),
                                    AllListMember[0].YJCount, AllListMember[1].YJCount,
                                    AllListMember[0].YJMoney, AllListMember[1].YJMoney,
                                    GetColor(tempmodel.AMember, color)));
            sb.Append(chileStr);
            #endregion

            #region 太阳线
            //if (tempmodel.MConfig == null)
            //{
            //    tempmodel.MConfig = new Model.MemberConfig { YJCount = 0, TJCount = 0, YJMoney = 0, TJMoney = 0 };
            //}
            //sb.Append(string.Format(tempMysb, mbd, tempmodel.MID, GetName(tempmodel, color),
            //    tempmodel.MConfig.YJCount, tempmodel.MConfig.TJCount,
            //    tempmodel.MConfig.YJMoney, tempmodel.MConfig.TJMoney,
            //   GetColor(tempmodel, color)));
            //sb.Append(GetStructure(tempmodel.MID, level, color));
            #endregion

            sb.Append("</li>");
            context.Response.Write(Traditionalized(sb));
        }
Example #3
0
        protected override string btnAdd_Click()
        {
            lock (obj)
            {
                string  moneyStr = Request.Form["txtCount"];
                decimal money    = 0;
                try
                {
                    money = Convert.ToDecimal(moneyStr);
                    if (money < 0)
                    {
                        return("复投金额必须大于0");
                    }
                }
                catch
                {
                    return("请输入正确的复投金额");
                }
                int cdday = 0;
                try
                {
                    cdday = Convert.ToInt32(Request.Form["TranDate"]);
                }
                catch (Exception e)
                {
                    return(e.Message);
                }

                Model.ConfigDictionary cd = BLL.Configuration.GetConfigDictionary(cdday, "TranConfig", "");
                if (cd == null)
                {
                    return("请选择正确的投资天数");
                }
                //剩余可复投钱数
                string MoneyType = "MHB";
                if (Request.Form["rdo"] == "MHB")
                {
                    MoneyType = "MHB";
                }
                else if (Request.Form["rdo"] == "MJB")
                {
                    MoneyType = "MJB";
                }

                decimal HelpBase = 0;
                decimal HelpMax  = 0;
                if (MoneyType == "MJB")//许愿池派单
                {
                    HelpBase = BLL.MMMConfig.Model.GetHelpDayTotalMoney;
                    HelpMax  = BLL.MMMConfig.Model.OfferHelpDayTotalMoney * TModel.MConfig.MJB;

                    var lastmodel = BLL.MGetHelp.GetList("  SQMID='" + TModel.MID + "' order by SQDate desc ").FirstOrDefault();
                    if (lastmodel != null)
                    {
                        if (lastmodel.SQMoney > money)
                        {
                            return("您的转入额度不能比上一单小");
                        }
                    }
                    if (money % HelpBase != 0)
                    {
                        return("转入金额应为" + HelpBase + "的倍数");
                    }
                    if (money > HelpMax || money < BLL.MMMConfig.Model.GetHelpMin)
                    {
                        return("转入失败,转入范围应在" + BLL.MMMConfig.Model.GetHelpMin + "-" + HelpMax);
                    }
                }


                if (BLL.ChangeMoney.EnoughChange(TModel.MID, money, MoneyType))
                {
                    Model.BMember model = new Model.BMember();
                    model.AMID         = TModel.MID;
                    model.BMID         = TModel.MID + DateTime.Now.ToString("yyyyMMddHHmmssfff");
                    model.BMCreateDate = DateTime.Now;
                    model.BMDate       = DateTime.MaxValue;
                    model.BMBD         = MoneyType;
                    model.FHDays       = 0;
                    model.YJMoney      = Convert.ToDecimal(cd.DKey);
                    model.YJCount      = money;
                    model.BOutMoney    = cd.StartLevel;
                    model.BMState      = false;
                    model.BCount       = Convert.ToDecimal(cd.DValue);
                    Hashtable MyHs = new Hashtable();
                    BLL.ChangeMoney.HBChangeTran(money, TModel.MID, BLL.Member.ManageMember.TModel.MID, "Tran", TModel, MoneyType, BLL.Reward.List[MoneyType].RewardName + "转入许愿台", MyHs);
                    BLL.BMember.Insert(model, MyHs);
                    if (BLL.CommonBase.RunHashtable(MyHs))
                    {
                        return("转入成功");
                    }
                    else
                    {
                        return("转入失败");
                    }
                }
                else
                {
                    return("您的" + BLL.Reward.List[MoneyType].RewardName + "不足");
                }
            }
        }
Example #4
0
        /// <summary>
        /// 更新员工参数值
        /// </summary>
        /// <param name="mid">员工账号</param>
        /// <param name="ConfigValue">参数值</param>
        /// <param name="ConfigName">参数名称</param>
        /// <param name="MyHs"></param>
        /// <returns></returns>
        public static Hashtable UpdateConfigTran(string mid, string fieldName, string fieldValue, Model.BMember shmodel, bool isEqual, SqlDbType dataType, Hashtable MyHs)
        {
            StringBuilder strSql = new StringBuilder();
            string        guid   = Guid.NewGuid().ToString();

            strSql.Append("update BMember set ");
            if (isEqual)
            {
                if (dataType == SqlDbType.Int || dataType == SqlDbType.Decimal)
                {
                    strSql.Append(string.Format("{0} = {1} ", fieldName, fieldValue));
                }
                else
                {
                    strSql.Append(string.Format("{0} = '{1}' ", fieldName, fieldValue));
                }
            }
            else
            {
                if (dataType == SqlDbType.Int || dataType == SqlDbType.Decimal)
                {
                    strSql.Append(string.Format("{0} = {0} + {1} ", fieldName, fieldValue));
                }
                else
                {
                    strSql.Append(string.Format("{0} = '{0}' + '{1}' ", fieldName, fieldValue));
                }
            }
            strSql.Append(string.Format(" where BMID='{0}' and '{1}'='{1}'", mid, guid));

            MyHs.Add(strSql, null);
            if (shmodel != null)
            {
                if (isEqual)
                {
                    object obj = DbHelperSQL.GetSingle(string.Format("select {0} from BMember where BMID='{1}'", fieldName, mid));
                    if (obj != null)
                    {
                        fieldValue = obj.ToString();
                    }
                }
                Model.MConfigChange mchange = new Model.MConfigChange
                {
                    ChangeDate  = DateTime.Now,
                    ConfigName  = fieldName,
                    ConfigValue = fieldValue.ToString(),
                    DataType    = dataType,
                    IsValue     = isEqual,
                    MID         = mid,
                    SHMID       = shmodel.BMID
                };
                DAL.MConfigChange.Add(mchange, MyHs);
            }
            return(MyHs);
        }
Example #5
0
        public override void ProcessRequest(HttpContext context)
        {
            //TModel = (TModel == null ? BllModel.TModel : TModel);
            #region 双轨
            StringBuilder tempsb = new StringBuilder();
            tempsb.Append("<li><table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" class=\"tablefilter\"><tbody>");
            if (TModel.Role.Super)
            {
                tempsb.Append("<tr align=\"center\" bgcolor=\"{7}\"><td colspan=\"2\" class=\"tdfilter\"><a href=\"javascript:void(0);\" onclick=\"GetAjaxInfoB('{0}')\">ID:{1}</a></td></tr>");
            }
            else
            {
                tempsb.Append("<tr align=\"center\" bgcolor=\"{7}\"><td colspan=\"2\" class=\"tdfilter\"><a href=\"javascript:void(0);\">ID:{1}</a></td></tr>");
            }
            tempsb.Append("<tr align=\"center\"><td colspan=\"2\" class=\"tdfilter\"><table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" width=\"100%\"><tbody>");
            //tempsb.Append("<tr bgcolor=\"#C0C0C0\" style=\"display: none;\"><td colspan=\"3\">{2}</td></tr>");
            tempsb.Append("<tr bgcolor=\"#C0C0C0\"><td colspan=\"3\">主帐号:{9}</td></tr>");
            //tempsb.Append("<tr bgcolor=\"#C0C0C0\" style=\"display: none;\"><td class=\"l\">{3}人</td><td class=\"m\">市场</td><td class=\"r\">{4}人</td></tr>");
            //tempsb.Append("<tr bgcolor=\"#C0C0C0\" style=\"display: none;\"><td class=\"l\">{5}</td><td class=\"m\">业绩</td><td class=\"r\">{6}</td></tr>");
            tempsb.Append("</tbody></table></td></tr></tbody></table>");
            tempMysb = tempsb.ToString();
            #endregion

            int    level = 3;
            string mkey  = "admin_0";
            string color = "Agency";
            if (!string.IsNullOrEmpty(context.Request["level"]))
            {
                level = int.Parse(context.Request["level"]);
            }
            if (!string.IsNullOrEmpty(context.Request["mkey"]))
            {
                mkey = context.Request["mkey"];
            }
            if (!string.IsNullOrEmpty(context.Request["color"]))
            {
                color = context.Request["color"];
            }

            //level = GetLevel(level, ref mkey, true);

            Model.BMember tempmodel   = BLL.BMember.GetModel(mkey);
            string        mbd         = tempmodel.BMBD;
            Model.Member  memberModel = (TModel == null ? BllModel.TModel : TModel);
            if (!memberModel.Role.Super && mkey == memberModel.MID)
            {
                mbd = "";
            }

            StringBuilder sb = new StringBuilder();
            #region 双轨
            List <Model.BMember> MyListMember  = new List <Model.BMember>();
            List <Model.BMember> AllListMember = new List <Model.BMember>();
            string chileStr = GetStructure(tempmodel.BMID, level, color, ref MyListMember);
            for (int i = 0; i < BLL.Configuration.Model.B_BDCount; i++)
            {
                if (MyListMember.Count > i)
                {
                    AllListMember.Add(MyListMember[i]);
                }
                else
                {
                    AllListMember.Add(new Model.BMember {
                        YJMoney = 0, YJCount = 0
                    });
                }
            }
            ;
            sb.Append(string.Format(tempMysb, mbd, tempmodel.BMID, GetName(tempmodel.AMember, color),
                                    AllListMember[0].YJCount, AllListMember[1].YJCount,
                                    AllListMember[0].YJMoney, AllListMember[1].YJMoney,
                                    GetColor(tempmodel.AMember, color), tempmodel.AMID, tempmodel.AMID));
            sb.Append(chileStr);
            #endregion


            sb.Append("</li>");
            context.Response.Write(Traditionalized(sb));
        }