public bool chkAvailability()
        {
            bool   result = false;
            string id;

            try
            {
                id     = txtEmail.Text;
                result = userBo.ChkAvailability(id);
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "EditAdvisorProfile.ascx:chkAvailability()");


                object[] objects = new object[1];
                objects[0] = result;


                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
            return(result);
        }
Beispiel #2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (IsValid())
                {
                    if (userBo.ChkAvailability(txtNewLoginId.Text.Trim()))
                    {
                        userVo.LoginId = txtNewLoginId.Text.Trim();
                        userBo.UpdateUser(userVo);
                        Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "Message", "alert('Your Id has changed successfully..!');", true);
                        Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "pageloadscript", "loadcontrol('EditUserDetails','none');", true);
                    }
                    else //Some one else is using the login id.
                    {
                        lblStatusMessage.Text = "The Login Id is not available.";
                    }
                }
                else //The login Id entered by user is wrong
                {
                    lblStatusMessage.Text = "The current Login Id is wrong.";
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "ChangeLoginId.ascx:btnSave_Click()");


                object[] objects = new object[3];
                objects[0] = userBo;
                objects[1] = userVo;
                objects[3] = advisorVo;


                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }