DataTable IMDAttendanceLeaveAndHolidayCategoryFacade.GetDT(Int32?currentPage, Int32?pageSize, String sortExpression, String filterExpression, DatabaseOperationType option)
 {
     return(DataAccessFactory.CreateMDAttendanceLeaveAndHolidayCategoryDataAccess().GetDT(currentPage, pageSize, sortExpression, filterExpression, option));
 }
Example #2
0
        Int64 IMDItemThumbRuleDataAccess.Update(MDItemThumbRuleEntity mDItemThumbRuleEntity, String filterExpression, DatabaseOperationType option, TransactionRequired reqTran)
        {
            try
            {
                long retValues = -99;

                switch (reqTran)
                {
                case TransactionRequired.No:
                {
                    retValues = Update(mDItemThumbRuleEntity, filterExpression, option);
                    break;
                }

                case TransactionRequired.Yes:
                {
                    retValues = UpdateTran(mDItemThumbRuleEntity, filterExpression, option);
                    break;
                }

                default:
                {
                    retValues = -99;
                    break;
                }
                }

                return(retValues);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #3
0
 DataTable IMDAssetOwnerTypeFacade.GetDT(Int32?currentPage, Int32?pageSize, String sortExpression, String filterExpression, DatabaseOperationType option)
 {
     return(DataAccessFactory.CreateMDAssetOwnerTypeDataAccess().GetDT(currentPage, pageSize, sortExpression, filterExpression, option));
 }
 IList <Int64> IMDAttendanceLeaveAndHolidayCategoryFacade.Add(IList <MDAttendanceLeaveAndHolidayCategoryEntity> mDAttendanceLeaveAndHolidayCategoryEntityList, DatabaseOperationType option, TransactionRequired reqTran)
 {
     return(DataAccessFactory.CreateMDAttendanceLeaveAndHolidayCategoryDataAccess().Add(mDAttendanceLeaveAndHolidayCategoryEntityList, option, reqTran));
 }
        DataTable IMDOperatorStatusDataAccess.GetDT(Int32?currentPage, Int32?pageSize, String sortExpression, String filterExpression, DatabaseOperationType option)
        {
            try
            {
                const string SP = "dbo.MDOperatorStatus_GET";

                using (DbCommand cmd = Database.GetStoredProcCommand(SP))
                {
                    AddOptionParameter(cmd, option);
                    AddCurrentPageParameter(cmd, currentPage);
                    AddPageSizeParameter(cmd, pageSize);
                    AddSortExpressionParameter(cmd, sortExpression);
                    AddFilterExpressionParameter(cmd, filterExpression);

                    DataSet ds = new DataSet();
                    ds = Database.ExecuteDataSet(cmd);

                    if (ds.Tables.Count > 0)
                    {
                        return(ds.Tables[0]);
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #6
0
 IList <Int64> IMDAssetOwnerTypeFacade.Add(IList <MDAssetOwnerTypeEntity> mDAssetOwnerTypeEntityList, DatabaseOperationType option, TransactionRequired reqTran)
 {
     return(DataAccessFactory.CreateMDAssetOwnerTypeDataAccess().Add(mDAssetOwnerTypeEntityList, option, reqTran));
 }
Example #7
0
 IList <Int64> IACTDSFacade.Add(IList <ACTDSEntity> aCTDSEntityList, DatabaseOperationType option, TransactionRequired reqTran)
 {
     return(DataAccessFactory.CreateACTDSDataAccess().Add(aCTDSEntityList, option, reqTran));
 }
        IList <Int64> IMDOperatorStatusDataAccess.Delete(IList <MDOperatorStatusEntity> mDOperatorStatusEntityList, String filterExpression, DatabaseOperationType option, TransactionRequired reqTran)
        {
            IList <Int64> returnCodeList = new List <Int64>();

            long returnCode = -99;

            foreach (MDOperatorStatusEntity mDOperatorStatusEntity in mDOperatorStatusEntityList)
            {
                returnCode = (this as IMDOperatorStatusDataAccess).Delete(mDOperatorStatusEntity, filterExpression, option, reqTran);

                returnCodeList.Add(returnCode);
            }

            return(returnCodeList);
        }
Example #9
0
 Int64 IACTDSFacade.Add(ACTDSEntity aCTDSEntity, DatabaseOperationType option, TransactionRequired reqTran)
 {
     return(DataAccessFactory.CreateACTDSDataAccess().Add(aCTDSEntity, option, reqTran));
 }
Example #10
0
 Int64 IACTDSFacade.Update(ACTDSEntity aCTDSEntity, String filterExpression, DatabaseOperationType option, TransactionRequired reqTran)
 {
     return(DataAccessFactory.CreateACTDSDataAccess().Update(aCTDSEntity, filterExpression, option, reqTran));
 }
Example #11
0
 DataTable ICMConsultantEnlistedWorkAreaFacade.GetDT(Int32?currentPage, Int32?pageSize, String sortExpression, String filterExpression, DatabaseOperationType option)
 {
     return(DataAccessFactory.CreateCMConsultantEnlistedWorkAreaDataAccess().GetDT(currentPage, pageSize, sortExpression, filterExpression, option));
 }
Example #12
0
 IList <Int64> ICMConsultantEnlistedWorkAreaFacade.Delete(IList <CMConsultantEnlistedWorkAreaEntity> cMConsultantEnlistedWorkAreaEntityList, String filterExpression, DatabaseOperationType option, TransactionRequired reqTran)
 {
     return(DataAccessFactory.CreateCMConsultantEnlistedWorkAreaDataAccess().Delete(cMConsultantEnlistedWorkAreaEntityList, filterExpression, option, reqTran));
 }
Example #13
0
 IList <Int64> ICMConsultantEnlistedWorkAreaFacade.Add(IList <CMConsultantEnlistedWorkAreaEntity> cMConsultantEnlistedWorkAreaEntityList, DatabaseOperationType option, TransactionRequired reqTran)
 {
     return(DataAccessFactory.CreateCMConsultantEnlistedWorkAreaDataAccess().Add(cMConsultantEnlistedWorkAreaEntityList, option, reqTran));
 }
Example #14
0
 Int64 ICMConsultantEnlistedWorkAreaFacade.Update(CMConsultantEnlistedWorkAreaEntity cMConsultantEnlistedWorkAreaEntity, String filterExpression, DatabaseOperationType option, TransactionRequired reqTran)
 {
     return(DataAccessFactory.CreateCMConsultantEnlistedWorkAreaDataAccess().Update(cMConsultantEnlistedWorkAreaEntity, filterExpression, option, reqTran));
 }
Example #15
0
 IList <Int64> IACTDSFacade.Delete(IList <ACTDSEntity> aCTDSEntityList, String filterExpression, DatabaseOperationType option, TransactionRequired reqTran)
 {
     return(DataAccessFactory.CreateACTDSDataAccess().Delete(aCTDSEntityList, filterExpression, option, reqTran));
 }
        Int64 IMDOperatorStatusDataAccess.Add(MDOperatorStatusEntity mDOperatorStatusEntity, DatabaseOperationType option, TransactionRequired reqTran)
        {
            try
            {
                long retValues = -99;

                switch (reqTran)
                {
                case TransactionRequired.No:
                {
                    retValues = Add(mDOperatorStatusEntity, option);
                    break;
                }

                case TransactionRequired.Yes:
                {
                    retValues = AddTran(mDOperatorStatusEntity, option);
                    break;
                }

                default:
                {
                    retValues = -99;
                    break;
                }
                }

                return(retValues);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #17
0
 IList <ACTDSEntity> IACTDSFacade.GetIL(Int32?currentPage, Int32?pageSize, String sortExpression, String filterExpression, DatabaseOperationType option)
 {
     return(DataAccessFactory.CreateACTDSDataAccess().GetIL(currentPage, pageSize, sortExpression, filterExpression, option));
 }
        IList <MDOperatorStatusEntity> IMDOperatorStatusDataAccess.GetIL(Int32?currentPage, Int32?pageSize, String sortExpression, String filterExpression, DatabaseOperationType option)
        {
            try
            {
                const string SP = "dbo.MDOperatorStatus_GET";

                using (DbCommand cmd = Database.GetStoredProcCommand(SP))
                {
                    AddOptionParameter(cmd, option);
                    AddPageSizeParameter(cmd, pageSize);
                    AddCurrentPageParameter(cmd, currentPage);
                    AddSortExpressionParameter(cmd, sortExpression);
                    AddFilterExpressionParameter(cmd, filterExpression);

                    using (IDataReader reader = Database.ExecuteReader(cmd))
                    {
                        IList <MDOperatorStatusEntity> list = CreateEntityBuilder <MDOperatorStatusEntity>().BuildEntities(reader);

                        if (list != null && list.Count > 0)
                        {
                            if ((reader.NextResult()) && (reader.Read()))
                            {
                                list[0].TotalRowCount = reader.GetInt32(0);
                            }
                        }

                        return(list);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 Int64 IMDApprovalProcessPriorityFacade.Update(MDApprovalProcessPriorityEntity mDApprovalProcessPriorityEntity, String filterExpression, DatabaseOperationType option, TransactionRequired reqTran)
 {
     return(DataAccessFactory.CreateMDApprovalProcessPriorityDataAccess().Update(mDApprovalProcessPriorityEntity, filterExpression, option, reqTran));
 }
Example #20
0
 Int64 IMDAssetOwnerTypeFacade.Update(MDAssetOwnerTypeEntity mDAssetOwnerTypeEntity, String filterExpression, DatabaseOperationType option, TransactionRequired reqTran)
 {
     return(DataAccessFactory.CreateMDAssetOwnerTypeDataAccess().Update(mDAssetOwnerTypeEntity, filterExpression, option, reqTran));
 }
 IList <Int64> IMDApprovalProcessPriorityFacade.Add(IList <MDApprovalProcessPriorityEntity> mDApprovalProcessPriorityEntityList, DatabaseOperationType option, TransactionRequired reqTran)
 {
     return(DataAccessFactory.CreateMDApprovalProcessPriorityDataAccess().Add(mDApprovalProcessPriorityEntityList, option, reqTran));
 }
Example #22
0
 IList <Int64> IMDAssetOwnerTypeFacade.Delete(IList <MDAssetOwnerTypeEntity> mDAssetOwnerTypeEntityList, String filterExpression, DatabaseOperationType option, TransactionRequired reqTran)
 {
     return(DataAccessFactory.CreateMDAssetOwnerTypeDataAccess().Delete(mDAssetOwnerTypeEntityList, filterExpression, option, reqTran));
 }
 IList <Int64> IMDApprovalProcessPriorityFacade.Delete(IList <MDApprovalProcessPriorityEntity> mDApprovalProcessPriorityEntityList, String filterExpression, DatabaseOperationType option, TransactionRequired reqTran)
 {
     return(DataAccessFactory.CreateMDApprovalProcessPriorityDataAccess().Delete(mDApprovalProcessPriorityEntityList, filterExpression, option, reqTran));
 }
 Int64 IMDAttendanceLeaveAndHolidayCategoryFacade.Update(MDAttendanceLeaveAndHolidayCategoryEntity mDAttendanceLeaveAndHolidayCategoryEntity, String filterExpression, DatabaseOperationType option, TransactionRequired reqTran)
 {
     return(DataAccessFactory.CreateMDAttendanceLeaveAndHolidayCategoryDataAccess().Update(mDAttendanceLeaveAndHolidayCategoryEntity, filterExpression, option, reqTran));
 }
 DataTable IMDApprovalProcessPriorityFacade.GetDT(Int32?currentPage, Int32?pageSize, String sortExpression, String filterExpression, DatabaseOperationType option)
 {
     return(DataAccessFactory.CreateMDApprovalProcessPriorityDataAccess().GetDT(currentPage, pageSize, sortExpression, filterExpression, option));
 }
 IList <Int64> IMDAttendanceLeaveAndHolidayCategoryFacade.Delete(IList <MDAttendanceLeaveAndHolidayCategoryEntity> mDAttendanceLeaveAndHolidayCategoryEntityList, String filterExpression, DatabaseOperationType option, TransactionRequired reqTran)
 {
     return(DataAccessFactory.CreateMDAttendanceLeaveAndHolidayCategoryDataAccess().Delete(mDAttendanceLeaveAndHolidayCategoryEntityList, filterExpression, option, reqTran));
 }
        private Int64 Delete(MDOperatorStatusEntity mDOperatorStatusEntity, String filterExpression, DatabaseOperationType option)
        {
            long         returnCode = -99;
            const string SP         = "dbo.MDOperatorStatus_SET";

            using (DbCommand cmd = Database.GetStoredProcCommand(SP))
            {
                AddOptionParameter(cmd, option);
                AddOutputParameter(cmd);
                AddFilterExpressionParameter(cmd, filterExpression);


                using (IDataReader reader = Database.ExecuteReader(cmd))
                {
                    returnCode = GetReturnCodeFromParameter(cmd);

                    switch (returnCode)
                    {
                    case SqlConstants.DB_STATUS_CODE_DATAALREADYEXIST:
                    {
                        throw new ArgumentException("MDOperatorStatusEntity already exists. Please specify another MDOperatorStatusEntity.");
                    }

                    case SqlConstants.DB_STATUS_CODE_DATAUPDATEDFROMOTHERSESSION:
                    {
                        throw new ArgumentException("MDOperatorStatusEntity data already updated from different session.");
                    }

                    case SqlConstants.DB_STATUS_CODE_FAIL_OPERATION:
                    {
                        throw new ArgumentException("MDOperatorStatusEntity already exists. Please specify another MDOperatorStatusEntity.");
                    }
                    }
                }
            }

            return(returnCode);
        }
Example #28
0
        IList <Int64> IMDItemThumbRuleDataAccess.Add(IList <MDItemThumbRuleEntity> mDItemThumbRuleEntityList, DatabaseOperationType option, TransactionRequired reqTran)
        {
            IList <Int64> returnCodeList = new List <Int64>();

            long returnCode = -99;

            foreach (MDItemThumbRuleEntity mDItemThumbRuleEntity in mDItemThumbRuleEntityList)
            {
                returnCode = (this as IMDItemThumbRuleDataAccess).Add(mDItemThumbRuleEntity, option, reqTran);

                returnCodeList.Add(returnCode);
            }

            return(returnCodeList);
        }
        private Int64 DeleteTran(MDOperatorStatusEntity mDOperatorStatusEntity, String filterExpression, DatabaseOperationType option)
        {
            long         returnCode = -99;
            const string SP         = "dbo.MDOperatorStatus_SET";

            Database db = DatabaseFactory.CreateDatabase();


            using (DbCommand cmd = db.GetStoredProcCommand(SP))
            {
                AddOptionParameter(cmd, option);
                AddOutputParameter(cmd, db);
                AddFilterExpressionParameter(cmd, filterExpression, db);


                DbConnection connection = db.CreateConnection();
                connection.Open();
                DbTransaction transaction = connection.BeginTransaction();

                try
                {
                    using (IDataReader reader = db.ExecuteReader(cmd, transaction))
                    {
                        returnCode = GetReturnCodeFromParameter(cmd);
                    }

                    if (returnCode >= 0)
                    {
                        transaction.Commit();
                    }
                    else
                    {
                        throw new ArgumentException("Error Code." + returnCode.ToString());
                    }
                }
                catch (Exception ex)
                {
                    transaction.Rollback();
                    throw ex;
                }
                finally
                {
                    transaction.Dispose();
                    connection.Close();
                    connection = null;
                }
            }

            return(returnCode);
        }
 public DatabaseOperation(object o, DatabaseOperationType type)
 {
     Object = o;
     Type = type;
 }
Example #31
0
        IList <Int64> ICMConstructionToolDataAccess.Delete(IList <CMConstructionToolEntity> cMConstructionToolEntityList, String filterExpression, DatabaseOperationType option, TransactionRequired reqTran)
        {
            IList <Int64> returnCodeList = new List <Int64>();

            long returnCode = -99;

            foreach (CMConstructionToolEntity cMConstructionToolEntity in cMConstructionToolEntityList)
            {
                returnCode = (this as ICMConstructionToolDataAccess).Delete(cMConstructionToolEntity, filterExpression, option, reqTran);

                returnCodeList.Add(returnCode);
            }

            return(returnCodeList);
        }