/// <summary> /// Update Contact Details /// </summary> /// <param name="contactDetailsEntity">Object for inserting data into database</param> /// <returns>System.Int32</returns> public int UpdateContactDetailsDAL(ContactDetailsEntity contactDetailsEntity) { int result = 0; try { connection.Open(); SqlCommand cmd = new SqlCommand(); SqlParameter[] sqlparams = { new SqlParameter("@candidateId",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_JS_UpdateContactDetails, sqlparams); } catch (Exception) { //throw; } finally { connection.Close(); } return result; }
/// <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) { ContactDetailsJSBAL contactDetailsBAL = new ContactDetailsJSBAL(); ContactDetailsEntity objContactDetailsEntity = new ContactDetailsEntity(); // Set the value of ContactDetailsJobSeekerEntity objContactDetailsEntity.Id = candidateId; objContactDetailsEntity.AltMobileNo = txtAltNo.Text.Trim(); objContactDetailsEntity.LandLineNo = txtLandno.Text.Trim(); objContactDetailsEntity.WhatsAppNo = txtWhatsappNo.Text.Trim(); objContactDetailsEntity.LinkedId = txtLinkedIn.Text.Trim(); objContactDetailsEntity.FacebookId = txtFacebook.Text.Trim(); objContactDetailsEntity.TwitterId = txtTwitter.Text.Trim(); objContactDetailsEntity.GtalkId = txtGTalk.Text.Trim(); objContactDetailsEntity.SkypeId = txtSkype.Text.Trim(); objContactDetailsEntity.GooglePlus = txtGooglePlus.Text.Trim(); objContactDetailsEntity.AltEmailId = txtAltEmailId.Text.Trim(); int result = contactDetailsBAL.UpdateContactDetailsBAL(objContactDetailsEntity); // 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 { ContactDetailsJSBAL contactDetailsBAL = new ContactDetailsJSBAL(); ContactDetailsEntity contactDetailsEntity = new ContactDetailsEntity(); // Set the value of ContactDetailsJobSeekerEntity contactDetailsEntity.Id = candidateId; 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; } }
/// <summary> /// Update ContactDetails of job seeker /// </summary> /// <param name="contactDetailsEntity">ContactDetailsEntity</param> /// <returns>System.Int32</returns> public int UpdateContactDetailsBAL(ContactDetailsEntity contactDetailsEntity) { ContactDetailsJSDAL contactDetailsDAL = new ContactDetailsJSDAL(); return contactDetailsDAL.UpdateContactDetailsDAL(contactDetailsEntity); }