Beispiel #1
0
        public JsonResult CheckBankNo(string cval, string uid)
        {
            JMP.BLL.CoAgent userBll = new JMP.BLL.CoAgent();
            bool            flag    = userBll.ExistsBankNo(cval, uid);

            return(Json(new { success = flag, mess = flag ? "已存在该开户账号!" : "不存在开户账号!" }));
        }
Beispiel #2
0
        public JsonResult CheckEmail(string cval, string uid)
        {
            JMP.BLL.CoAgent userBll = new JMP.BLL.CoAgent();
            bool            flag    = userBll.ExistsEmail(cval, uid);

            return(Json(new { success = flag, mess = flag ? "已存在该邮件地址!" : "不存在邮件地址!" }));
        }
Beispiel #3
0
        public JsonResult CheckYyzz(string cval, string uid)
        {
            JMP.BLL.CoAgent userBll = new JMP.BLL.CoAgent();
            bool            flag    = userBll.ExistsYyzz(cval, uid);

            return(Json(new { success = flag, mess = flag ? "已存在该营业执照!" : "不存在营业执照!" }));
        }
Beispiel #4
0
        public JsonResult CheckLoName(string lname, string uid)
        {
            JMP.BLL.CoAgent userBll = new JMP.BLL.CoAgent();
            bool            flag    = userBll.ExistsLogName(lname, uid);

            return(Json(new { success = flag, mess = flag ? "已存在该登录名称!" : "不存在登录名称!" }));
        }
Beispiel #5
0
        public ActionResult AgentAuditing()
        {
            int userid = string.IsNullOrEmpty(Request["userid"]) ? 0 : int.Parse(Request["userid"]);

            JMP.BLL.CoAgent bll   = new JMP.BLL.CoAgent();
            JMP.MDL.CoAgent model = bll.GetModel(userid);
            //审核状态
            ViewBag.start  = model.AuditState;
            ViewBag.userid = userid;
            return(View());
        }
Beispiel #6
0
        public JsonResult UpdateAgentAuditState()
        {
            int id           = string.IsNullOrEmpty(Request["userid"]) ? 0 : int.Parse(Request["userid"]);
            int u_auditstate = string.IsNullOrEmpty(Request["u_auditstate"]) ? 0 : int.Parse(Request["u_auditstate"]);

            JMP.BLL.CoAgent bll  = new JMP.BLL.CoAgent();
            bool            flag = bll.UpdateState(id, u_auditstate);

            if (flag)
            {
                string info = "审核代理商状态(" + id + ")的状态为" + u_auditstate + "";
                Logger.OperateLog("审核代理商状态", info);
            }

            return(Json(new { success = flag ? 1 : 0, msg = flag ? "审核成功!" : "审核失败!" }));
        }
Beispiel #7
0
        public JsonResult InsertAgent(JMP.MDL.CoAgent jmpagent)
        {
            object obj = new { success = 0, msg = "添加失败!" };

            JMP.BLL.CoAgent userBll = new JMP.BLL.CoAgent();
            jmpagent.Password = DESEncrypt.Encrypt(jmpagent.Password);
            jmpagent.RoleId   = int.Parse(ConfigurationManager.AppSettings["AgentRoleID"]);
            try
            {
                if (jmpagent.Classify == 0)
                {
                    jmpagent.PersonalPhotoPath = string.IsNullOrEmpty(jmpagent.PersonalPhotoPath) ? "" :  jmpagent.PersonalPhotoPath;
                }
                else
                {
                    jmpagent.BusinessLicensePhotoPath = string.IsNullOrEmpty(jmpagent.BusinessLicensePhotoPath) ? "" :  jmpagent.BusinessLicensePhotoPath;
                    jmpagent.PersonalPhotoPath        = string.IsNullOrEmpty(jmpagent.PersonalPhotoPath) ? " " :  jmpagent.PersonalPhotoPath;
                }

                jmpagent.QQ             = string.IsNullOrEmpty(jmpagent.QQ) ? "" : jmpagent.QQ;
                jmpagent.ContactAddress = string.IsNullOrEmpty(jmpagent.ContactAddress) ? " " : jmpagent.ContactAddress;
                jmpagent.CreatedOn      = DateTime.Now;
                jmpagent.CreatedById    = UserInfo.UserId;
                jmpagent.CreatedByName  = UserInfo.UserName;

                bool flag = false;
                flag = userBll.Add(jmpagent) > 0;
                obj  = new { success = flag ? 1 : 0, msg = flag ? "添加成功!" : "添加失败!" };
                //写日志
                if (flag)
                {
                    Logger.CreateLog("添加代理商", jmpagent);
                }
            }
            catch (Exception ex)
            {
                obj = new { success = 0, msg = "添加异常!" };

                Logger.OperateLog("添加代理商报错", ex.ToString());
            }
            return(Json(obj));
        }
Beispiel #8
0
        public JsonResult UpdateAgents(JMP.MDL.CoAgent jmpagent)
        {
            object obj = new { success = 0, msg = "更新失败!" };

            JMP.BLL.CoAgent userBll      = new JMP.BLL.CoAgent();
            JMP.MDL.CoAgent oldUser      = userBll.GetModel(jmpagent.Id);
            var             oldUserClone = oldUser.Clone();

            oldUser.Classify              = jmpagent.Classify;
            oldUser.LoginName             = jmpagent.LoginName;
            oldUser.Password              = DESEncrypt.Encrypt(jmpagent.Password);
            oldUser.DisplayName           = jmpagent.DisplayName;
            oldUser.EmailAddress          = jmpagent.EmailAddress;
            oldUser.MobilePhone           = jmpagent.MobilePhone;
            oldUser.QQ                    = jmpagent.QQ;
            oldUser.Website               = jmpagent.Website;
            oldUser.ContactAddress        = jmpagent.ContactAddress;
            oldUser.IDCardNumber          = jmpagent.IDCardNumber;
            oldUser.BusinessLicenseNumber = jmpagent.BusinessLicenseNumber;
            oldUser.BankAccount           = jmpagent.BankAccount;
            oldUser.BankAccountName       = jmpagent.BankAccountName;
            oldUser.BankFullName          = jmpagent.BankFullName;
            try
            {
                if (jmpagent.Classify == 0)
                {
                    oldUser.PersonalPhotoPath = string.IsNullOrEmpty(jmpagent.PersonalPhotoPath) ? "" : jmpagent.PersonalPhotoPath;
                }
                else
                {
                    oldUser.BusinessLicensePhotoPath = string.IsNullOrEmpty(jmpagent.BusinessLicensePhotoPath) ? "" : jmpagent.BusinessLicensePhotoPath;
                    oldUser.PersonalPhotoPath        = string.IsNullOrEmpty(jmpagent.PersonalPhotoPath) ? " " : jmpagent.PersonalPhotoPath;
                }

                if (string.IsNullOrEmpty(jmpagent.QQ))
                {
                    oldUser.QQ = " ";
                }
                if (string.IsNullOrEmpty(jmpagent.ContactAddress))
                {
                    oldUser.ContactAddress = " ";
                }

                //jmpagent.CreatedOn = oldUser.CreatedOn;
                //jmpagent.CreatedById = oldUser.CreatedById;
                //jmpagent.CreatedByName = oldUser.CreatedByName;
                //jmpagent.OwnerId = oldUser.OwnerId;
                //jmpagent.OwnerName = oldUser.OwnerName;
                bool flag = _coAgentService.Update(oldUser);
                obj = new { success = flag ? 1 : 0, msg = flag ? "更新成功!" : "更新失败!" };
                //写日志
                if (flag)
                {
                    Logger.ModifyLog("修改代理商", oldUserClone, jmpagent);

                    //审核状态改变是发送私信和邮件给用户
                    if (jmpagent.AuditState != oldUserClone.AuditState)
                    {
                        JMP.BLL.jmp_message messbll = new JMP.BLL.jmp_message();
                        JMP.MDL.jmp_message j_mess  = new JMP.MDL.jmp_message();
                        string tipmsg = string.Empty;
                        #region 组装私信实体
                        j_mess.m_sender   = UserInfo.UserId;
                        j_mess.m_receiver = oldUser.Id.ToString();
                        j_mess.m_type     = 1;
                        j_mess.m_time     = DateTime.Now;
                        j_mess.m_state    = 0;
                        switch (jmpagent.AuditState)
                        {
                        case -1:
                            tipmsg = "你的账号审核未通过!";
                            break;

                        case 0:
                            tipmsg = "你的账号正在审核中,如有疑问请联系我们!";
                            break;

                        case 1:
                            tipmsg = "你的账号审核通过!";
                            break;
                        }
                        j_mess.m_content = tipmsg;
                        #endregion
                        //发送私信
                        if (jmpagent.AuditState == 1)
                        {
                            //更改审核状态为通过时,才发送私信
                            int record = messbll.Add(j_mess);
                            if (record > 0)
                            {
                                Logger.CreateLog("发送私信给用户", j_mess);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.OperateLog("修改代理商报错" + jmpagent.Id, ex.ToString());
                obj = new { success = 0, msg = "更新出错了!" };
            }
            return(Json(obj));
        }