/// <summary> /// Description : Select specific user profile from the table Business_UserProfile. /// Stored Procedure : USP_CP_UsrPro_SelectSpecificRecord /// Associate Control: - /// </summary> /// <param name="intProfileID">Integer</param> private void SelectRecord_UserProfile(int intProfileID) { try { using (BOC_Corporate_UserProfile bocUserProfile = new BOC_Corporate_UserProfile()) { EOC_PropertyBean eocPropertyBean = new EOC_PropertyBean(); eocPropertyBean.Business_UserProfile_ProfileID = intProfileID; if (bocUserProfile.SelectRecord_UserProfile(eocPropertyBean)) { txtEmail1.Text = eocPropertyBean.Business_UserProfile_LoginEmail; txtEmail2.Text = eocPropertyBean.Business_UserProfile_LoginEmail; txtCompany.Text = eocPropertyBean.Business_UserProfile_CompanyName; ddlBusinessType.SelectedValue = eocPropertyBean.BusinessCategory_BusinessID.ToString(); ddlCountry.SelectedValue = eocPropertyBean.Country_CountryID.ToString(); ddlState.SelectedValue = eocPropertyBean.State_StateID.ToString(); ddlProvince.SelectedValue = eocPropertyBean.Province_ProvinceID.ToString(); txtAddress.Text = eocPropertyBean.Business_UserProfile_BusinessAddress; txtPhone.Text = eocPropertyBean.Business_UserProfile_ContactPhone; txtURL.Text = eocPropertyBean.Business_UserProfile_CompanyURL; txtBillingContact.Text = eocPropertyBean.Business_UserProfile_BillingPerson; txtInventoryManager.Text = eocPropertyBean.Business_UserProfile_WebInventoryManager; txtProfile.Text = eocPropertyBean.Business_UserProfile_CompanyProfile; ImagePathCorporate = eocPropertyBean.CorporateImagePath.ToString(); if (ImagePathCorporate == "") { ImagePathCorporate = "../Classifieds_ProductImage/index.jpg"; } } else { strSystemMessage = "<table style='width:500px; border:1px dashed #666666;'>"; strSystemMessage += "<tr>"; strSystemMessage += "<td align='center' style='width:10%;'><img src='../images/icon_error.gif' width='42' height='40' alt='' /></td>"; strSystemMessage += "<td valign='middle' style='width:90%;font-weight:bold; text-decoration:underline'>Following error occured :</td>"; strSystemMessage += "</tr>"; strSystemMessage += "<tr>"; strSystemMessage += "<td colspan='2' style='width:100%; color:#000000; padding-top:7px; padding-left:10px;'>"; strSystemMessage += "Corporate User Profile not found!"; strSystemMessage += "<br/><br/>"; strSystemMessage += "<strong>How did this happen? </strong>"; strSystemMessage += "<ul>"; strSystemMessage += "<li>You login session may be expired.</li>"; strSystemMessage += "<li>Your Corporate Account may be deleted by ApnerDeal authority for some reason.</li>"; strSystemMessage += "</ul>"; strSystemMessage += "</td>"; strSystemMessage += "</tr>"; strSystemMessage += "</table>"; lblSystemMessage.Text = strSystemMessage; } } } catch (Exception Exp) { lblSystemMessage.Text = Exp.Message.ToString(); } }
/// <summary> /// Description : Update specific row in the table Business_UserProfile. /// Stored Procedure : USP_CP_UsrPro_BeforeUpdate_IsLoginEmailDuplicate, USP_CP_UsrPro_BeforeUpdate_IsCompanyNameDuplicate, USP_CP_UsrPro_UpdateRecord /// Associate Control: - /// </summary> /// <returns></returns> private int UpdateRecord_UserProfile() { int intActionResult = 0; try { using (BOC_Corporate_UserProfile bocUserProfile = new BOC_Corporate_UserProfile()) { EOC_PropertyBean eocPropertyBean = new EOC_PropertyBean(); eocPropertyBean.Business_UserProfile_ProfileID = intProfileID; eocPropertyBean.BusinessCategory_BusinessID = Convert.ToInt32(ddlBusinessType.SelectedItem.Value); eocPropertyBean.Business_UserProfile_LoginEmail = txtEmail1.Text; eocPropertyBean.Business_UserProfile_CompanyName = txtCompany.Text; eocPropertyBean.Business_UserProfile_BusinessAddress = txtAddress.Text; eocPropertyBean.Province_ProvinceID = Convert.ToInt32(ddlProvince.SelectedItem.Value); eocPropertyBean.Business_UserProfile_ContactPhone = txtPhone.Text; eocPropertyBean.Business_UserProfile_CompanyURL = txtURL.Text; eocPropertyBean.Business_UserProfile_BillingPerson = txtBillingContact.Text; eocPropertyBean.Business_UserProfile_WebInventoryManager = txtInventoryManager.Text; eocPropertyBean.Business_UserProfile_CompanyProfile = txtProfile.Text; // eocPropertyBean.UpdatedOn = DateTime.Now; eocPropertyBean.CorporateImagePathEdit = ImagePathCorporateEdit.ToString(); intActionResult = bocUserProfile.UpdateRecord_UserProfile(eocPropertyBean); } } catch (Exception Exp) { lblSystemMessage.Text = Exp.Message.ToString(); } return(intActionResult); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { strLinkID = Request.QueryString["LinkCode"]; strProfileID = Request.QueryString["ProfileCode"]; if (!string.IsNullOrEmpty(strLinkID) && !string.IsNullOrEmpty(strProfileID)) { strLinkID = UTLUtilities.Decrypt(strLinkID); strProfileID = UTLUtilities.Decrypt(strProfileID); using (BOC_Corporate_UserProfile bocUserProfile = new BOC_Corporate_UserProfile()) { EOC_PropertyBean eocPropertyBean = new EOC_PropertyBean(); eocPropertyBean.Business_ActivationLinks_LinkID = Convert.ToInt32(strLinkID); eocPropertyBean.Business_UserProfile_ProfileID = Convert.ToInt32(strProfileID); eocPropertyBean.Business_ActivationLinks_IsChecked = true; intActionResult = bocUserProfile.UpdateRecord_ActivationLinks(eocPropertyBean); if (intActionResult > 0) { Response.Redirect("Default.aspx"); } else { lblSystemMessage.Text = "This link has been expired..."; } } } } }
/// <summary> /// Description : Load state wise province list. /// Stored Procedure : USP_CP_UsrPro_LoadProvince /// Associate Control: ddlProvince [Drop Down List] /// </summary> /// <param name="StateID">String</param> private void LoadRecord_Province(string StateID) { try { if (!string.IsNullOrEmpty(StateID) && StateID != "-1") { using (BOC_Corporate_UserProfile bocUserProfile = new BOC_Corporate_UserProfile()) { EOC_PropertyBean eocPropertyBean = new EOC_PropertyBean(); eocPropertyBean.State_StateID = Convert.ToInt32(StateID); DataTable dtPovince = bocUserProfile.LoadRecord_Province(eocPropertyBean); ddlProvince.Items.Clear(); ddlProvince.Items.Add(new ListItem("Select", "-1")); if (dtPovince.Rows.Count > 0) { ddlProvince.DataSource = dtPovince; ddlProvince.DataValueField = "ProvinceID"; ddlProvince.DataTextField = "Province"; ddlProvince.DataBind(); } } } } catch (Exception Exp) { lblSystemMessage.Text = Exp.Message.ToString(); } }
private int UpdateRecord_ChangePassword() { int intActionResult = 0; try { using (BOC_Corporate_UserProfile bocUserProfile = new BOC_Corporate_UserProfile()) { EOC_PropertyBean eocPropertyBean = new EOC_PropertyBean(); eocPropertyBean.Business_UserProfile_ProfileID = intProfileID; eocPropertyBean.Business_UserProfile_OldPassword = txtOldPassword.Text; eocPropertyBean.Business_UserProfile_LoginPassword = txtNewPassword1.Text; eocPropertyBean.UpdatedOn = DateTime.Now; intActionResult = bocUserProfile.UpdateRecord_ChangePassword(eocPropertyBean); } } catch (Exception Exp) { lblSystemMessage.Text = Exp.Message.ToString(); } return(intActionResult); }
/// <summary> /// Description : Insert new record in the table Business_UserProfile. /// Stored Procedure : USP_CP_UsrPro_BeforeInsert_IsLoginEmailDuplicate /// USP_CP_UsrPro_BeforeInsert_IsCompanyNameDuplicate /// USP_CP_UsrPro_InserRecord /// Associate Control: btnRegister [Button] /// </summary> /// <returns>Integer</returns> private int AddRecord_UserProfile() { int intActionResult = 0; try { using (BOC_Corporate_UserProfile bocUserProfile = new BOC_Corporate_UserProfile()) { EOC_PropertyBean eocPropertyBean = new EOC_PropertyBean(); eocPropertyBean.BusinessCategory_BusinessID = Convert.ToInt32(ddlBusinessType.SelectedItem.Value); eocPropertyBean.Business_UserProfile_LoginEmail = txtEmail1.Text; eocPropertyBean.Business_UserProfile_LoginPassword = txtPassword1.Text; eocPropertyBean.Business_UserProfile_CompanyName = txtCompany.Text; eocPropertyBean.Business_UserProfile_BusinessAddress = txtAddress.Text; eocPropertyBean.Business_UserProfile_ContactPhone = txtPhone.Text; eocPropertyBean.Business_UserProfile_CompanyURL = txtURL.Text; eocPropertyBean.Business_UserProfile_BillingPerson = txtBillingContact.Text; eocPropertyBean.Business_UserProfile_WebInventoryManager = txtInventoryManager.Text; eocPropertyBean.Business_UserProfile_CompanyProfile = txtProfile.Text; eocPropertyBean.Business_UserProfile_CompanyLogo = @"Corporate_Logos/default.png"; eocPropertyBean.CorporateImagePathE = ImagePath.ToString(); intActionResult = bocUserProfile.AddRecord_UserProfile(eocPropertyBean); } } catch (Exception Exp) { lblSystemMessage.Text = Exp.Message.ToString(); } return(intActionResult); }
/// <summary> /// Description : Load country list from the table Country. /// Stored Procedure : USP_CP_UsrPro_LoadCountry /// Associate Control: ddlCountry [Drop Down List] /// </summary> private void LoadRecord_Country() { try { using (BOC_Corporate_UserProfile bocUserProfile = new BOC_Corporate_UserProfile()) { ddlCountry.DataSource = bocUserProfile.LoadRecord_Country(); ddlCountry.DataValueField = "CountryID"; ddlCountry.DataTextField = "Country"; ddlCountry.DataBind(); } } catch (Exception Exp) { lblSystemMessage.Text = Exp.Message.ToString(); } }
/// <summary> /// Description : Check Business User login authentication. /// Stored Procedure : USP_CP_UsrPro_GetLoginInfo /// Associate Control: Executes in Page_Load event. /// </summary> private void IsLoginValid() { rfvLoginEmail.Enabled = true; revLoginEmail.Enabled = true; rfvPassword.Enabled = true; try { using (BOC_Corporate_UserProfile bocUserProfile = new BOC_Corporate_UserProfile()) { EOC_PropertyBean eocPropertyBean = new EOC_PropertyBean(); eocPropertyBean.Business_UserProfile_LoginEmail = txtLoginEmail.Text; eocPropertyBean.Business_UserProfile_LoginPassword = txtPassword.Text; if (!bocUserProfile.IsLoginValid(eocPropertyBean)) { lblSystemMessage.Text = "Access denied! Invalid Login Email or Password."; } else { if (!eocPropertyBean.Business_UserProfile_IsActive) { lblSystemMessage.Text = "Your corporate account is not active."; } else { this.Session.Clear(); this.Session["CORP_PROFILE_CODE"] = eocPropertyBean.Business_UserProfile_ProfileID.ToString(); this.Session["CORP_COUNTRY_CODE"] = "18"; //eocPropertyBean.Country_CountryID.ToString(); this.Session["COUNTRY"] = "Bangladesh"; //eocPropertyBean.Country_CountryName; this.Session["LOGINEMAIL"] = eocPropertyBean.Business_UserProfile_LoginEmail; this.Session["COMPANYNAME"] = eocPropertyBean.Business_UserProfile_CompanyName; this.Session["ISADMIN"] = eocPropertyBean.IsAdmin; Response.Redirect("ControlPanel.aspx"); } } } } catch (Exception Exp) { lblSystemMessage.Text = Exp.Message.ToString(); } }
protected void btnSubmit_Click(object sender, EventArgs e) { try { using (BOC_Corporate_UserProfile bocUserProfile = new BOC_Corporate_UserProfile()) { EOC_PropertyBean eocPropertyBean = new EOC_PropertyBean(); eocPropertyBean.Business_UserProfile_LoginEmail = txtLoginEmail.Text; DataTable dtLoginInfo = bocUserProfile.SelectRecord_ActivationLinks(eocPropertyBean); if (dtLoginInfo.Rows.Count > 0) { string mailFrom = "*****@*****.**"; string mailTo = txtLoginEmail.Text; string mailSubject = "Your Sign In details"; string mailMessage = string.Empty; mailMessage = "Dear " + dtLoginInfo.Rows[0]["BillingPerson"].ToString() + "," + Environment.NewLine; mailMessage += "Your Sign In details: " + Environment.NewLine; mailMessage += "<strong>Login Email :</strong>" + dtLoginInfo.Rows[0]["LoginEmail"].ToString() + Environment.NewLine; mailMessage += "<strong>Password :</strong>" + dtLoginInfo.Rows[0]["LoginPassword"].ToString() + Environment.NewLine; mailMessage += Environment.NewLine + Environment.NewLine; mailMessage += "Thanks," + Environment.NewLine; mailMessage += "boromela.com Team."; MailMaster.SendMail(mailTo, mailFrom, mailSubject, mailMessage); Response.Redirect("UserProfile_LoginInfo.aspx?mailSend=Yes"); } else { lblSystemMessage.Text = "Your entered email address is not associated with any of our corporate user account!"; } } } catch (Exception exp) { lblSystemMessage.Text = exp.Message.ToString(); } }
/// <summary> /// Description : Check Business User login authentication. /// Stored Procedure : USP_CP_UsrPro_GetLoginInfo /// Associate Control: Executes in Page_Load event. /// </summary> private void IsLoginValid() { try { using (BOC_Corporate_UserProfile bocUserProfile = new BOC_Corporate_UserProfile()) { EOC_PropertyBean eocPropertyBean = new EOC_PropertyBean(); eocPropertyBean.Business_UserProfile_LoginEmail = txtLoginEmail.Text; eocPropertyBean.Business_UserProfile_LoginPassword = txtPassword.Text; if (!bocUserProfile.IsLoginValid(eocPropertyBean)) { lblSystemMessage.Text = "Access denied! Invalid Login Email or Password."; } else { if (!eocPropertyBean.Business_UserProfile_IsActive) { lblSystemMessage.Text = "Your corporate account is not active."; } else { this.Session["CORP_PROFILE_CODE"] = eocPropertyBean.Business_UserProfile_ProfileID.ToString(); this.Session["CORP_COUNTRY_CODE"] = eocPropertyBean.Country_CountryID.ToString(); Response.Redirect("ControlPanel.aspx"); } } } } catch (Exception Exp) { lblSystemMessage.Text = Exp.Message.ToString(); } }
//private string strRedirect = string.Empty; private void IsBusinessUserLoginValid() { try { using (BOC_Corporate_UserProfile bocUserProfile = new BOC_Corporate_UserProfile()) { EOC_PropertyBean eocPropertyBean = new EOC_PropertyBean(); eocPropertyBean.Business_UserProfile_LoginEmail = txtLoginEmail.Text; eocPropertyBean.Business_UserProfile_LoginPassword = txtPassword.Text; if (!bocUserProfile.IsLoginValid(eocPropertyBean)) { lblSystemMessage.Text = "Access denied! Invalid Login Email or Password."; } else { if (!eocPropertyBean.Business_UserProfile_IsActive) { lblSystemMessage.Text = "Your corporate account is not active."; } else { this.Session["BS_ID"] = eocPropertyBean.Business_UserProfile_ProfileID.ToString(); this.Session["COUNTRY_ID"] = eocPropertyBean.Country_CountryID.ToString(); strEncryptedUrl = UTLUtilities.Encrypt("Type=BS"); isLoginValid = true; //Response.Redirect("~/Commmon/PlaceOrder.aspx"); } } } } catch (Exception Exp) { lblSystemMessage.Text = Exp.Message.ToString(); } }
/// <summary> /// Description : Send activation link through email to newly registered user. /// Stored Procedure : - /// Associate Control: Executes in Page_Load event. /// </summary> private void SendActivationLink() { try { using (BOC_Corporate_UserProfile bocUserProfile = new BOC_Corporate_UserProfile()) { EOC_PropertyBean eocPropertyBean = new EOC_PropertyBean(); eocPropertyBean.Business_UserProfile_LoginEmail = lblEmailAddress.Text; int intActionResult = bocUserProfile.AddRecord_ActivationLinks(eocPropertyBean); if (intActionResult == -1) { lblSystemMessage.Text = "User Profile not found. Please try after sometimes."; } else { if (intActionResult > 0) { DataTable dtActivationLink = bocUserProfile.SelectRecord_ActivationLinks(eocPropertyBean); if (dtActivationLink.Rows.Count > 0) { string companyName = string.Empty; string linkID = string.Empty; string profileID = string.Empty; string mailBody = string.Empty; MailMaster mailMaster = new MailMaster(); HttpServerUtility httpObject = HttpContext.Current.Server; companyName = dtActivationLink.Rows[0]["CompanyName"].ToString(); linkID = UTLUtilities.Encrypt(dtActivationLink.Rows[0]["LinkID"].ToString()); profileID = UTLUtilities.Encrypt(dtActivationLink.Rows[0]["ProfileID"].ToString()); mailBody = "<div style=\"font-family:Verdana; font-size:11px; padding-left:10px;\">"; mailBody += "Dear " + companyName + ","; mailBody += "<br/><br/>"; mailBody += "Thank you for registration at <a href=\"http://www.apnerdeal.com\"> www.apnerdeal.com</a> ! We are pleased to welcome you to our service and we hope that you will find it very valuable and useful."; mailBody += "<br/><br/>"; mailBody += "Your new account has been created, and only one more step is needed to login."; mailBody += "<br/>"; mailBody += "<br/>"; mailBody += "Please click <a href=\"http://www.apnerdeal.com/Corporate/Default.aspx" + "\">here</a> to post discounts or deals."; mailBody += "<br/><br/>"; mailBody += "Please click <a href=\"http://www.apnerdeal.com/Classifieds/Default.aspx" + "\">here</a> to post Classified Ad."; mailBody += "<br/><br/>"; mailBody += "If you are unable to click the link above, please copy and paste the following link into your browser window:"; mailBody += "<br/><br/>"; mailBody += "http://www.apnerdeal.com/corporate/UserProfile_Step03.aspx?LinkCode=" + httpObject.UrlEncode(linkID) + "&ProfileCode=" + httpObject.UrlEncode(profileID); mailBody += "<br/><br/>"; mailBody += "Best regards,"; mailBody += "<br/><br/>"; mailBody += "ApnerDeal.com Team"; mailBody += "<br/><br/>"; mailBody += "<p style=\"font-weight:bold; font-size:12px;\">This is a System Generated email, please do not reply.</p>"; mailBody += "</div>"; mailMaster.MailTo = lblEmailAddress.Text; mailMaster.MailFrom = "*****@*****.**"; mailMaster.MailSubject = "Welcome to your www.ApnerDeal.com account"; mailMaster.MailBody = mailBody; mailMaster.IsHTMLBody = true; mailMaster.SendMail(); } } else { lblSystemMessage.Text = "System failed to register your profile. Please try after sometimes."; } } } } catch (Exception Exp) { lblSystemMessage.Text = Exp.Message.ToString(); } }