public static Acc_VoucherDet CheckToDelete(Int64 COAKey) { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); //CustomList<Acc_VoucherDet> Acc_VoucherDetCollection = new CustomList<Acc_VoucherDet>(); IDataReader reader = null; String sql = "select Top 1 * from Acc_VoucherDet Where COAKey=" + COAKey; try { conManager.OpenDataReader(sql, out reader); Acc_VoucherDet newAcc_VoucherDet = new Acc_VoucherDet(); while (reader.Read()) { newAcc_VoucherDet.SetData(reader); } return(newAcc_VoucherDet); } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) { reader.Close(); } } }
public static CustomList <Acc_VoucherDet> GetAllAcc_VoucherDet(Int64 voucherKey) { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList <Acc_VoucherDet> Acc_VoucherDetCollection = new CustomList <Acc_VoucherDet>(); IDataReader reader = null; String sql = "select VoucherDetKey,UserKey,ContactID,VoucherKey,COAKey,Convert(Decimal(18,2),Dr)Dr,Convert(Decimal(18,2),Cr)Cr,EntryDate,EntryUserKey,LastUpdateDate,LastUpdateUserKey,Criteria from Acc_VoucherDet Where VoucherKey=" + voucherKey; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { Acc_VoucherDet newAcc_VoucherDet = new Acc_VoucherDet(); newAcc_VoucherDet.SetData(reader); Acc_VoucherDetCollection.Add(newAcc_VoucherDet); } Acc_VoucherDetCollection.InsertSpName = "spInsertAcc_VoucherDet"; Acc_VoucherDetCollection.UpdateSpName = "spUpdateAcc_VoucherDet"; Acc_VoucherDetCollection.DeleteSpName = "spDeleteAcc_VoucherDet"; return(Acc_VoucherDetCollection); } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) { reader.Close(); } } }
public static CustomList <Acc_VoucherDet> GetAllAcc_VoucherDet() { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList <Acc_VoucherDet> Acc_VoucherDetCollection = new CustomList <Acc_VoucherDet>(); IDataReader reader = null; const String sql = "select *from Acc_VoucherDet"; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { Acc_VoucherDet newAcc_VoucherDet = new Acc_VoucherDet(); newAcc_VoucherDet.SetData(reader); Acc_VoucherDetCollection.Add(newAcc_VoucherDet); } Acc_VoucherDetCollection.InsertSpName = "spInsertAcc_VoucherDet"; Acc_VoucherDetCollection.UpdateSpName = "spUpdateAcc_VoucherDet"; Acc_VoucherDetCollection.DeleteSpName = "spDeleteAcc_VoucherDet"; return(Acc_VoucherDetCollection); } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) { reader.Close(); } } }
public static CustomList <Acc_VoucherDet> GetAllAcc_VoucherDet(Int64 voucherKey, string fromDate) { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList <Acc_VoucherDet> Acc_VoucherDetCollection = new CustomList <Acc_VoucherDet>(); IDataReader reader = null; String sql = "EXEC spGetVoucherDet " + voucherKey + ",'" + fromDate + "'"; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { Acc_VoucherDet newAcc_VoucherDet = new Acc_VoucherDet(); newAcc_VoucherDet.SetData(reader); newAcc_VoucherDet._Bal = reader.GetDecimal("Bal"); //newAcc_VoucherDet._Flag = reader.GetString("Flag"); Acc_VoucherDetCollection.Add(newAcc_VoucherDet); } Acc_VoucherDetCollection.InsertSpName = "spInsertAcc_VoucherDet"; Acc_VoucherDetCollection.UpdateSpName = "spUpdateAcc_VoucherDet"; Acc_VoucherDetCollection.DeleteSpName = "spDeleteAcc_VoucherDet"; return(Acc_VoucherDetCollection); } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) { reader.Close(); } } }
public static CustomList<Acc_VoucherDet> GetAllAcc_VoucherDet(Int64 voucherKey, string fromDate) { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList<Acc_VoucherDet> Acc_VoucherDetCollection = new CustomList<Acc_VoucherDet>(); IDataReader reader = null; String sql = "EXEC spGetVoucherDet " + voucherKey + ",'" + fromDate + "'"; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { Acc_VoucherDet newAcc_VoucherDet = new Acc_VoucherDet(); newAcc_VoucherDet.SetData(reader); newAcc_VoucherDet._Bal = reader.GetDecimal("Bal"); //newAcc_VoucherDet._Flag = reader.GetString("Flag"); Acc_VoucherDetCollection.Add(newAcc_VoucherDet); } Acc_VoucherDetCollection.InsertSpName = "spInsertAcc_VoucherDet"; Acc_VoucherDetCollection.UpdateSpName = "spUpdateAcc_VoucherDet"; Acc_VoucherDetCollection.DeleteSpName = "spDeleteAcc_VoucherDet"; return Acc_VoucherDetCollection; } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) reader.Close(); } }
public static CustomList<Acc_VoucherDet> GetAllAcc_VoucherDet(Int64 voucherKey) { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList<Acc_VoucherDet> Acc_VoucherDetCollection = new CustomList<Acc_VoucherDet>(); IDataReader reader = null; String sql = "select VoucherDetKey,VoucherKey,COAKey,PartyKey,BranchID,CostCenterID,Convert(Decimal(18,2),Dr)Dr,Convert(Decimal(18,2),Cr)Cr from Acc_VoucherDet Where VoucherKey=" + voucherKey; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { Acc_VoucherDet newAcc_VoucherDet = new Acc_VoucherDet(); newAcc_VoucherDet.SetData(reader); Acc_VoucherDetCollection.Add(newAcc_VoucherDet); } Acc_VoucherDetCollection.InsertSpName = "spInsertAcc_VoucherDet"; Acc_VoucherDetCollection.UpdateSpName = "spUpdateAcc_VoucherDet"; Acc_VoucherDetCollection.DeleteSpName = "spDeleteAcc_VoucherDet"; return Acc_VoucherDetCollection; } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) reader.Close(); } }
public static CustomList<Acc_VoucherDet> GetAllAcc_VoucherDet() { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList<Acc_VoucherDet> Acc_VoucherDetCollection = new CustomList<Acc_VoucherDet>(); IDataReader reader = null; const String sql = "select *from Acc_VoucherDet"; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { Acc_VoucherDet newAcc_VoucherDet = new Acc_VoucherDet(); newAcc_VoucherDet.SetData(reader); Acc_VoucherDetCollection.Add(newAcc_VoucherDet); } Acc_VoucherDetCollection.InsertSpName = "spInsertAcc_VoucherDet"; Acc_VoucherDetCollection.UpdateSpName = "spUpdateAcc_VoucherDet"; Acc_VoucherDetCollection.DeleteSpName = "spDeleteAcc_VoucherDet"; return Acc_VoucherDetCollection; } catch(Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) reader.Close(); } }