Beispiel #1
0
        public string UpdatePersonInformation(string _StrJson)
        {
            StringBuilder sbStr = new StringBuilder();

            try
            {
                StringBuilder            sbsql        = new StringBuilder();
                CommonJsonModel          model        = new CommonJsonModel(Regex.Replace(_StrJson, @"\r\n", ""));
                List <CommonJsonModel>   lst          = model.GetCollection();
                ZhouFu.Bll.sys_Manager   bllManager   = new Bll.sys_Manager();
                ZhouFu.Model.sys_Manager modelManager = new Model.sys_Manager();
                foreach (CommonJsonModel item in lst)
                {
                    #region 模型参数设置
                    string _UserId       = item.GetValue("_UserId");       //用户编号
                    string aaaa          = item.Rawjson;
                    string _RealName     = item.GetValue("_RealName");     //真实姓名
                    string _Sex          = item.GetValue("_Sex");          //性别
                    string _Province     = item.GetValue("_Province");     //省
                    string _City         = item.GetValue("_City");         //城市
                    string _County       = item.GetValue("_County");       //区县
                    string _Email        = item.GetValue("_Email");        //邮箱
                    string _Mobile       = item.GetValue("_Mobile");       //手机
                    string _CodeNumber   = item.GetValue("_CodeNumber");   //身份证号
                    string _BankId       = item.GetValue("_BankId");       //银行ID号
                    string _BankCard     = item.GetValue("_BankCard");     //银行卡号
                    string _BankProvince = item.GetValue("_BankProvince"); //开户省份
                    string _BankCity     = item.GetValue("_BankCity");     //开户城市
                    string _BankAddress  = item.GetValue("_BankAddress");  //开户地址
                    if (_UserId != "")
                    {
                        modelManager = bllManager.GetModel(Convert.ToInt32(_UserId));
                    }
                    if (_RealName != "")
                    {
                        modelManager.RealName = _RealName;
                    }
                    if (_Sex != "")
                    {
                        modelManager.user_sex = _Sex;
                    }
                    if (_Province != "")
                    {
                        modelManager.user_province = _Province;
                    }
                    if (_City != "")
                    {
                        modelManager.user_city = _City;
                    }
                    if (_County != "")
                    {
                        modelManager.user_county = _County;
                    }
                    if (_Email != "")
                    {
                        modelManager.user_email = _Email;
                    }
                    if (_Mobile != "")
                    {
                        modelManager.user_mobile = _Mobile;
                    }
                    if (_CodeNumber != "")
                    {
                        modelManager.CodeNumber = _CodeNumber;
                    }
                    if (_BankId != "")
                    {
                        modelManager.bank_id = Convert.ToInt32(_BankId);
                    }
                    if (_BankCard != "")
                    {
                        modelManager.bank_card = _BankCard;
                    }
                    if (_BankProvince != "")
                    {
                        modelManager.bank_province = _BankProvince;
                    }
                    if (_BankCity != "")
                    {
                        modelManager.bank_city = _BankCity;
                    }
                    if (_BankAddress != "")
                    {
                        modelManager.bank_address = _BankAddress;
                    }
                    #endregion
                }
                if (bllManager.Update(modelManager))
                {
                    sbStr.Append("[{\"msg\":\"修改成功\",\"data\":\"\",\"state\":\"0\"}]");
                }
                else
                {
                    sbStr.Append("[{\"msg\":\"修改失败,服务器处理错误\",\"data\":\"\",\"state\":\"1\"}]");
                }
            }
            catch
            {
                sbStr.Append("[{\"msg\":\"修改失败,服务器处理错误\",\"data\":\"\",\"state\":\"2\"}]");
            }
            return(sbStr.ToString());
        }
Beispiel #2
0
        private string Info(Model.sys_Manager mModel, Model.TB_Project pModel, decimal money, decimal money2)
        {
            StringBuilder sbStr = new StringBuilder();
            int           iJF = 0;                                                                           //积分
            decimal       tz_yield = Convert.ToDecimal(GetTzYield(pModel, mModel.user_category.ToString())); //获取用户收益率
            int           firstperson = 0, firstbl = 0, secondperson = 0, secondbl = 0;

            if (pModel.pro_type == 0)                                                 //普通项目
            {
                firstperson  = Convert.ToInt32(GetFirstPerson(mModel).Split('|')[0]); //一级会员ID
                firstbl      = Convert.ToInt32(GetFirstPerson(mModel).Split('|')[1]); //一级佣金比例
                secondperson = Convert.ToInt32(GetFirstPerson(mModel).Split('|')[2]); //二级会员ID
                secondbl     = Convert.ToInt32(GetFirstPerson(mModel).Split('|')[3]); //二级佣金比例
            }
            int      projectid = pModel.id;
            int      personid  = mModel.ID;
            string   ipaddress = DTRequest.GetIP();
            DateTime datetime  = DateTime.Now;

            #region 添加项目融资金额
            ZhouFu.Model.TB_ProjectFinancing pfModel = new ZhouFu.Model.TB_ProjectFinancing();
            pfModel.tz_proid  = projectid;
            pfModel.tz_person = personid;
            pfModel.tz_money  = money;
            pfModel.tz_time   = datetime;
            pfModel.tz_yield  = float.Parse(tz_yield.ToString());
            #endregion

            //#region 修改用户账户
            //if (money > 0)
            //{
            //    mModel.AccountBalance = mModel.AccountBalance - Convert.ToDecimal(money);
            //    iJF = (int)(Convert.ToInt32(money) / Convert.ToInt32(config.Integral) * 1);//获得荣誉积分
            //    mModel.HonorPoints = mModel.HonorPoints + iJF;
            //}
            //if (money2 > 0)
            //{
            //    mModel.JLAccountBalance = mModel.JLAccountBalance - Convert.ToDecimal(money2);
            //}
            //#endregion

            #region 发送私信
            ZhouFu.Model.TB_UsersLog logModel = new ZhouFu.Model.TB_UsersLog();
            logModel.title         = "(项目投资)账户扣款通知";
            logModel.content       = string.Format("尊敬的用户您好,您的投资已成功,账户扣除" + pfModel.tz_money + ",请到个人中心查看明细。</br>感谢您对汇财e家一如既往的支持,希望我们的服务能够带来您财富的增长。", mModel.user_name, pModel.pro_title, pModel.pro_number, pfModel.tz_money, iJF);
            logModel.send_userid   = 38;
            logModel.send_time     = DateTime.Now;
            logModel.receiv_userid = mModel.ID;
            #endregion

            #region 记录用户账户明细
            ZhouFu.Model.TB_AccountDetails ADetailsModel = new ZhouFu.Model.TB_AccountDetails();
            if (money > 0)
            {
                //ADetailsModel.userid = mModel.ID;
                //ADetailsModel.jy_type = 4;
                //ADetailsModel.zh_type = 1;
                //ADetailsModel.cz_type = 2;
                //ADetailsModel.cz_money = pfModel.tz_money;
                //ADetailsModel.overmoney = mModel.AccountBalance - money;
                //ADetailsModel.remart = string.Format("投资项目【{0}/{1}】支出¥{2}元。", pModel.pro_title, pModel.pro_number, pfModel.tz_money);
            }
            #endregion


            if (1 == 1)
            {
                sbStr.Append("[{\"msg\":\"投资成功,您本次获得积分:" + iJF + "\",\"data\":\"\",\"state\":\"0\"}]");
                object endSumMoney = new ZhouFu.Bll.TB_ProjectFinancing().GetTotalInvestment(" tz_proid=" + pModel.id);//判断项目是否已经融资满额
                if (Convert.ToDecimal(endSumMoney) == pModel.pro_money)
                {
                    pModel.status = 5;
                    new ZhouFu.Bll.TB_Project().Update(pModel);
                }
            }
            else
            {
                sbStr.Append("[{\"msg\":\"投资失败,服务器处理出错。\",\"data\":\"\",\"state\":\"1\"}]");
            }
            return(sbStr.ToString());
        }