Esempio n. 1
0
        public List <LOOK_UPDC> LoadByType(string lookuptype, DBConnection Connection)
        {
            List <LOOK_UPDC> objLOOK_UP = new List <LOOK_UPDC>();
            StringBuilder    sql        = new StringBuilder();

            sql.Append("proc_LOOK_UPSLoadByType");

            DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection);

            dbCommandWrapper.AddInParameter("p_LU_TYPE", DbType.String, lookuptype);

            DataSet ds = new DataSet();

            if (Connection.Transaction != null)
            {
                ds = Connection.dataBase.ExecuteDataSet(dbCommandWrapper.DBCommand, Connection.Transaction);
            }
            else
            {
                ds = Connection.dataBase.ExecuteDataSet(dbCommandWrapper.DBCommand);
            }

            foreach (DataRow drRow in ds.Tables[0].Rows)
            {
                objLOOK_UP.Add(FillObject(drRow));
            }

            return(objLOOK_UP);
        }
Esempio n. 2
0
        public List <ATTACHMENTDC> LoadByDailyId(DBConnection Connection, int DAILY_ID)
        {
            List <ATTACHMENTDC> objATTACHMENT = new List <ATTACHMENTDC>();
            StringBuilder       sql           = new StringBuilder();

            sql.Append("proc_ATTACHMENTSLoadByDaily");

            DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection);

            dbCommandWrapper.AddInParameter("p_Daily_ID", DbType.Int32, DAILY_ID);


            DataSet ds = new DataSet();

            if (Connection.Transaction != null)
            {
                ds = Connection.dataBase.ExecuteDataSet(dbCommandWrapper.DBCommand, Connection.Transaction);
            }
            else
            {
                ds = Connection.dataBase.ExecuteDataSet(dbCommandWrapper.DBCommand);
            }

            foreach (DataRow drRow in ds.Tables[0].Rows)
            {
                objATTACHMENT.Add(FillDailyAttachmentObject(drRow));
            }
            return(objATTACHMENT);
        }
Esempio n. 3
0
        public ATTACHMENTDC LoadSingleByProjectId(DBConnection Connection, int PROJECT_ID, int ATTACHMENT_ID)
        {
            ATTACHMENTDC  objATTACHMENT = new ATTACHMENTDC();
            StringBuilder sql           = new StringBuilder();

            sql.Append("proc_PROJECT_ATTACHMENTSLoadByPrimaryKey");

            DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection);

            dbCommandWrapper.AddInParameter("p_PROJECT_ID", DbType.Int32, PROJECT_ID);
            dbCommandWrapper.AddInParameter("p_ATTACHMENT_ID", DbType.Int32, ATTACHMENT_ID);

            DataSet ds = new DataSet();

            if (Connection.Transaction != null)
            {
                ds = Connection.dataBase.ExecuteDataSet(dbCommandWrapper.DBCommand, Connection.Transaction);
            }
            else
            {
                ds = Connection.dataBase.ExecuteDataSet(dbCommandWrapper.DBCommand);
            }

            foreach (DataRow drRow in ds.Tables[0].Rows)
            {
                objATTACHMENT = FillProjectAttachmentObject(drRow);
            }
            return(objATTACHMENT);
        }
        //=================================================================
        //      public Function LoadAll() As Boolean
        //=================================================================
        //  Loads all of the records in the database, and sets the currentRow to the first row
        //=================================================================
        public override List <HYLAN_TASKDC> LoadAll(DBConnection Connection, int TASK_TITLE_ID)
        {
            List <HYLAN_TASKDC> objTASK_FIBER_POWER_DIG = new List <HYLAN_TASKDC>();
            StringBuilder       sql = new StringBuilder();

            sql.Append("proc_TASK_FIBER_POWER_DIGLoadAll");

            DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection);

            dbCommandWrapper.AddInParameter("p_TASK_TITLE_ID", DbType.Int32, TASK_TITLE_ID);

            DataSet ds = new DataSet();

            if (Connection.Transaction != null)
            {
                ds = Connection.dataBase.ExecuteDataSet(dbCommandWrapper.DBCommand, Connection.Transaction);
            }
            else
            {
                ds = Connection.dataBase.ExecuteDataSet(dbCommandWrapper.DBCommand);
            }

            objTASK_FIBER_POWER_DIG.AddRange(Utility.ConvertToObjects <TASK_FIBER_POWER_DIGDC>(ds.Tables[0]));
            return(objTASK_FIBER_POWER_DIG);
        }
Esempio n. 5
0
        //=================================================================
        //      public Function LoadAll() As Boolean
        //=================================================================
        //  Loads all of the records in the database, and sets the currentRow to the first row
        //=================================================================
        public List <PayDepartmentDC> LoadAll(DBConnection Connection)
        {
            List <PayDepartmentDC> objPayDesignation = new List <PayDepartmentDC>();
            StringBuilder          sql = new StringBuilder();

            sql.Append("proc_PayDepartmentsLoadAll");

            DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection);


            DataSet ds = new DataSet();

            if (Connection.Transaction != null)
            {
                ds = Connection.dataBase.ExecuteDataSet(dbCommandWrapper.DBCommand, Connection.Transaction);
            }
            else
            {
                ds = Connection.dataBase.ExecuteDataSet(dbCommandWrapper.DBCommand);
            }

            foreach (DataRow drRow in ds.Tables[0].Rows)
            {
                objPayDesignation.Add(FillObject(drRow));
            }

            return(objPayDesignation);
        }
Esempio n. 6
0
        public DAILYDC LoadByPrimaryKey(DBConnection Connection, int DAILY_ID)
        {
            DAILYDC       objDAIL = new DAILYDC();
            StringBuilder sql     = new StringBuilder();

            sql.Append("proc_DAILYLoadByPrimaryKey");

            DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection);

            dbCommandWrapper.AddInParameter("p_DAILY_ID", DbType.Int32, DAILY_ID);


            DataSet ds = new DataSet();

            if (Connection.Transaction != null)
            {
                ds = Connection.dataBase.ExecuteDataSet(dbCommandWrapper.DBCommand, Connection.Transaction);
            }
            else
            {
                ds = Connection.dataBase.ExecuteDataSet(dbCommandWrapper.DBCommand);
            }

            objDAIL = (Utility.ConvertToObject <DAILYDC>(ds.Tables[0]));
            return(objDAIL);
        }
Esempio n. 7
0
        public int GenerateSnapshot(int EVENT_ID, int CREATED_BY, DateTime dtDateTime, String snapshotType, DBConnection Connection)
        {
            int insertCount = 0;

            StringBuilder sql = new StringBuilder();

            sql.Append("proc_SS_SYSTEM_SNAPSHOTInsert");

            DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection);

            dbCommandWrapper.AddInParameter("p_EVENT_ID", DbType.Int32, EVENT_ID);
            dbCommandWrapper.AddInParameter("P_ST_SNAPSHOT_TYPE", DbType.String, snapshotType);
            dbCommandWrapper.AddInParameter("CURRENT_DATETIME", DbType.DateTime, dtDateTime);
            try
            {
                if (Connection.Transaction != null)
                {
                    insertCount = Connection.dataBase.ExecuteNonQuery(dbCommandWrapper.DBCommand, Connection.Transaction);
                }
                else
                {
                    insertCount = Connection.dataBase.ExecuteNonQuery(dbCommandWrapper.DBCommand);
                }
            }
            catch (Exception exp)
            {
                //Utilities.InsertIntoErrorLog("Error: GENERATE SNAPSHORT(" + snapshotType + ")", exp.Message + "\r\n" + exp.StackTrace, CREATED_BY);
                throw exp;
            }
            return(insertCount);
        }
        private int Insert(DBConnection Connection, MESSAGES_COMPANIEDC objMESSAGES_COMPANIE)
        {
            int insertCount = 0;

            StringBuilder sql = new StringBuilder();

            sql.Append("proc_MESSAGES_COMPANIESInsert");

            DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection);


            dbCommandWrapper.AddInParameter("p_MESSAGE_COMPANY_ID", DbType.Int32, objMESSAGES_COMPANIE.MESSAGE_COMPANY_ID);
            dbCommandWrapper.AddInParameter("p_MESSAGE_ID", DbType.Int32, objMESSAGES_COMPANIE.MESSAGE_ID);
            dbCommandWrapper.AddInParameter("p_COMPANY_ID", DbType.Int32, objMESSAGES_COMPANIE.COMPANY_ID);

            if (Connection.Transaction != null)
            {
                insertCount = Connection.dataBase.ExecuteNonQuery(dbCommandWrapper.DBCommand, Connection.Transaction);
            }
            else
            {
                insertCount = Connection.dataBase.ExecuteNonQuery(dbCommandWrapper.DBCommand);
            }

            return(insertCount);
        }
Esempio n. 9
0
        public List <LABORDC> GetLaborFromManPower(DBConnection Connection, int DAILY_ID, int DAILY_TYPE)
        {
            List <LABORDC> objLABOR_VALU = new List <LABORDC>();
            StringBuilder  sql           = new StringBuilder();

            sql.Append("proc_getLaborHoursFromManpower");

            DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection);

            dbCommandWrapper.AddInParameter("p_DAILY_ID", DbType.Int32, DAILY_ID);
            dbCommandWrapper.AddInParameter("p_DAILY_TYPE", DbType.Int32, DAILY_TYPE);


            DataSet ds = new DataSet();

            if (Connection.Transaction != null)
            {
                ds = Connection.dataBase.ExecuteDataSet(dbCommandWrapper.DBCommand, Connection.Transaction);
            }
            else
            {
                ds = Connection.dataBase.ExecuteDataSet(dbCommandWrapper.DBCommand);
            }

            objLABOR_VALU = (Utility.ConvertToObjects <LABORDC>(ds.Tables[0]));


            return(objLABOR_VALU);
        }
Esempio n. 10
0
        private int Insert(DBConnection Connection, USERS_RMAGDC objUSERS_RMAG)
        {
            int insertCount = 0;

            StringBuilder sql = new StringBuilder();

            sql.Append("proc_USERS_RMAGSInsert");

            DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection);


            dbCommandWrapper.AddInParameter("p_USER_RMAG_ID", DbType.Int32, objUSERS_RMAG.USER_RMAG_ID);
            dbCommandWrapper.AddInParameter("p_USER_ID", DbType.Int32, objUSERS_RMAG.USER_ID);
            dbCommandWrapper.AddInParameter("p_RMAG_ID", DbType.Int32, objUSERS_RMAG.RMAG_ID);
            dbCommandWrapper.AddInParameter("p_CREATED_ON", DbType.DateTime, objUSERS_RMAG.CREATED_ON);
            dbCommandWrapper.AddInParameter("p_CREATED_BY", DbType.Int32, objUSERS_RMAG.CREATED_BY);
            dbCommandWrapper.AddInParameter("p_MODIFIED_ON", DbType.DateTime, objUSERS_RMAG.MODIFIED_ON);
            dbCommandWrapper.AddInParameter("p_MODIFIED_BY", DbType.Int32, objUSERS_RMAG.MODIFIED_BY);


            if (Connection.Transaction != null)
            {
                insertCount = Connection.dataBase.ExecuteNonQuery(dbCommandWrapper.DBCommand, Connection.Transaction);
            }
            else
            {
                insertCount = Connection.dataBase.ExecuteNonQuery(dbCommandWrapper.DBCommand);
            }

            return(insertCount);
        }
Esempio n. 11
0
        public USERS_RMAGDC LoadByPrimaryKey(DBConnection Connection, int USER_RMAG_ID)
        {
            USERS_RMAGDC  objUSERS_RMAG = new USERS_RMAGDC();
            StringBuilder sql           = new StringBuilder();

            sql.Append("proc_USERS_RMAGSLoadByPrimaryKey");

            DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection);

            dbCommandWrapper.AddInParameter("p_USER_RMAG_ID", DbType.Int32, USER_RMAG_ID);


            IDataReader reader = null;

            if (Connection.Transaction != null)
            {
                reader = Connection.dataBase.ExecuteReader(dbCommandWrapper.DBCommand, Connection.Transaction);
            }
            else
            {
                reader = Connection.dataBase.ExecuteReader(dbCommandWrapper.DBCommand);
            }

            objUSERS_RMAG = FillObject(reader);
            return(objUSERS_RMAG);
        }
Esempio n. 12
0
        private int Update(DBConnection Connection, PERMIT_TYPEDC objPERMITS_LOOK_UP)
        {
            int updateCount = 0;

            StringBuilder sql = new StringBuilder();

            sql.Append("proc_PERMITS_LOOK_UPUpdate");

            DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection);


            dbCommandWrapper.AddInParameter("p_PERMIT_TYPE_ID", DbType.String, objPERMITS_LOOK_UP.PERMIT_TYPE_ID);
            dbCommandWrapper.AddInParameter("p_DESCRIPTION", DbType.String, objPERMITS_LOOK_UP.DESCRIPTION);
            dbCommandWrapper.AddInParameter("p_PERMIT_CATEGORY", DbType.Int32, objPERMITS_LOOK_UP.PERMIT_CATEGORY);
            dbCommandWrapper.AddInParameter("p_FEE", DbType.String, objPERMITS_LOOK_UP.FEE);
            dbCommandWrapper.AddInParameter("p_DURATION", DbType.String, objPERMITS_LOOK_UP.DURATION);


            if (Connection.Transaction != null)
            {
                updateCount = Connection.dataBase.ExecuteNonQuery(dbCommandWrapper.DBCommand, Connection.Transaction);
            }
            else
            {
                updateCount = Connection.dataBase.ExecuteNonQuery(dbCommandWrapper.DBCommand);
            }

            if (updateCount == 0)
            {
                objPERMITS_LOOK_UP.IsDirty = IsDirty = true;
            }

            return(updateCount);
        }
Esempio n. 13
0
        public PERMIT_TYPEDC LoadByPrimaryKey(DBConnection Connection, string PERMIT_TYPE_ID)
        {
            PERMIT_TYPEDC obj = new PERMIT_TYPEDC();
            StringBuilder sql = new StringBuilder();

            sql.Append("proc_PERMIT_TYPESLoadByPrimaryKey");

            DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection);

            dbCommandWrapper.AddInParameter("@p_PERMIT_TYPE_ID", DbType.String, PERMIT_TYPE_ID);


            DataSet ds = new DataSet();

            if (Connection.Transaction != null)
            {
                ds = Connection.dataBase.ExecuteDataSet(dbCommandWrapper.DBCommand, Connection.Transaction);
            }
            else
            {
                ds = Connection.dataBase.ExecuteDataSet(dbCommandWrapper.DBCommand);
            }

            obj = (Utility.ConvertToObject <PERMIT_TYPEDC>(ds.Tables[0]));

            return(obj);
        }
Esempio n. 14
0
        //=================================================================
        //      public Function LoadAll() As Boolean
        //=================================================================
        //  Loads all of the records in the database, and sets the currentRow to the first row
        //=================================================================
        public List <PERMIT_TYPEDC> LoadAll(DBConnection Connection, bool getDescWithCode = false)
        {
            List <PERMIT_TYPEDC> list = new List <PERMIT_TYPEDC>();
            StringBuilder        sql  = new StringBuilder();

            sql.Append("proc_PERMIT_TYPESLoadAll");

            DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection);

            dbCommandWrapper.AddInParameter("@p_getDescWithCode", DbType.Boolean, getDescWithCode);

            DataSet ds = new DataSet();

            if (Connection.Transaction != null)
            {
                ds = Connection.dataBase.ExecuteDataSet(dbCommandWrapper.DBCommand, Connection.Transaction);
            }
            else
            {
                ds = Connection.dataBase.ExecuteDataSet(dbCommandWrapper.DBCommand);
            }

            list.AddRange(Utility.ConvertToObjects <PERMIT_TYPEDC>(ds.Tables[0]));

            return(list);
        }
Esempio n. 15
0
        public List <MAN_POWERDC> LoadByDailyID(DBConnection Connection, int DAILY_ID)
        {
            List <MAN_POWERDC> objMAN_POWE = new List <MAN_POWERDC>();
            StringBuilder      sql         = new StringBuilder();

            sql.Append("proc_MAN_POWERLoadByDailyID");

            DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection);

            dbCommandWrapper.AddInParameter("p_DAILY_ID", DbType.Int32, DAILY_ID);


            DataSet ds = new DataSet();

            if (Connection.Transaction != null)
            {
                ds = Connection.dataBase.ExecuteDataSet(dbCommandWrapper.DBCommand, Connection.Transaction);
            }
            else
            {
                ds = Connection.dataBase.ExecuteDataSet(dbCommandWrapper.DBCommand);
            }

            objMAN_POWE = (Utility.ConvertToObjects <MAN_POWERDC>(ds.Tables[0]));
            return(objMAN_POWE);
        }
Esempio n. 16
0
        public int Insert(DBConnection Connection, LABORDC objLABOR_VALU)
        {
            int insertCount = 0;

            StringBuilder sql = new StringBuilder();

            sql.Append("proc_LABOR_VALUEInsert");

            DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection);


            dbCommandWrapper.AddOutParameter("p_LABOR_VALUE_ID", DbType.Int32, objLABOR_VALU.LABOR_VALUE_ID);
            dbCommandWrapper.AddInParameter("p_LABOR_ID", DbType.Int32, objLABOR_VALU.LABOR_ID);
            dbCommandWrapper.AddInParameter("p_DAILY_ID", DbType.Int32, objLABOR_VALU.DAILY_ID);
            dbCommandWrapper.AddInParameter("p_HOURS", DbType.Decimal, objLABOR_VALU.HOURS);
            dbCommandWrapper.AddInParameter("p_CREATED_ON", DbType.DateTime, objLABOR_VALU.CREATED_ON);
            dbCommandWrapper.AddInParameter("p_CREATED_BY", DbType.Int32, objLABOR_VALU.CREATED_BY);
            dbCommandWrapper.AddInParameter("p_MODIFIED_ON", DbType.DateTime, objLABOR_VALU.MODIFIED_ON);
            dbCommandWrapper.AddInParameter("p_MODIFIED_BY", DbType.Int32, objLABOR_VALU.MODIFIED_BY);
            dbCommandWrapper.AddInParameter("p_LOCK_COUNTER", DbType.Int32, objLABOR_VALU.LOCK_COUNTER);


            if (Connection.Transaction != null)
            {
                insertCount = Connection.dataBase.ExecuteNonQuery(dbCommandWrapper.DBCommand, Connection.Transaction);
            }
            else
            {
                insertCount = Connection.dataBase.ExecuteNonQuery(dbCommandWrapper.DBCommand);
            }

            return(insertCount);
        }
Esempio n. 17
0
        public TaskDC LoadByPrimaryKey(DBConnection Connection, string TaskID)
        {
            TaskDC        objTask = new TaskDC();
            StringBuilder sql     = new StringBuilder();

            sql.Append("proc_TasksLoadByPrimaryKey");

            DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection);

            dbCommandWrapper.AddInParameter("p_TaskID", DbType.String, TaskID);


            IDataReader reader = null;

            if (Connection.Transaction != null)
            {
                reader = Connection.dataBase.ExecuteReader(dbCommandWrapper.DBCommand, Connection.Transaction);
            }
            else
            {
                reader = Connection.dataBase.ExecuteReader(dbCommandWrapper.DBCommand);
            }

            objTask = FillObject(reader);
            return(objTask);
        }
Esempio n. 18
0
        public LABORDC LoadByPrimaryKey(DBConnection Connection, int LABOR_VALUE_ID)
        {
            LABORDC       objLABOR_VALU = new LABORDC();
            StringBuilder sql           = new StringBuilder();

            sql.Append("proc_LABOR_VALUELoadByPrimaryKey");

            DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection);

            dbCommandWrapper.AddInParameter("p_LABOR_VALUE_ID", DbType.Int32, LABOR_VALUE_ID);


            IDataReader reader = null;

            if (Connection.Transaction != null)
            {
                reader = Connection.dataBase.ExecuteReader(dbCommandWrapper.DBCommand, Connection.Transaction);
            }
            else
            {
                reader = Connection.dataBase.ExecuteReader(dbCommandWrapper.DBCommand);
            }

            objLABOR_VALU = FillObject(reader);
            return(objLABOR_VALU);
        }
Esempio n. 19
0
        public COMPANIEDC LoadByPrimaryKey(DBConnection Connection, int COMPANY_ID)
        {
            COMPANIEDC    objCOMPANIE = new COMPANIEDC();
            StringBuilder sql         = new StringBuilder();

            sql.Append("proc_COMPANIESLoadByPrimaryKey");

            DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection);

            dbCommandWrapper.AddInParameter("p_COMPANY_ID", DbType.Int32, COMPANY_ID);


            IDataReader reader = null;

            if (Connection.Transaction != null)
            {
                reader = Connection.dataBase.ExecuteReader(dbCommandWrapper.DBCommand, Connection.Transaction);
            }
            else
            {
                reader = Connection.dataBase.ExecuteReader(dbCommandWrapper.DBCommand);
            }

            //objCOMPANIE = FillObject(reader);
            return(objCOMPANIE);
        }
Esempio n. 20
0
        private int Insert(DBConnection Connection, SCREENDC objSCREEN)
        {
            int insertCount = 0;

            StringBuilder sql = new StringBuilder();

            sql.Append("proc_SCREENSInsert");

            DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection);


            dbCommandWrapper.AddInParameter("p_SCREEN_ID", DbType.Int32, objSCREEN.SCREEN_ID);
            dbCommandWrapper.AddInParameter("p_SCREEN_NAME", DbType.String, objSCREEN.SCREEN_NAME);
            dbCommandWrapper.AddInParameter("p_IS_EVENT_BASED", DbType.Boolean, objSCREEN.IS_EVENT_BASED);
            dbCommandWrapper.AddInParameter("p_CREATED_BY", DbType.Int32, objSCREEN.CREATED_BY);


            if (Connection.Transaction != null)
            {
                insertCount = Connection.dataBase.ExecuteNonQuery(dbCommandWrapper.DBCommand, Connection.Transaction);
            }
            else
            {
                insertCount = Connection.dataBase.ExecuteNonQuery(dbCommandWrapper.DBCommand);
            }

            return(insertCount);
        }
Esempio n. 21
0
        public List <REPORTDC> GenerateResourceReport(int EVENT_ID, int RMAG_ID, int COMPANY_ID,
                                                      String snapshotDateTime, int snapshotType, DBConnection Connection)
        {
            List <REPORTDC> allocList = new List <REPORTDC>();
            StringBuilder   sql       = new StringBuilder();

            sql.Append("proc_GenerateResourceAllocationReport");

            DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection);

            dbCommandWrapper.AddInParameter("P_EVENT_ID", DbType.Int32, EVENT_ID);
            dbCommandWrapper.AddInParameter("p_RMAG_ID", DbType.Int32, RMAG_ID);
            dbCommandWrapper.AddInParameter("p_COMPANY_ID", DbType.Int32, COMPANY_ID);
            dbCommandWrapper.AddInParameter("P_SNAPSHOT_DATETIME", DbType.String, snapshotDateTime);
            dbCommandWrapper.AddInParameter("p_SS_MATCHING_TYPE", DbType.Int32, snapshotType);
            DataSet ds = new DataSet();

            if (Connection.Transaction != null)
            {
                ds = Connection.dataBase.ExecuteDataSet(dbCommandWrapper.DBCommand, Connection.Transaction);
            }
            else
            {
                ds = Connection.dataBase.ExecuteDataSet(dbCommandWrapper.DBCommand);
            }

            if (ds.Tables.Count > 0)
            {
                foreach (DataRow drRow in ds.Tables[0].Rows)
                {
                    allocList.Add(FillAllocationReportObject(drRow));
                }
            }
            return(allocList);
        }
Esempio n. 22
0
        private int Update(DBConnection Connection, SCREENDC objSCREEN)
        {
            int updateCount = 0;

            StringBuilder sql = new StringBuilder();

            sql.Append("proc_SCREENSUpdate");

            DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection);


            dbCommandWrapper.AddInParameter("p_SCREEN_ID", DbType.Int32, objSCREEN.SCREEN_ID);
            dbCommandWrapper.AddInParameter("p_SCREEN_NAME", DbType.String, objSCREEN.SCREEN_NAME);
            dbCommandWrapper.AddInParameter("p_IS_EVENT_BASED", DbType.Boolean, objSCREEN.IS_EVENT_BASED);
            dbCommandWrapper.AddInParameter("p_MODIFIED_BY", DbType.Int32, objSCREEN.MODIFIED_BY);


            if (Connection.Transaction != null)
            {
                updateCount = Connection.dataBase.ExecuteNonQuery(dbCommandWrapper.DBCommand, Connection.Transaction);
            }
            else
            {
                updateCount = Connection.dataBase.ExecuteNonQuery(dbCommandWrapper.DBCommand);
            }

            if (updateCount == 0)
            {
                objSCREEN.IsDirty = IsDirty = true;
            }

            return(updateCount);
        }
        public override HYLAN_TASKDC LoadByPrimaryKey(DBConnection Connection, int TASK_TITLE_ID, int JOB_ID)
        {
            TASK_FIBER_POWER_DIGDC objTASK_FIBER_POWER_DIG = new TASK_FIBER_POWER_DIGDC();
            StringBuilder          sql = new StringBuilder();

            sql.Append("proc_TASK_FIBER_POWER_DIGLoadByPrimaryKey");

            DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection);

            dbCommandWrapper.AddInParameter("p_JOB_ID", DbType.Int32, JOB_ID);
            dbCommandWrapper.AddInParameter("p_TASK_TITLE_ID", DbType.Int32, TASK_TITLE_ID);
            DataSet ds = new DataSet();

            if (Connection.Transaction != null)
            {
                ds = Connection.dataBase.ExecuteDataSet(dbCommandWrapper.DBCommand, Connection.Transaction);
            }
            else
            {
                ds = Connection.dataBase.ExecuteDataSet(dbCommandWrapper.DBCommand);
            }

            objTASK_FIBER_POWER_DIG = (Utility.ConvertToObject <TASK_FIBER_POWER_DIGDC>(ds.Tables[0]));
            if (ds.Tables.Count > 1)
            {
                HYLAN_TASKDC hylanTaskDC = (Utility.ConvertToObject <HYLAN_TASKDC>(ds.Tables[1]));
                objTASK_FIBER_POWER_DIG.TASK_TITLE_ID = hylanTaskDC.TASK_TITLE_ID;
                objTASK_FIBER_POWER_DIG.TASK_NAME     = hylanTaskDC.TASK_NAME;
            }
            return(objTASK_FIBER_POWER_DIG);
        }
Esempio n. 24
0
        //=================================================================
        //      public Function LoadAll() As Boolean
        //=================================================================
        //  Loads all of the records in the database, and sets the currentRow to the first row
        //=================================================================
        public List <PERMITDC> LoadAll(DBConnection Connection, string projectIDs = "All")
        {
            List <PERMITDC> objPERMIT = new List <PERMITDC>();
            StringBuilder   sql       = new StringBuilder();

            sql.Append("proc_PERMITSLoadAll");

            DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection);

            dbCommandWrapper.AddInParameter("p_projectIDs", DbType.String, projectIDs);


            DataSet ds = new DataSet();

            if (Connection.Transaction != null)
            {
                ds = Connection.dataBase.ExecuteDataSet(dbCommandWrapper.DBCommand, Connection.Transaction);
            }
            else
            {
                ds = Connection.dataBase.ExecuteDataSet(dbCommandWrapper.DBCommand);
            }

            objPERMIT.AddRange(Utility.ConvertToObjects <PERMITDC>(ds.Tables[0]));
            //foreach (DataRow drRow in ds.Tables[0].Rows)
            //{
            //    objPERMIT.Add(FillObject(drRow));
            //}

            return(objPERMIT);
        }
Esempio n. 25
0
        public PayDepartmentDC LoadByPrimaryKey(DBConnection Connection, string Code)
        {
            PayDepartmentDC objPayDesignation = new PayDepartmentDC();
            StringBuilder   sql = new StringBuilder();

            sql.Append("proc_PayDesignationsLoadByPrimaryKey");

            DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection);

            dbCommandWrapper.AddInParameter("p_Code", DbType.String, Code);


            IDataReader reader = null;

            if (Connection.Transaction != null)
            {
                reader = Connection.dataBase.ExecuteReader(dbCommandWrapper.DBCommand, Connection.Transaction);
            }
            else
            {
                reader = Connection.dataBase.ExecuteReader(dbCommandWrapper.DBCommand);
            }

            objPayDesignation = FillObject(reader);
            return(objPayDesignation);
        }
Esempio n. 26
0
        public int Delete(DBConnection Connection, PERMITDC objPERMIT)
        {
            int deleteCount = 0;

            try
            {
                StringBuilder sql = new StringBuilder();
                sql.Append("proc_PERMITSDelete");

                DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection);

                dbCommandWrapper.AddInParameter("p_PERMIT_ID", DbType.Int32, objPERMIT.PERMIT_ID);

                if (Connection.Transaction != null)
                {
                    deleteCount = Connection.dataBase.ExecuteNonQuery(dbCommandWrapper.DBCommand, Connection.Transaction);
                }
                else
                {
                    deleteCount = Connection.dataBase.ExecuteNonQuery(dbCommandWrapper.DBCommand);
                }
            }
            catch (Exception exp)
            {
                //Utilities.InsertIntoErrorLog("Error: PERMIT DELETE ", exp.Message + "\r\n" + exp.StackTrace, Convert.ToInt32(objPERMIT.MODIFIED_BY));
                objPERMIT.SetError(exp);
                throw exp;
            }
            return(deleteCount);
        }
Esempio n. 27
0
        public List <DOCUMENTCATEGORYDC> LoaddocumentCategories(DBConnection Connection, int CATEGORY_ID)
        {
            List <DOCUMENTCATEGORYDC> objDOCUMENTCATEGORY = new List <DOCUMENTCATEGORYDC>();
            StringBuilder             sql = new StringBuilder();

            sql.Append("proc_DOCUMENTCATEGORIESByType");

            DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection);

            dbCommandWrapper.AddInParameter("p_CATEGORY_TYPE_ID", DbType.Int32, CATEGORY_ID);


            DataSet ds = new DataSet();

            if (Connection.Transaction != null)
            {
                ds = Connection.dataBase.ExecuteDataSet(dbCommandWrapper.DBCommand, Connection.Transaction);
            }
            else
            {
                ds = Connection.dataBase.ExecuteDataSet(dbCommandWrapper.DBCommand);
            }

            foreach (DataRow drRow in ds.Tables[0].Rows)
            {
                objDOCUMENTCATEGORY.Add(FillDocumentCategoryObject(drRow));
            }

            return(objDOCUMENTCATEGORY);
        }
Esempio n. 28
0
        public List <String> LoadNames(DBConnection Connection, string Column_Name, string Column_Value)
        {
            List <String> names = new List <string>();
            StringBuilder sql   = new StringBuilder();

            sql.Append("proc_MAN_POWER_AJAX");

            DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection);

            dbCommandWrapper.AddInParameter("p_NAME", DbType.String, Column_Value);

            DataSet ds = new DataSet();

            if (Connection.Transaction != null)
            {
                ds = Connection.dataBase.ExecuteDataSet(dbCommandWrapper.DBCommand, Connection.Transaction);
            }
            else
            {
                ds = Connection.dataBase.ExecuteDataSet(dbCommandWrapper.DBCommand);
            }

            if (ds.Tables.Count > 0)
            {
                names = ds.Tables[0].AsEnumerable().Select(r => r.Field <string>(Column_Name)).ToList();
            }
            return(names);
        }
Esempio n. 29
0
        public List <ATTACHMENTDC> LoadAllJobAttachments(DBConnection Connection, string projectIDs = "All", string attachmentTypeIDs = "All")
        {
            List <ATTACHMENTDC> objATTACHMENT = new List <ATTACHMENTDC>();
            StringBuilder       sql           = new StringBuilder();

            sql.Append("proc_JOB_ATTACHMENTSLoadAll");

            DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection);

            dbCommandWrapper.AddInParameter("p_projectIDs", DbType.String, projectIDs);
            dbCommandWrapper.AddInParameter("p_attachmentTypeIDs", DbType.String, attachmentTypeIDs);


            DataSet ds = new DataSet();

            if (Connection.Transaction != null)
            {
                ds = Connection.dataBase.ExecuteDataSet(dbCommandWrapper.DBCommand, Connection.Transaction);
            }
            else
            {
                ds = Connection.dataBase.ExecuteDataSet(dbCommandWrapper.DBCommand);
            }

            foreach (DataRow drRow in ds.Tables[0].Rows)
            {
                objATTACHMENT.Add(FillJobAttachmentObject(drRow));
            }

            return(objATTACHMENT);
        }
Esempio n. 30
0
        public string CompanyNameString(DBConnection Connection, string companyids)
        {
            string        companyNames = string.Empty;
            StringBuilder sql          = new StringBuilder();

            sql.Append("proc_LoadCompanyNameByCompanyIDString");

            DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection);

            dbCommandWrapper.AddInParameter("p_company_id", DbType.String, companyids);

            DataSet ds = new DataSet();

            if (Connection.Transaction != null)
            {
                ds = Connection.dataBase.ExecuteDataSet(dbCommandWrapper.DBCommand, Connection.Transaction);
            }
            else
            {
                ds = Connection.dataBase.ExecuteDataSet(dbCommandWrapper.DBCommand);
            }

            if (ds.Tables[0].Rows.Count > 0)
            {
                companyNames = ds.Tables[0].Rows[0][0].ToString();
            }
            return(companyNames);
        }