public static CustomList <SalaryRuleBackup> GetAllSalaryRuleBackup() { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList <SalaryRuleBackup> SalaryRuleBackupCollection = new CustomList <SalaryRuleBackup>(); IDataReader reader = null; String sql = "select Distinct SalaryRuleCode from SalaryRuleBackup "; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { SalaryRuleBackup newSalaryRuleBackup = new SalaryRuleBackup(); newSalaryRuleBackup.SetDataSalaryRuleCode(reader); SalaryRuleBackupCollection.Add(newSalaryRuleBackup); } SalaryRuleBackupCollection.InsertSpName = "spInsertSalaryRuleBackup"; SalaryRuleBackupCollection.UpdateSpName = "spUpdateSalaryRuleBackup"; SalaryRuleBackupCollection.DeleteSpName = "spDeleteSalaryRuleBackup"; return(SalaryRuleBackupCollection); } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) { reader.Close(); } } }
public static CustomList <SalaryRuleBackup> doSearch(string whereClause) { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList <SalaryRuleBackup> SalaryRuleBackupCollection = new CustomList <SalaryRuleBackup>(); IDataReader reader = null; String sql = string.Format("select Distinct SalaryRuleCode from SalaryRuleBackup Where 1=1 {0}", whereClause); try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { SalaryRuleBackup newSalaryRuleBackup = new SalaryRuleBackup(); newSalaryRuleBackup.SetDataSalaryRuleCode(reader); SalaryRuleBackupCollection.Add(newSalaryRuleBackup); } return(SalaryRuleBackupCollection); } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) { reader.Close(); } } }
public static SalaryRuleBackup SalaryInfoGridValidation(string salaryRuleCode, Int32 salaryHead) { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); SalaryRuleBackup newSalaryRule = new SalaryRuleBackup(); IDataReader reader = null; String sql = "select ParentHeadID,ParentHeadValue,PartialHeadID,PartialHeadValue,IsFormula from SalaryRuleBackup Where SalaryRuleCode='" + salaryRuleCode + "' And SalaryHeadKey=" + salaryHead; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { //newSalaryRule.SetDataSalaryInfoGridValidation(reader); newSalaryRule.ParentHeadID = reader.GetString("ParentHeadID"); newSalaryRule.ParentHeadValue = reader.GetDecimal("ParentHeadValue"); newSalaryRule.PartialHeadID = reader.GetString("PartialHeadID"); newSalaryRule.PartialHeadValue = reader.GetDecimal("PartialHeadValue"); newSalaryRule.IsFormula = reader.GetBoolean("IsFormula"); } return(newSalaryRule); } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) { reader.Close(); } } }