Exemple #1
0
        public static CustomList <CmnDocListTableMapping> GetAllCmnTransactionReferenceFind()
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            CustomList <CmnDocListTableMapping> CmnTransRefCollection = new CustomList <CmnDocListTableMapping>();
            IDataReader reader = null;
            String      sql    = "EXEC spFindDocListTableMaping";

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    CmnDocListTableMapping newCmnTransactionReference = new CmnDocListTableMapping();
                    newCmnTransactionReference.SetData(reader);
                    CmnTransRefCollection.Add(newCmnTransactionReference);
                }
                return(CmnTransRefCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
Exemple #2
0
        public static CustomList <CmnDocListTableMapping> GetAllCmnDocListTableMapping()
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            CustomList <CmnDocListTableMapping> CmnDocListTableMappingCollection = new CustomList <CmnDocListTableMapping>();
            IDataReader  reader = null;
            const String sql    = "select * from CmnDocListTableMapping";

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    CmnDocListTableMapping newCmnDocListTableMapping = new CmnDocListTableMapping();
                    newCmnDocListTableMapping.SetData(reader);
                    CmnDocListTableMappingCollection.Add(newCmnDocListTableMapping);
                }
                CmnDocListTableMappingCollection.InsertSpName = "spInsertCmnDocListTableMapping";
                CmnDocListTableMappingCollection.UpdateSpName = "spUpdateCmnDocListTableMapping";
                CmnDocListTableMappingCollection.DeleteSpName = "spDeleteCmnDocListTableMapping";
                return(CmnDocListTableMappingCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
 public static CustomList<CmnDocListTableMapping> GetAllCmnTransactionReferenceFind()
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
     CustomList<CmnDocListTableMapping> CmnTransRefCollection = new CustomList<CmnDocListTableMapping>();
     IDataReader reader = null;
     String sql = "EXEC spFindDocListTableMaping";
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             CmnDocListTableMapping newCmnTransactionReference = new CmnDocListTableMapping();
             newCmnTransactionReference.SetData(reader);
             CmnTransRefCollection.Add(newCmnTransactionReference);
         }
         return CmnTransRefCollection;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }
 public static CustomList<CmnDocListTableMapping> GetAllCmnDocListTableMapping()
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
     CustomList<CmnDocListTableMapping> CmnDocListTableMappingCollection = new CustomList<CmnDocListTableMapping>();
     IDataReader reader = null;
     const String sql = "select * from CmnDocListTableMapping";
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             CmnDocListTableMapping newCmnDocListTableMapping = new CmnDocListTableMapping();
             newCmnDocListTableMapping.SetData(reader);
             CmnDocListTableMappingCollection.Add(newCmnDocListTableMapping);
         }
         CmnDocListTableMappingCollection.InsertSpName = "spInsertCmnDocListTableMapping";
         CmnDocListTableMappingCollection.UpdateSpName = "spUpdateCmnDocListTableMapping";
         CmnDocListTableMappingCollection.DeleteSpName = "spDeleteCmnDocListTableMapping";
         return CmnDocListTableMappingCollection;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }
        private void PopulateTransactionReferenceInformation(CmnDocListTableMapping TransactionReference)
        {
            try
            {

                 ddlTableName.SelectedValue = TransactionReference.TableName.ToString();
                //ddlDetailForeignKey.SelectedValue = TransactionReference.DetailForeignKey.ToString();
                ddlColumnName.DataSource = _manager.GetAllDetailForeignKey(TransactionReference.TableName.ToString());
                ddlColumnName.DataTextField = "DetailForeignKey";
                ddlColumnName.DataValueField = "DetailForeignKey";
                ddlColumnName.DataBind();
                ddlColumnName.Items.Insert(0, new ListItem(String.Empty, String.Empty));
                ddlColumnName.SelectedIndex = 0;
                ddlColumnName.SelectedValue = TransactionReference.ColumnName.ToString();

                ddlDocList.SelectedValue = TransactionReference.DocListID.ToString();
                lblTableType.Text = TransactionReference.TableType.ToString();
                lblColumnType.Text = TransactionReference.ColumnType.ToString();

            }
            catch (Exception ex)
            {

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

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