Exemplo n.º 1
0
        public async Task <ActionResult> InfoChange(InfoChangeViewModel viewModel)
        {
            ExtensionInformationParameter model = new ExtensionInformationParameter();

            viewModel.CopyTo(model);

            if (ModelState.IsValid)
            {
                bool flag = await _memberService.ModifyMemberExtensionInformation(model);

                assignMessage(flag ? "保存成功" : "保存失败", flag);

                #region 日志记录
                if (flag == true)
                {
                    LogService.WriteLogInfo(new Log {
                        UserName = HttpContext.User.Identity.Name, Contents = string.Format("修改了用户{0}信息", (await _memberService.GetMemberInfo(model.MemberID)).MemberName)
                    });
                }
                #endregion
            }

            buildSelectList(viewModel);
            return(View(viewModel));
        }
Exemplo n.º 2
0
        public async Task <JsonResult <dynamic> > CommitExtensionInformation(ExtensionInformationParameter model)
        {
            //int MemberID = Convert.ToInt32(HttpContext.Current.Request.Form["MemberID"]);
            bool flag = await _memberService.ModifyMemberExtensionInformation(model);

            return(new JsonResult <dynamic>
            {
                status = flag,
                Message = flag ? "补充信息成功" : "补充信息失败"
            });
        }
Exemplo n.º 3
0
        public async Task <ActionResult> InfoChange()
        {
            ExtensionInformationParameter model = await _memberService.GetMemberExtensionInformation(CommonHelper.CurrentUser.MemberID);

            InfoChangeViewModel viewModel = new InfoChangeViewModel();

            model.CopyTo(viewModel);
            //获取下拉列表的数据
            buildSelectList(viewModel);
            return(View(viewModel));
        }
Exemplo n.º 4
0
        /// <summary>
        /// 获取补充信息
        /// </summary>
        /// <param name="MemberID"></param>
        /// <returns></returns>
        public async Task <ExtensionInformationParameter> GetMemberExtensionInformation(int MemberID)
        {
            string sql = "select MemberID, TrueName,"
                         + " CertificateType,CertificateNo,"
                         + " PoliticalStatus,Education,Birthday,"
                         + " Sex,Address,Phone,Email,QQ,Alipay,"
                         + " BankCardNo,BankAccount,UserAccount,"
                         + " SecondContact,SecondContactPhone,InsuranceArea,"
                         + " HouseholdType from Members "
                         + $" where MemberID={MemberID}";
            ExtensionInformationParameter model = await DbHelper.QuerySingleAsync <ExtensionInformationParameter>(sql);

            return(model);
        }
Exemplo n.º 5
0
        public async Task <ActionResult> EditMemberExtensionInformation(ExtensionInformationParameter model)
        {
            model.HouseholdType = EnumExt.GetEnumCustomDescription((HouseholdPropertyEnum)Convert.ToInt32(model.HouseholdType));

            bool flag = await _memberService.ModifyMemberExtensionInformation(model);

            TempData["Message"] = flag ? "保存成功" : "保存失败";

            #region 日志记录
            if (flag == true)
            {
                LogService.WriteLogInfo(new Log {
                    UserName = HttpContext.User.Identity.Name, Contents = string.Format("修改了用户{0}信息", (await _memberService.GetMemberInfo(model.MemberID)).MemberName)
                });
            }
            #endregion

            return(RedirectToAction("GetMemberList"));
        }
Exemplo n.º 6
0
        /// <summary>
        /// 更新会员补充信息
        /// </summary>
        /// <param name="MemberID"></param>
        /// <param name="model"></param>
        /// <returns></returns>
        public async Task <bool> ModifyMemberExtensionInformation(ExtensionInformationParameter model)
        {
            string sql = "update Members set TrueName=@TrueName,"
                         + " CertificateType=@CertificateType,CertificateNo=@CertificateNo,"
                         + " PoliticalStatus=@PoliticalStatus,Education=@Education,Birthday=@Birthday,"
                         + " Sex=@Sex,Address=@Address,Phone=@Phone,Email=@Email,QQ=@QQ,Alipay=@Alipay,"
                         + " BankCardNo=@BankCardNo,BankAccount=@BankAccount,UserAccount=@UserAccount,"
                         + " SecondContact=@SecondContact,SecondContactPhone=@SecondContactPhone,InsuranceArea=@InsuranceArea,"
                         + " HouseholdType=@HouseholdType,IsComplete= 1 "
                         + " where MemberID=@MemberID";

            DbParameter[] parameters = new DbParameter[] {
                new SqlParameter("@TrueName", model.TrueName ?? ""),
                new SqlParameter("@CertificateType", model.CertificateType ?? ""),
                new SqlParameter("@CertificateNo", model.CertificateNo ?? ""),
                new SqlParameter("@PoliticalStatus", model.PoliticalStatus ?? ""),
                new SqlParameter("@Education", model.Education ?? ""),
                new SqlParameter("@Birthday", model.Birthday ?? (object)DBNull.Value),
                new SqlParameter("@Sex", model.Sex ?? ""),
                new SqlParameter("@Address", model.Address ?? ""),
                new SqlParameter("@Phone", model.Phone ?? ""),
                new SqlParameter("@Email", model.Email ?? ""),
                new SqlParameter("@QQ", model.QQ ?? ""),
                new SqlParameter("@Alipay", model.Alipay ?? ""),
                new SqlParameter("@BankCardNo", model.BankCardNo ?? ""),
                new SqlParameter("@BankAccount", model.BankAccount ?? ""),
                new SqlParameter("@UserAccount", model.UserAccount ?? ""),
                new SqlParameter("@SecondContact", model.SecondContact ?? ""),
                new SqlParameter("@SecondContactPhone", model.SecondContactPhone ?? ""),
                new SqlParameter("@InsuranceArea", model.InsuranceArea ?? ""),
                new SqlParameter("@HouseholdType", model.HouseholdType ?? ""),
                new SqlParameter("@MemberID", model.MemberID)
            };

            int result = await DbHelper.ExecuteSqlCommandAsync(sql, parameters);

            return(result > 0);
        }
Exemplo n.º 7
0
        public async Task <ActionResult> EditMemberExtensionInformation(int MemberID, int type)
        {
            ExtensionInformationParameter model = await _memberService.GetMemberExtensionInformation(MemberID);

            #region 证件类型
            var CertificateTypeList = new List <string> {
                "请选择"
            }.Concat(GetCertificateType()).Select(
                item => new SelectListItem
            {
                Text     = item,
                Value    = item == "请选择" ? "" : item,
                Selected = item == model.CertificateType
            }).ToList();

            //ViewData["CertificateType"] = new SelectList(CertificateTypeList, "Value", "Text");

            ViewBag.CertificateType = new SelectList(CertificateTypeList, "Value", "Text");

            #endregion

            #region 政治面貌
            var PoliticalStatusList = new List <string> {
                "请选择"
            }.Concat(GetPoliticalStatus()).Select(
                item => new SelectListItem
            {
                Text  = item,
                Value = item == "请选择" ? "" : item
            }).ToList();

            ViewData["PoliticalStatus"] = new SelectList(PoliticalStatusList, "Value", "Text", model.PoliticalStatus);
            #endregion

            #region 学历
            var EducationList = new List <string> {
                "请选择"
            }.Concat(GetEducation()).Select(
                item => new SelectListItem
            {
                Text  = item,
                Value = item == "请选择" ? "" : item
            }).ToList();

            ViewData["Education"] = new SelectList(EducationList, "Value", "Text", model.Education);
            #endregion

            #region 户口性质
            List <SelectListItem> UserTypeList = EnumExt.GetSelectList(typeof(HouseholdPropertyEnum));
            UserTypeList.Insert(0, new SelectListItem {
                Text = "请选择", Value = ""
            });
            int householdType = 0;
            foreach (var item in UserTypeList)
            {
                if (item.Text == model.HouseholdType)
                {
                    householdType = Convert.ToInt32(item.Value);
                    break;
                }
            }

            model.HouseholdType = householdType.ToString();

            ViewData["HouseholdType"] = new SelectList(UserTypeList, "Value", "Text");
            #endregion

            if (type == 1)
            {
                ViewData["SocialSecurityList"]   = _socialSecurityService.GetSocialSecurityList(MemberID);
                ViewData["AccumulationFundList"] = _accumulationFundService.GetAccumulationFundList(MemberID);
            }

            return(View(model));
        }