Ejemplo n.º 1
0
        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();
                }
            }
        }
Ejemplo n.º 2
0
 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();
     }
 }
Ejemplo n.º 3
0
        private void PopulateTransactionTypeInformation(CmnTransactionType TransactionType)
        {
            try
            {
                txtTransactionTypeName.Text = TransactionType.TransTypeName;
                if (TransactionType.DocListID!=0)
                ddlDocList.SelectedValue = TransactionType.DocListID.ToString();

            }
            catch (Exception ex)
            {

                throw (ex);
            }
        }
Ejemplo n.º 4
0
        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));
            }
        }