public static CustomList <CmnTransactionType> GetAllReferenceType() { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList <CmnTransactionType> CmnTransactionTypeCollection = new CustomList <CmnTransactionType>(); IDataReader reader = null; String sql = "select *from CmnTransactionType"; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { CmnTransactionType newCmnTransactionType = new CmnTransactionType(); newCmnTransactionType.SetData(reader); CmnTransactionTypeCollection.Add(newCmnTransactionType); } return(CmnTransactionTypeCollection); } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) { reader.Close(); } } }
public static CustomList<CmnTransactionType> GetAllReferenceType() { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList<CmnTransactionType> CmnTransactionTypeCollection = new CustomList<CmnTransactionType>(); IDataReader reader = null; String sql = "select *from CmnTransactionType"; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { CmnTransactionType newCmnTransactionType = new CmnTransactionType(); newCmnTransactionType.SetData(reader); CmnTransactionTypeCollection.Add(newCmnTransactionType); } return CmnTransactionTypeCollection; } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) reader.Close(); } }
private void PopulateTransactionTypeInformation(CmnTransactionType TransactionType) { try { txtTransactionTypeName.Text = TransactionType.TransTypeName; if (TransactionType.DocListID!=0) ddlDocList.SelectedValue = TransactionType.DocListID.ToString(); } catch (Exception ex) { throw (ex); } }
protected void btnSave_Click(object sender, EventArgs e) { try { CustomList<CmnTransactionType> lstTransactionType = TransactionTypeList; if (lstTransactionType.Count == 0) { CmnTransactionType newTransctionType = new CmnTransactionType(); lstTransactionType.Add(newTransctionType); } SetDataFromControlToObj(ref lstTransactionType); if (!CheckUserAuthentication(lstTransactionType)) return; _manager.SaveTransactionType(ref lstTransactionType); ((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)); } }