/// <summary>
 /// Handles Click event of btnAddMobileNo control
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
 protected void btnAddMobileNo_Click(object sender, EventArgs e)
 {
     try
     {
         ChangeLoginDetailsBAL changeLoginDetailsBAL = new ChangeLoginDetailsBAL();
         ChangeLoginDetailsEntity changeLoginDetailsEntity = new ChangeLoginDetailsEntity();
         changeLoginDetailsEntity.CandidateId = candidateId;
         changeLoginDetailsEntity.MobileNo = txtMobileNumber.Text.Trim();
         int result = changeLoginDetailsBAL.NewMoblieNoBAL(changeLoginDetailsEntity);
         Response.Write("<script language='javascript'>alert('Your New Mobile Number saved successfully.Please Refresh Page.')</script>");
     }
     catch (Exception)
     {
         // throw;
     }
 }
 /// <summary>
 /// Method in ChangeLoginDetailsDAL class to change Primary mobile number
 /// </summary>
 /// <param name="changeLoginDetailsEntity">Entity of of change login details</param>
 public void ChangePrimaryMobileNoDAL(ChangeLoginDetailsEntity changeLoginDetailsEntity)
 {
     try
     {
         connection.Open();
         SqlParameter[] sparams = new SqlParameter[2];
         sparams[0] = new SqlParameter("@candidateId", changeLoginDetailsEntity.CandidateId);
         sparams[1] = new SqlParameter("@mobileNo", changeLoginDetailsEntity.MobileNo);
         SqlHelper.ExecuteNonQuery(connection, CommandType.StoredProcedure, Constants.sp_JS_ChangePrimaryMobileNo, sparams);
     }
     catch (Exception)
     {
         // throw;
     }
     finally
     {
         connection.Close();
     }
 }
 /// <summary>
 /// Handles Click event of lnkbtnAlternateMobNo control
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
 protected void lnkbtnAlternateMobNo_Click(object sender, EventArgs e)
 {
     try
     {
         DataSet datasetLoginDetail = new DataSet();
         //DataSet datasetUpdateMobileDetails = new DataSet();
         ChangeLoginDetailsBAL changeLoginDetailsBAL = new ChangeLoginDetailsBAL();
         ChangeLoginDetailsEntity changeLoginDetailsEntity = new ChangeLoginDetailsEntity();
         datasetLoginDetail = changeLoginDetailsBAL.GetLoginDetailsBAL(candidateId);
         // Check dataset is not null
         if (datasetLoginDetail != null)
         {
             lblPrimaryMobNo.Text = Convert.ToString(datasetLoginDetail.Tables[0].Rows[0]["MobileNo"]);
             changeLoginDetailsEntity.CandidateId = candidateId;
             changeLoginDetailsEntity.MobileNo = Convert.ToString(datasetLoginDetail.Tables[0].Rows[0]["AltMobile"]);
             changeLoginDetailsBAL.ChangePrimaryMobileNoBAL(changeLoginDetailsEntity);
             Response.Write("<script language='javascript'>alert('Your Primary Mobile number changed successfully. Please Refresh Page.')</script>");
         }
     }
     catch (Exception)
     {
         //  throw;
     }
 }
 /// <summary>
 /// Method to ChangeLoginDetailsBAL class for Adding new mobile number
 /// </summary>
 /// <param name="changeLoginDetailsEntity">Entity of of change login details</param>
 /// <returns>System.Int32</returns>
 public int NewMoblieNoBAL(ChangeLoginDetailsEntity changeLoginDetailsEntity)
 {
     ChangeLoginDetailsDAL changeLoginDetailsDAL = new ChangeLoginDetailsDAL();
     return changeLoginDetailsDAL.NewMoblieNoDAL(changeLoginDetailsEntity);
 }
 /// <summary>
 ///  Method in ChangeLoginDetailsBAL class for changing Primary Mobile Number
 /// </summary>
 /// <param name="changeLoginDetailsEntity">Entity of of change login details</param>
 public void ChangePrimaryMobileNoBAL(ChangeLoginDetailsEntity changeLoginDetailsEntity)
 {
     ChangeLoginDetailsDAL changeLoginDetailsDAL = new ChangeLoginDetailsDAL();
     changeLoginDetailsDAL.ChangePrimaryMobileNoDAL(changeLoginDetailsEntity);
 }
 /// <summary>
 /// Method in ChangeLoginDetailsBAL class for changing Primary Mail ID
 /// </summary>
 /// <param name="changeLoginDetailsEntity">Entity of of change login details</param>
 public void ChangePrimaryMailIdBAL(ChangeLoginDetailsEntity changeLoginDetailsEntity)
 {
     ChangeLoginDetailsDAL changeLoginDetailsDAL = new ChangeLoginDetailsDAL();
     changeLoginDetailsDAL.ChangePrimaryMailIdDAL(changeLoginDetailsEntity);
 }
 /// <summary>
 /// Method in ChangeLoginDetailsDAL class to Add New Mail ID
 /// </summary>
 /// <param name="changeLoginDetailsEntity">Entity of of change login details</param>
 /// <returns>System.Int32</returns>
 public int NewMailIdDAL(ChangeLoginDetailsEntity changeLoginDetailsEntity)
 {
     int result = 0;
     try
     {
         connection.Open();
         SqlParameter[] sparams = new SqlParameter[2];
         sparams[0] = new SqlParameter("@candidateId", changeLoginDetailsEntity.CandidateId);
         sparams[1] = new SqlParameter("@mailId", changeLoginDetailsEntity.MailId);
         result = SqlHelper.ExecuteNonQuery(connection, CommandType.StoredProcedure, Constants.sp_JS_ChangeEmailId, sparams);
     }
     catch (Exception)
     {
         // throw;
     }
     finally
     {
         connection.Close();
     }
     return result;
 }
 /// <summary>
 /// Handles Click event of lnkbtnMakeLoginId control
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
 protected void lnkbtnMakeLoginId_Click(object sender, EventArgs e)
 {
     try
     {
         DataSet dsLoginDetails = new DataSet();
         ChangeLoginDetailsBAL changeLoginDetailsBAL = new ChangeLoginDetailsBAL();
         ChangeLoginDetailsEntity changeLoginDetailsEntity = new ChangeLoginDetailsEntity();
         dsLoginDetails = changeLoginDetailsBAL.GetLoginDetailsBAL(candidateId);
         // Check dataset is not null
         if (dsLoginDetails != null)
         {
             lblLoginMailId.Text = Convert.ToString(dsLoginDetails.Tables[0].Rows[0]["EmailId"]);
             changeLoginDetailsEntity.CandidateId = candidateId;
             changeLoginDetailsEntity.MailId = Convert.ToString(dsLoginDetails.Tables[0].Rows[0]["AltEmailId"]);
             changeLoginDetailsBAL.ChangePrimaryMailIdBAL(changeLoginDetailsEntity);
             Response.Write("<script language='javascript'>alert('Your Primary Mail id changed successfully. Please Refresh Page.')</script>");
         }
     }
     catch (Exception)
     {
         // throw;
     }
 }