/// <summary> /// Update contact details dal /// </summary> /// <param name="contactDetailsEntity">ContactDetailsEntity</param> /// <returns>System.Int32</returns> public int UpdateContactDetailsDAL(ContactDetailsEntity contactDetailsEntity) { int result = 0; try { connection.Open(); SqlCommand cmd = new SqlCommand(); SqlParameter[] sqlparams = { new SqlParameter("@recruiterId",contactDetailsEntity.Id), new SqlParameter("@altMobNo",contactDetailsEntity.AltMobileNo ), new SqlParameter("@landLine", contactDetailsEntity.LandLineNo), new SqlParameter("@whatsappNo",contactDetailsEntity.WhatsAppNo), new SqlParameter("@linkedId", contactDetailsEntity.LinkedId), new SqlParameter("@facebookId",contactDetailsEntity.FacebookId), new SqlParameter("@twitterId", contactDetailsEntity.TwitterId), new SqlParameter("@gtalkId",contactDetailsEntity.GtalkId), new SqlParameter("@skypeId", contactDetailsEntity.SkypeId), new SqlParameter("@googleP",contactDetailsEntity.GooglePlus), new SqlParameter("@altEmailId",contactDetailsEntity.AltEmailId) }; result = SqlHelper.ExecuteNonQuery(connection, CommandType.StoredProcedure, Constants.sp_RE_UpdateContactDetails, sqlparams); } catch (Exception) { //throw; } finally { connection.Close(); } return result; }
/// <summary> /// Update contact details of recruiter. /// </summary> /// <param name="contactDetailsEntity">contactDetailsEntity</param> /// <returns>System.Int32</returns> public int UpdateContactDetailsBAL(ContactDetailsEntity contactDetailsEntity) { ContactDetailsREDAL contactDetailsDAL = new ContactDetailsREDAL(); return contactDetailsDAL.UpdateContactDetailsDAL(contactDetailsEntity); }
/// <summary> /// Handles the Click event of the btnSave 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 btnSave_Click(object sender, EventArgs e) { try { // Check isEdit is true for update contact details if (isEdit) { ContactDetailsREBAL contactDetailsBAL = new ContactDetailsREBAL(); ContactDetailsEntity contactDetailsEntity = new ContactDetailsEntity(); // Set the value of ContactDetailsJobSeekerEntity contactDetailsEntity.Id = recruiterId; contactDetailsEntity.AltMobileNo = txtAltNo.Text.Trim(); contactDetailsEntity.LandLineNo = txtLandno.Text.Trim(); contactDetailsEntity.WhatsAppNo = txtWhatsappNo.Text.Trim(); contactDetailsEntity.LinkedId = txtLinkedIn.Text.Trim(); contactDetailsEntity.FacebookId = txtFacebook.Text.Trim(); contactDetailsEntity.TwitterId = txtTwitter.Text.Trim(); contactDetailsEntity.GtalkId = txtGTalk.Text.Trim(); contactDetailsEntity.SkypeId = txtSkype.Text.Trim(); contactDetailsEntity.GooglePlus = txtGooglePlus.Text.Trim(); contactDetailsEntity.AltEmailId = txtAltEmailId.Text.Trim(); int result = contactDetailsBAL.UpdateContactDetailsBAL(contactDetailsEntity); // Check result is greater than zero or not if (result > 0) { Response.Write("<script language='javascript'>alert('Contact Details Updated')</script>"); } else { Response.Write("<script language='javascript'>alert('Sorry')</script>"); } } else { ContactDetailsREBAL contactDetailsBAL = new ContactDetailsREBAL(); ContactDetailsEntity contactDetailsEntity = new ContactDetailsEntity(); // Set the value of ContactDetailsJobSeekerEntity contactDetailsEntity.Id = recruiterId; contactDetailsEntity.AltMobileNo = txtAltNo.Text.Trim(); contactDetailsEntity.LandLineNo = txtLandno.Text.Trim(); contactDetailsEntity.WhatsAppNo = txtWhatsappNo.Text.Trim(); contactDetailsEntity.LinkedId = txtLinkedIn.Text.Trim(); contactDetailsEntity.FacebookId = txtFacebook.Text.Trim(); contactDetailsEntity.TwitterId = txtTwitter.Text.Trim(); contactDetailsEntity.GtalkId = txtGTalk.Text.Trim(); contactDetailsEntity.SkypeId = txtSkype.Text.Trim(); contactDetailsEntity.GooglePlus = txtGooglePlus.Text.Trim(); contactDetailsEntity.AltEmailId = txtAltEmailId.Text.Trim(); int result = contactDetailsBAL.SaveContactDetailsBAL(contactDetailsEntity); // Check result is greater than zero or not if (result > 0) { Response.Write("<script language='javascript'>alert('Contact Details Inserted')</script>"); } else { Response.Write("<script language='javascript'>alert('Sorry')</script>"); } } } catch (Exception) { throw; } }