public static CustomList <MailSetup> GetAllHOD() { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList <MailSetup> MailSetupCollection = new CustomList <MailSetup>(); IDataReader reader = null; String sql = "select Distinct FunctionalBoss from EmployeeInfoDetails Where FunctionalBoss is not null "; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { MailSetup newMailSetup = new MailSetup(); newMailSetup.EmpKey = reader.GetInt64("FunctionalBoss"); MailSetupCollection.Add(newMailSetup); } return(MailSetupCollection); } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) { reader.Close(); } } }
public static CustomList <MailSetup> GetApprovedEmpForLeave(string empKey, Boolean IsForwarded, Boolean IsRecomended, Boolean IsApproved, Boolean IsRejected) { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList <MailSetup> MailSetupCollection = new CustomList <MailSetup>(); IDataReader reader = null; String sql = "spGetApprovedEmpMailAddress " + empKey + "," + IsForwarded + "," + IsRecomended + "," + IsApproved + "," + IsRejected; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { MailSetup newMailSetup = new MailSetup(); newMailSetup.EmailAddress = reader.GetString("EmailAddress"); newMailSetup.Subject = reader.GetString("Subject"); newMailSetup.FileName = reader.GetString("FileName"); newMailSetup.Body = reader.GetString("Body"); newMailSetup.NickName = reader.GetString("NickName"); MailSetupCollection.Add(newMailSetup); } return(MailSetupCollection); } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) { reader.Close(); } } }
protected void ddlReportList_SelectedIndexChanged(object sender, EventArgs e) { try { chkIndividual.Checked = false; chkDirector.Checked = false; chkOptional.Checked = false; MailSetupList = manager.GetAllMailSetup(Convert.ToInt32(ddlReportList.SelectedValue)); API.DAO.MailSetup masterInfo = MailSetupList.Find(f => f.IsIndividual || f.IsDirector || f.IsOptional || f.Subject.IsNotNullOrEmpty() || f.FileName.IsNotNullOrEmpty() || f.Body.IsNotNullOrEmpty()); if (masterInfo.IsNotNull()) { chkIndividual.Checked = masterInfo.IsIndividual; chkDirector.Checked = masterInfo.IsDirector; chkOptional.Checked = masterInfo.IsOptional; txtSubject.Text = masterInfo.Subject; txtFileName.Text = masterInfo.FileName; txtBody.Text = masterInfo.Body; chkSubject.Checked = masterInfo.IsSubjectYM; chkFileName.Checked = masterInfo.IsFileNameYM; } } catch (Exception ex) { throw (ex); } }
public static CustomList <MailSetup> GetAllMailSetup(Int32 reportID) { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList <MailSetup> MailSetupCollection = new CustomList <MailSetup>(); IDataReader reader = null; String sql = "EXEC spGetMail " + reportID; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { MailSetup newMailSetup = new MailSetup(); newMailSetup.SetData(reader); MailSetupCollection.Add(newMailSetup); } return(MailSetupCollection); } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) { reader.Close(); } } }
protected void btnSave_Click(object sender, EventArgs e) { try { CustomList <API.DAO.MailSetup> lstMailSetup = (CustomList <API.DAO.MailSetup>)MailSetupList; CustomList <API.DAO.MailSetup> checkedMailList = lstMailSetup.FindAll(f => f.EmailAddress.Trim() != "" && f.IsChecked); if (checkedMailList.Count != 0) { API.DAO.MailSetup mS = checkedMailList[0]; mS.IsIndividual = chkIndividual.Checked; mS.IsDirector = chkDirector.Checked; mS.IsOptional = chkOptional.Checked; mS.Subject = txtSubject.Text; mS.FileName = txtFileName.Text; mS.Body = txtBody.Text; mS.IsSubjectYM = chkSubject.Checked; mS.IsFileNameYM = chkFileName.Checked; } foreach (API.DAO.MailSetup mS in checkedMailList) { if (mS.IsChecked) { if (mS.ReportID == 0) { mS.SetAdded(); mS.ReportID = ddlReportList.SelectedValue.ToInt(); } } else { mS.Delete(); } } if (!CheckUserAuthentication(checkedMailList)) { return; } manager.SaveMailSetup(checkedMailList); ((PageBase)this.Page).SuccessMessage = (StaticInfo.SavedSuccessfullyMsg); } catch (SqlException ex) { ((PageBase)this.Page).ErrorMessage = (ExceptionHelper.getSqlExceptionMessage(ex)); } catch (Exception ex) { ((PageBase)this.Page).ErrorMessage = (ExceptionHelper.getExceptionMessage(ex)); } }
public static CustomList<MailSetup> GetSupervisorForLeave(string empKey) { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList<MailSetup> MailSetupCollection = new CustomList<MailSetup>(); IDataReader reader = null; String sql = "spGetSupervisorMailAddress " + empKey; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { MailSetup newMailSetup = new MailSetup(); newMailSetup.EmailAddress = reader.GetString("EmailAddress"); newMailSetup.Subject = reader.GetString("Subject"); newMailSetup.FileName = reader.GetString("FileName"); newMailSetup.Body = reader.GetString("Body"); newMailSetup.NickName = reader.GetString("NickName"); MailSetupCollection.Add(newMailSetup); } return MailSetupCollection; } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) reader.Close(); } }
public static CustomList<MailSetup> GetAllSupervisor() { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList<MailSetup> MailSetupCollection = new CustomList<MailSetup>(); IDataReader reader = null; String sql = "select Distinct Supervisor from EmployeeInfoDetails Where Supervisor is not null"; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { MailSetup newMailSetup = new MailSetup(); newMailSetup.EmpKey = reader.GetInt64("Supervisor"); MailSetupCollection.Add(newMailSetup); } return MailSetupCollection; } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) reader.Close(); } }
public static CustomList<MailSetup> GetAllMailSetup(Int32 reportID) { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList<MailSetup> MailSetupCollection = new CustomList<MailSetup>(); IDataReader reader = null; String sql = "EXEC spGetMail " + reportID; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { MailSetup newMailSetup = new MailSetup(); newMailSetup.SetData(reader); MailSetupCollection.Add(newMailSetup); } return MailSetupCollection; } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) reader.Close(); } }
private void _SearchByEmpCodeToSetEmail() { try { String refSourceString = String.Empty; String selectionCriteria = HttpContext.Current.Request.QueryString["SelectionCriteria"]; String empCode = HttpContext.Current.Request.QueryString["EmpCode"]; CustomList<MailSetup> MailSetupList = (CustomList<MailSetup>)HttpContext.Current.Session["MailSetup_MailSetupList"]; MailSetup item = new MailSetup(); switch (selectionCriteria) { case "EmpCode": item = MailSetupList.Find(f => f.EmpCode.ToUpper() == empCode.ToUpper()); if (item.EmailAddress.Trim() == "") break; MailSetupList.Remove(item); MailSetupList.Insert(0, item); break; } if (item.IsNull() || item.EmailAddress.Trim() == "") refSourceString = "false"; else item.IsChecked = true; HttpContext.Current.Response.Clear(); HttpContext.Current.Response.ContentType = "text/plain"; HttpContext.Current.Response.Write(refSourceString); HttpContext.Current.Response.Flush(); } catch (Exception ex) { throw (ex); } }