public static CustomList <Acc_COA> GetAllAcc_COA() { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList <Acc_COA> Acc_COACollection = new CustomList <Acc_COA>(); IDataReader reader = null; String sql = "Select * From Acc_COA Where IsPostingHead = 1"; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { Acc_COA newAcc_COA = new Acc_COA(); newAcc_COA.SetData(reader); Acc_COACollection.Add(newAcc_COA); } return(Acc_COACollection); } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) { reader.Close(); } } }
public static CustomList <Acc_COA> GetAllAcc_COA_ByLevelAll(int isSubsidiary, int voucherType) { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList <Acc_COA> Acc_COACollection = new CustomList <Acc_COA>(); IDataReader reader = null; String sql = string.Format("Select * From Acc_COA Where IsActive = 1 AND IsSubsidiary = {0} AND (ParentKey=9 OR ParentKey={1}) Order by COAName ASC", isSubsidiary, voucherType); try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { Acc_COA newAcc_COA = new Acc_COA(); newAcc_COA.SetData(reader); Acc_COACollection.Add(newAcc_COA); } Acc_COACollection.InsertSpName = "spInsertAcc_COA"; Acc_COACollection.UpdateSpName = "spUpdateAcc_COA"; Acc_COACollection.DeleteSpName = "spDeleteAcc_COA"; return(Acc_COACollection); } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) { reader.Close(); } } }
public static CustomList <Acc_COA> GetAllAcc_COA_ByLevel(int level) { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList <Acc_COA> Acc_COACollection = new CustomList <Acc_COA>(); IDataReader reader = null; String sql = string.Format("Select * From Acc_COA Where IsActive = 1 And IsPostingHead = 1 Order by COAName ASC"); // String sql = string.Format("Select * From Acc_COA Where IsActive = 1 And COALevel = {0} Order by COAName ASC", level); try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { Acc_COA newAcc_COA = new Acc_COA(); newAcc_COA.SetData(reader); Acc_COACollection.Add(newAcc_COA); } return(Acc_COACollection); } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) { reader.Close(); } } }
public static CustomList <Acc_COA> GetAllAcc_COA(bool isAll = false) { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList <Acc_COA> Acc_COACollection = new CustomList <Acc_COA>(); IDataReader reader = null; String sql = string.Empty; if (isAll == true) { sql = "Select * From Acc_COA Where IsActive = 1 Order by COAName ASC"; } else { sql = "Select * From Acc_COA Where IsActive = 1 And IsSubsidiary=1 Order by COAName ASC"; } try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { Acc_COA newAcc_COA = new Acc_COA(); newAcc_COA.SetData(reader); Acc_COACollection.Add(newAcc_COA); } Acc_COACollection.InsertSpName = "spInsertAcc_COA"; Acc_COACollection.UpdateSpName = "spUpdateAcc_COA"; Acc_COACollection.DeleteSpName = "spDeleteAcc_COA"; return(Acc_COACollection); } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) { reader.Close(); } } }
public static CustomList <Acc_COA> GetAllCashOrBankCOA(String menuName) { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList <Acc_COA> Acc_COACollection = new CustomList <Acc_COA>(); IDataReader reader = null; String sql = ""; if (menuName == "CashPaymantVoucher" || menuName == "CashReceiveVoucher") { sql = "Select * From Acc_COA Where IsCash = 1"; } if (menuName == "BankPaymentVoucher" || menuName == "BankReceiveVoucher") { sql = "Select COA.* From Acc_COA COA INNER JOIN CmnBankAccount BA ON BA.COAID=COA.COAKey Where BA.IsCompany=1"; } try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { Acc_COA newAcc_COA = new Acc_COA(); newAcc_COA.SetData(reader); Acc_COACollection.Add(newAcc_COA); } return(Acc_COACollection); } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) { reader.Close(); } } }
public static CustomList<Acc_COA> GetAllCashOrBankCOA(String menuName) { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList<Acc_COA> Acc_COACollection = new CustomList<Acc_COA>(); IDataReader reader = null; String sql = ""; if (menuName == "CashPaymantVoucher" || menuName == "CashReceiveVoucher") sql = "Select * From Acc_COA Where IsCash = 1"; if (menuName == "BankPaymentVoucher" || menuName == "BankReceiveVoucher") sql = "Select COA.* From Acc_COA COA INNER JOIN CmnBankAccount BA ON BA.COAID=COA.COAKey Where BA.IsCompany=1"; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { Acc_COA newAcc_COA = new Acc_COA(); newAcc_COA.SetData(reader); Acc_COACollection.Add(newAcc_COA); } return Acc_COACollection; } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) reader.Close(); } }
public static CustomList<Acc_COA> GetAllAcc_COA_ByLevel(int level) { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList<Acc_COA> Acc_COACollection = new CustomList<Acc_COA>(); IDataReader reader = null; String sql = string.Format("Select * From Acc_COA Where IsActive = 1 And IsPostingHead = 1 Order by COAName ASC"); // String sql = string.Format("Select * From Acc_COA Where IsActive = 1 And COALevel = {0} Order by COAName ASC", level); try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { Acc_COA newAcc_COA = new Acc_COA(); newAcc_COA.SetData(reader); Acc_COACollection.Add(newAcc_COA); } return Acc_COACollection; } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) reader.Close(); } }
public static CustomList<Acc_COA> GetAllAcc_COA(bool isAll = false) { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList<Acc_COA> Acc_COACollection = new CustomList<Acc_COA>(); IDataReader reader = null; String sql = string.Empty; if (isAll == true) sql = "Select * From Acc_COA Where IsActive = 1 Order by COAName ASC"; else sql = "Select * From Acc_COA Where IsActive = 1 And COALevel=5 Order by COAName ASC"; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { Acc_COA newAcc_COA = new Acc_COA(); newAcc_COA.SetData(reader); Acc_COACollection.Add(newAcc_COA); } return Acc_COACollection; } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) reader.Close(); } }
public static CustomList<Acc_COA> GetAllAcc_COA() { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList<Acc_COA> Acc_COACollection = new CustomList<Acc_COA>(); IDataReader reader = null; String sql = "Select * From Acc_COA Where IsPostingHead = 1"; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { Acc_COA newAcc_COA = new Acc_COA(); newAcc_COA.SetData(reader); Acc_COACollection.Add(newAcc_COA); } return Acc_COACollection; } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) reader.Close(); } }