protected void GetEmailCredentials() { CompanySetupBAL companyBAL = new CompanySetupBAL(); DataTable dt = new DataTable(); if (companyBAL.GetEmailCredentials(ref dt)) { txtUserId.Text = dt.Rows[0]["FieldName1"].ToString(); txtPassword.Text = dt.Rows[0]["FieldName2"].ToString(); txtSMTPServer.Text = dt.Rows[0]["FieldName3"].ToString(); txtPortNumber.Text = dt.Rows[0]["FieldName4"].ToString(); } }
protected void btnAdd_Click(object sender, EventArgs e) { CompanySetupBE company = new CompanySetupBE(); CompanySetupBAL companyBAL = new CompanySetupBAL(); LoggedIn master = (LoggedIn)this.Master; company.UserName = txtUserId.Text; company.Password = txtPassword.Text; company.IPAddress = txtSMTPServer.Text; company.PortNo = txtPortNumber.Text; if (companyBAL.InsertEmailCredentials(company)) { master.ShowMessage("Records Added Successfully", true); } }
protected void SmtpServerDetails(ref CompanySetupBE setupBE) { CompanySetupBAL setupBAL = new CompanySetupBAL(); DataTable dtEmailCredentials = new DataTable(); if (setupBAL.GetEmailCredentials(ref dtEmailCredentials)) { Session["ComapnySetup"] = dtEmailCredentials; setupBE.UserName = dtEmailCredentials.Rows[0]["FieldName1"].ToString(); setupBE.Password = dtEmailCredentials.Rows[0]["FieldName2"].ToString(); setupBE.IPAddress = dtEmailCredentials.Rows[0]["FieldName3"].ToString(); setupBE.PortNo = dtEmailCredentials.Rows[0]["FieldName4"].ToString(); } }