Exemple #1
0
        public ProfileResultModel UpdateProfile(UpdateProfileRequestModel param)
        {
            ProfileResultModel result = new ProfileResultModel();

            try
            {
                int?memberId = IdentityHelper.GetMemberId();
                if (!memberId.HasValue)
                {
                    throw new OrgException("Invalid MemberId");
                }

                MemberBL bl = new MemberBL();

                var member = bl.UpdateProfile(memberId.Value, new UpdateMemberModel
                {
                    Email     = param.Email,
                    FirstName = param.FirstName,
                    LastName  = param.LastName,
                    NickName  = param.NickName,
                    Gender    = param.Gender,
                    Photo     = param.Photo
                });

                result.Status  = true;
                result.Message = "Updated profile successfully.";
                result.Member  = member;
            }
            catch (OrgException oex)
            {
                result.Status  = false;
                result.Message = oex.Message;
            }
            catch (Exception ex)
            {
                result.Status  = false;
                result.Message = AppConfigs.InternalErrorMessage;

                if (AppConfigs.DebugInternalMessage)
                {
                    result.InternalMessage = ex.Message;
                }
            }

            return(result);
        }
Exemple #2
0
        public ProfileResultModel UpdatePhoneNo(UpdatePhoneNoRequestModel param)
        {
            ProfileResultModel result = new ProfileResultModel();

            try
            {
                int?memberId = IdentityHelper.GetMemberId();
                if (!memberId.HasValue)
                {
                    throw new OrgException("Invalid MemberId");
                }

                MemberBL bl = new MemberBL();

                var member = bl.UpdateProfile(memberId.Value, new UpdateMemberModel
                {
                    Phone = (param == null) ? null : param.Phone
                });

                result.Status  = true;
                result.Message = "Updated phone no. successfully.";
                result.Member  = member;
            }
            catch (OrgException oex)
            {
                result.Status  = false;
                result.Message = oex.Message;
            }
            catch (Exception ex)
            {
                result.Status  = false;
                result.Message = AppConfigs.InternalErrorMessage;

                if (AppConfigs.DebugInternalMessage)
                {
                    result.InternalMessage = ex.Message;
                }
            }

            return(result);
        }