Exemplo n.º 1
0
        public CustomList <CmnTransactionReference> GetAllReferenceDetailTableList()
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            CustomList <CmnTransactionReference> CmnTransRefCollection = new CustomList <CmnTransactionReference>();
            IDataReader  reader = null;
            const String sql    = "select TABLE_NAME as ReferenceDetailTable from API.INFORMATION_SCHEMA.TABLES";

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    CmnTransactionReference newCmnTransactionReference = new CmnTransactionReference();
                    newCmnTransactionReference.SetData(reader);
                    CmnTransRefCollection.Add(newCmnTransactionReference);
                }
                CmnTransRefCollection.InsertSpName = "spInsertCmnTransRef";
                CmnTransRefCollection.UpdateSpName = "spUpdateCmnTransRef";
                CmnTransRefCollection.DeleteSpName = "spDeleteCmnTransRef";
                return(CmnTransRefCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
Exemplo n.º 2
0
        public static CustomList <CmnTransactionReference> GetAllDetailForeignKey(string referenceDetailTables)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            CustomList <CmnTransactionReference> CmnTransRefCollection = new CustomList <CmnTransactionReference>();
            IDataReader reader = null;
            string      sql    = "select '1' as ReferenceDetailTable,1 as TransRefID,'1' as CustomCode, '1' as ReferenceName,'1' as TypeName,1 as TransRef, 1 as TransTypeID,'1' as ReferenceMasterTable,COLUMN_NAME as DetailForeignKey,'1' as TransactionTypeColumn,  1 as CompanyID from API.INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = '" + referenceDetailTables + "'";

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    CmnTransactionReference newCmnTransactionReference = new CmnTransactionReference();
                    newCmnTransactionReference.SetData(reader);
                    CmnTransRefCollection.Add(newCmnTransactionReference);
                }
                CmnTransRefCollection.InsertSpName = "spInsertCmnTransRef";
                CmnTransRefCollection.UpdateSpName = "spUpdateCmnTransRef";
                CmnTransRefCollection.DeleteSpName = "spDeleteCmnTransRef";
                return(CmnTransRefCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
Exemplo n.º 3
0
        public static CustomList <CmnTransactionReference> GetAllCmnTransactionReferenceFind()
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            CustomList <CmnTransactionReference> CmnTransRefCollection = new CustomList <CmnTransactionReference>();
            IDataReader  reader = null;
            const String sql    = " SELECT CTTrTy.TransTypeName ReferenceName, CTT.TransTypeName TypeName, CTR.* FROM CmnTransRef CTR INNER JOIN CmnTransactionType CTTrTy ON CTR.TransRef = CTTrTy.TransTypeID INNER JOIN CmnTransactionType CTT ON CTR.TransTypeID = CTT.TransTypeID ";

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    CmnTransactionReference newCmnTransactionReference = new CmnTransactionReference();
                    newCmnTransactionReference.SetData(reader);
                    CmnTransRefCollection.Add(newCmnTransactionReference);
                }
                CmnTransRefCollection.InsertSpName = "spInsertCmnTransRef";
                CmnTransRefCollection.UpdateSpName = "spUpdateCmnTransRef";
                CmnTransRefCollection.DeleteSpName = "spDeleteCmnTransRef";
                return(CmnTransRefCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
Exemplo n.º 4
0
        public static CustomList <CmnTransactionReference> GetAllReferenceType(Int32 TransRefID)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            CustomList <CmnTransactionReference> CmnTransactionReferenceCollection = new CustomList <CmnTransactionReference>();
            IDataReader reader = null;
            String      sql    = "spGetRefType " + TransRefID;

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    CmnTransactionReference newCmnTransactionReference = new CmnTransactionReference();
                    newCmnTransactionReference.SetDataForDropdown(reader);
                    CmnTransactionReferenceCollection.Add(newCmnTransactionReference);
                }
                return(CmnTransactionReferenceCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
Exemplo n.º 5
0
 public CustomList<CmnTransactionReference> GetAllReferenceDetailTableList()
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
     CustomList<CmnTransactionReference> CmnTransRefCollection = new CustomList<CmnTransactionReference>();
     IDataReader reader = null;
     const String sql = "select TABLE_NAME as ReferenceDetailTable from API.INFORMATION_SCHEMA.TABLES";
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             CmnTransactionReference newCmnTransactionReference = new CmnTransactionReference();
             newCmnTransactionReference.SetData(reader);
             CmnTransRefCollection.Add(newCmnTransactionReference);
         }
         CmnTransRefCollection.InsertSpName = "spInsertCmnTransRef";
         CmnTransRefCollection.UpdateSpName = "spUpdateCmnTransRef";
         CmnTransRefCollection.DeleteSpName = "spDeleteCmnTransRef";
         return CmnTransRefCollection;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }
Exemplo n.º 6
0
 public static CustomList<CmnTransactionReference> GetAllReferenceType(Int32 TransRefID)
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
     CustomList<CmnTransactionReference> CmnTransactionReferenceCollection = new CustomList<CmnTransactionReference>();
     IDataReader reader = null;
     String sql = "spGetRefType " + TransRefID;
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             CmnTransactionReference newCmnTransactionReference = new CmnTransactionReference();
             newCmnTransactionReference.SetDataForDropdown(reader);
             CmnTransactionReferenceCollection.Add(newCmnTransactionReference);
         }
         return CmnTransactionReferenceCollection;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }
Exemplo n.º 7
0
 public static CustomList<CmnTransactionReference> GetAllReferenceMasterTable()
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
     CustomList<CmnTransactionReference> CmnTransRefCollection = new CustomList<CmnTransactionReference>();
     IDataReader reader = null;
     const String sql = "select '1' as ReferenceDetailTable,1 as TransRefID,'1' as CustomCode,'1' as ReferenceName,'1' as TypeName,1 as TransRef,1 as TransTypeID,TABLE_NAME as ReferenceMasterTable,'1' as DetailForeignKey,'1' as TransactionTypeColumn, 1 as CompanyID from API.INFORMATION_SCHEMA.TABLES";
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             CmnTransactionReference newCmnTransactionReference = new CmnTransactionReference();
             newCmnTransactionReference.SetData(reader);
             CmnTransRefCollection.Add(newCmnTransactionReference);
         }
         CmnTransRefCollection.InsertSpName = "spInsertCmnTransRef";
         CmnTransRefCollection.UpdateSpName = "spUpdateCmnTransRef";
         CmnTransRefCollection.DeleteSpName = "spDeleteCmnTransRef";
         return CmnTransRefCollection;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }
Exemplo n.º 8
0
 public static CustomList<CmnTransactionReference> GetAllCmnTransactionReferenceFind()
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
     CustomList<CmnTransactionReference> CmnTransRefCollection = new CustomList<CmnTransactionReference>();
     IDataReader reader = null;
     const String sql = " SELECT CTTrTy.TransTypeName ReferenceName, CTT.TransTypeName TypeName, CTR.* FROM CmnTransRef CTR INNER JOIN CmnTransactionType CTTrTy ON CTR.TransRef = CTTrTy.TransTypeID INNER JOIN CmnTransactionType CTT ON CTR.TransTypeID = CTT.TransTypeID ";
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             CmnTransactionReference newCmnTransactionReference = new CmnTransactionReference();
             newCmnTransactionReference.SetData(reader);
             CmnTransRefCollection.Add(newCmnTransactionReference);
         }
         CmnTransRefCollection.InsertSpName = "spInsertCmnTransRef";
         CmnTransRefCollection.UpdateSpName = "spUpdateCmnTransRef";
         CmnTransRefCollection.DeleteSpName = "spDeleteCmnTransRef";
         return CmnTransRefCollection;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }
        private void PopulateTransactionReferenceInformation(CmnTransactionReference TransactionReference)
        {
            try
            {

                if (TransactionReference.TransRefID != 0)
                    ddlReferenceMasterTable.SelectedValue = TransactionReference.ReferenceMasterTable.ToString();
                //ddlDetailForeignKey.SelectedValue = TransactionReference.DetailForeignKey.ToString();
                ddlDetailForeignKey.DataSource = _manager.GetAllDetailForeignKey(TransactionReference.ReferenceDetailTable.ToString());
                ddlDetailForeignKey.DataTextField = "DetailForeignKey";
                ddlDetailForeignKey.DataValueField = "DetailForeignKey";
                ddlDetailForeignKey.DataBind();
                ddlDetailForeignKey.Items.Insert(0, new ListItem(String.Empty, String.Empty));
                ddlDetailForeignKey.SelectedIndex = 0;
                ddlDetailForeignKey.SelectedValue = TransactionReference.DetailForeignKey.ToString();

                ddlReferenceDetailTable.SelectedValue = TransactionReference.ReferenceDetailTable.ToString();
                ddlTransactionReferenceName.SelectedValue = TransactionReference.TransRefID.ToString();
                ddlTransTypeName.SelectedValue = TransactionReference.TransTypeID.ToString();
                txtTransactionTypeColumn.Text = TransactionReference.TransactionTypeColumn.ToString();

            }
            catch (Exception ex)
            {

                throw (ex);
            }
        }
Exemplo n.º 10
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                CustomList<CmnTransactionReference> lstTransactionReference = TransactionReferenceList;
                if (lstTransactionReference.Count == 0)
                {
                    CmnTransactionReference newTransactionReference = new CmnTransactionReference();
                    lstTransactionReference.Add(newTransactionReference);
                }
                SetDataFromControlToObj(ref lstTransactionReference);

                if (!CheckUserAuthentication(lstTransactionReference)) return;
                _manager.SaveTransactionReference(ref lstTransactionReference);
                ((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));
            }
        }