/// <summary> /// Returns a DataTable of deleted records matching the specified criteria /// </summary> /// <param name="i_oFilter">Filter criteria (WHERE clause)</param> /// <param name="i_oOutputFields">Fields to return (SELECT clause), pass null to return all fields(SELECT *)</param> /// <returns>DataTable</returns> public static DataTable Find_DataTable(cFilter i_oFilter, cFilterOutput i_oOutputFields) { SecurityCheck((int)enCountry_Action.Find); List <SqlParameter> a = new List <SqlParameter>(); a.Add(new SqlParameter("@sFilter", SqlDbType.VarChar, 8000)); if (i_oFilter == null) { a[a.Count - 1].Value = ""; } else { a[a.Count - 1].Value = i_oFilter.ToSQL_WHERE_Clause(new cCountry()); } a[a.Count - 1].Value = GetSecurityScopeFilter(a[a.Count - 1].Value.ToString(), (int)enCountry_Action.Find); a.Add(new SqlParameter("@sSelect", SqlDbType.VarChar, 8000)); if (i_oOutputFields == null) { a[a.Count - 1].Value = "*"; } else { a[a.Count - 1].Value = i_oOutputFields.ToString(new cCountry()); } DataTable dt = new DataTable(); bool bNoFilterOutput = i_oOutputFields == null; if (!bNoFilterOutput) { bNoFilterOutput = i_oOutputFields.aOutputs.Count < 1; } if (bNoFilterOutput) { dt.Columns.Add("iID"); dt.Columns.Add("sName"); dt.Columns.Add("dtCreatedOn"); dt.Columns.Add("dtLastUpdatedOn"); } else { for (int i = 0; i < i_oOutputFields.aOutputs.Count; i++) { dt.Columns.Add(i_oOutputFields.aOutputs[i].sName); } } oDB.CallSPROC(m_oClass.sName + "_Find", a, dt); if (!bNoFilterOutput) { for (int i = 0; i < i_oOutputFields.aOutputs.Count; i++) { dt.Columns[i_oOutputFields.aOutputs[i].sName].ColumnName = i_oOutputFields.aOutputs[i].ToString(); } } return(dt); }
using System;
/// <summary> /// Returns a DataTable of deleted records matching the specified criteria /// </summary> /// <param name="i_oFilter">Filter criteria (WHERE clause)</param> /// <param name="i_oOutputFields">Fields to return (SELECT clause), pass null to return all fields(SELECT *)</param> /// <returns>DataTable</returns> public static DataTable Find_DataTable(cFilter i_oFilter, cFilterOutput i_oOutputFields) { SecurityCheck((int)enEmpEducationDetail_Action.Find); List <SqlParameter> a = new List <SqlParameter>(); a.Add(new SqlParameter("@sFilter", SqlDbType.VarChar, 8000)); if (i_oFilter == null) { a[a.Count - 1].Value = ""; } else { a[a.Count - 1].Value = i_oFilter.ToSQL_WHERE_Clause(new cEmpEducationDetail()); } a[a.Count - 1].Value = GetSecurityScopeFilter(a[a.Count - 1].Value.ToString(), (int)enEmpEducationDetail_Action.Find); a.Add(new SqlParameter("@sSelect", SqlDbType.VarChar, 8000)); if (i_oOutputFields == null) { a[a.Count - 1].Value = "*"; } else { a[a.Count - 1].Value = i_oOutputFields.ToString(new cEmpEducationDetail()); } DataTable dt = new DataTable(); bool bNoFilterOutput = i_oOutputFields == null; if (!bNoFilterOutput) { bNoFilterOutput = i_oOutputFields.aOutputs.Count < 1; } if (bNoFilterOutput) { dt.Columns.Add("iID"); dt.Columns.Add("sName"); dt.Columns.Add("dtCreatedOn"); dt.Columns.Add("dtLastUpdatedOn"); dt.Columns.Add("sInstituteName"); dt.Columns.Add("sHigestDegree"); dt.Columns.Add("sUniversity"); dt.Columns.Add("sDegreeType"); dt.Columns.Add("sPassingYear"); dt.Columns.Add("fPercentage"); dt.Columns.Add("sSpecialization"); dt.Columns.Add("sCertification"); dt.Columns.Add("objEmpLogin"); dt.Columns.Add("bIsActive"); dt.Columns.Add("sEducationLevel"); } else { for (int i = 0; i < i_oOutputFields.aOutputs.Count; i++) { dt.Columns.Add(i_oOutputFields.aOutputs[i].sName); } } oDB.CallSPROC(m_oClass.sName + "_Find", a, dt); if (!bNoFilterOutput) { for (int i = 0; i < i_oOutputFields.aOutputs.Count; i++) { dt.Columns[i_oOutputFields.aOutputs[i].sName].ColumnName = i_oOutputFields.aOutputs[i].ToString(); } } return(dt); }
/// <summary> /// Returns a DataTable of deleted records matching the specified criteria /// </summary> /// <param name="i_oFilter">Filter criteria (WHERE clause)</param> /// <param name="i_oOutputFields">Fields to return (SELECT clause), pass null to return all fields(SELECT *)</param> /// <returns>DataTable</returns> public static DataTable Find_DataTable(cFilter i_oFilter, cFilterOutput i_oOutputFields) { SecurityCheck((int)enEmpPersonalDetails_Action.Find); List <SqlParameter> a = new List <SqlParameter>(); a.Add(new SqlParameter("@sFilter", SqlDbType.VarChar, 8000)); if (i_oFilter == null) { a[a.Count - 1].Value = ""; } else { a[a.Count - 1].Value = i_oFilter.ToSQL_WHERE_Clause(new cEmpPersonalDetails()); } a[a.Count - 1].Value = GetSecurityScopeFilter(a[a.Count - 1].Value.ToString(), (int)enEmpPersonalDetails_Action.Find); a.Add(new SqlParameter("@sSelect", SqlDbType.VarChar, 8000)); if (i_oOutputFields == null) { a[a.Count - 1].Value = "*"; } else { a[a.Count - 1].Value = i_oOutputFields.ToString(new cEmpPersonalDetails()); } DataTable dt = new DataTable(); bool bNoFilterOutput = i_oOutputFields == null; if (!bNoFilterOutput) { bNoFilterOutput = i_oOutputFields.aOutputs.Count < 1; } if (bNoFilterOutput) { dt.Columns.Add("iID"); dt.Columns.Add("sName"); dt.Columns.Add("dtCreatedOn"); dt.Columns.Add("dtLastUpdatedOn"); dt.Columns.Add("sFirstName"); dt.Columns.Add("sMiddleName"); dt.Columns.Add("sLastName"); dt.Columns.Add("sGender"); dt.Columns.Add("sFatherName"); dt.Columns.Add("sMotherName"); dt.Columns.Add("sCurrAddress"); dt.Columns.Add("sPerAddress"); dt.Columns.Add("sMartialStatus"); dt.Columns.Add("dtDOB"); dt.Columns.Add("sGovtID"); dt.Columns.Add("sCity"); dt.Columns.Add("sState"); dt.Columns.Add("sZipCode"); dt.Columns.Add("sCountry"); dt.Columns.Add("sNationality"); dt.Columns.Add("sPerContactNo"); dt.Columns.Add("sWorkTelp"); dt.Columns.Add("sPersoanlEmailID"); dt.Columns.Add("bIsActive"); dt.Columns.Add("objEmpLogin"); } else { for (int i = 0; i < i_oOutputFields.aOutputs.Count; i++) { dt.Columns.Add(i_oOutputFields.aOutputs[i].sName); } } oDB.CallSPROC(m_oClass.sName + "_Find", a, dt); if (!bNoFilterOutput) { for (int i = 0; i < i_oOutputFields.aOutputs.Count; i++) { dt.Columns[i_oOutputFields.aOutputs[i].sName].ColumnName = i_oOutputFields.aOutputs[i].ToString(); } } return(dt); }
/// <summary> /// Returns a DataTable of deleted records matching the specified criteria /// </summary> /// <param name="i_oFilter">Filter criteria (WHERE clause)</param> /// <param name="i_oOutputFields">Fields to return (SELECT clause), pass null to return all fields(SELECT *)</param> /// <returns>DataTable</returns> public static DataTable Find_DataTable(cFilter i_oFilter, cFilterOutput i_oOutputFields) { SecurityCheck((int)enExcelEmployeeData_Action.Find); List <SqlParameter> a = new List <SqlParameter>(); a.Add(new SqlParameter("@sFilter", SqlDbType.VarChar, 8000)); if (i_oFilter == null) { a[a.Count - 1].Value = ""; } else { a[a.Count - 1].Value = i_oFilter.ToSQL_WHERE_Clause(new cExcelEmployeeData()); } a[a.Count - 1].Value = GetSecurityScopeFilter(a[a.Count - 1].Value.ToString(), (int)enExcelEmployeeData_Action.Find); a.Add(new SqlParameter("@sSelect", SqlDbType.VarChar, 8000)); if (i_oOutputFields == null) { a[a.Count - 1].Value = "*"; } else { a[a.Count - 1].Value = i_oOutputFields.ToString(new cExcelEmployeeData()); } DataTable dt = new DataTable(); bool bNoFilterOutput = i_oOutputFields == null; if (!bNoFilterOutput) { bNoFilterOutput = i_oOutputFields.aOutputs.Count < 1; } if (bNoFilterOutput) { dt.Columns.Add("iID"); dt.Columns.Add("sName"); dt.Columns.Add("dtCreatedOn"); dt.Columns.Add("dtLastUpdatedOn"); dt.Columns.Add("sFirstName"); dt.Columns.Add("sMiddleName"); dt.Columns.Add("sLastNam"); dt.Columns.Add("sWorkEmailaID"); dt.Columns.Add("sDepartment"); dt.Columns.Add("sFunctionalGroup"); dt.Columns.Add("sDesignation"); dt.Columns.Add("sPersonalEmailID"); dt.Columns.Add("sTitle"); dt.Columns.Add("sPassword"); dt.Columns.Add("sReportingHead"); dt.Columns.Add("sRollAccess"); dt.Columns.Add("sLocation"); dt.Columns.Add("dtDOJ"); } else { for (int i = 0; i < i_oOutputFields.aOutputs.Count; i++) { dt.Columns.Add(i_oOutputFields.aOutputs[i].sName); } } oDB.CallSPROC(m_oClass.sName + "_Find", a, dt); if (!bNoFilterOutput) { for (int i = 0; i < i_oOutputFields.aOutputs.Count; i++) { dt.Columns[i_oOutputFields.aOutputs[i].sName].ColumnName = i_oOutputFields.aOutputs[i].ToString(); } } return(dt); }