예제 #1
0
        public int UpdateJobLatLong(List <JOBDC> objMANAGE_JOBs, bool OnlyUpdateLatLong = false)
        {
            int          updatedCount    = 0;
            DBConnection objConnection   = new DBConnection();
            JOBDA        objMANAGE_JOBDA = new JOBDA();

            try
            {
                objConnection.Open(true);
                foreach (JOBDC obj in objMANAGE_JOBs)
                {
                    updatedCount = objMANAGE_JOBDA.Update(objConnection, obj, OnlyUpdateLatLong);
                }
                objConnection.Commit();
            }
            catch (Exception exp)
            {
                objConnection.Rollback();
                throw exp;
            }
            finally
            {
                objConnection.Close();
            }

            return(updatedCount);
        }
예제 #2
0
        public int Update(List <JOBDC> objMANAGE_JOBs, ref List <EXCEPTIONDC> lstExceptions, bool OnlyUpdateLatLong = false)
        {
            int          updatedCount    = 0;
            DBConnection objConnection   = new DBConnection();
            JOBDA        objMANAGE_JOBDA = new JOBDA();

            try
            {
                foreach (JOBDC obj in objMANAGE_JOBs)
                {
                    objConnection.Open(true);
                    try
                    {
                        updatedCount = objMANAGE_JOBDA.Update(objConnection, obj, OnlyUpdateLatLong);
                        if (obj.IsDirty)
                        {
                            break;
                        }
                        objConnection.Commit();
                    }
                    catch (Exception exp)
                    {
                        EXCEPTIONDC objExcption = new EXCEPTIONDC();
                        objExcption.FIELD_ID          = obj.JOB_ID;
                        objExcption.EXCEPTION_MESSAGE = exp.Message;
                        objExcption.STACK_TRACK       = exp.StackTrace;
                        lstExceptions.Add(objExcption);
                        objConnection.Rollback();
                    }
                }
                if (lstExceptions.Count > 0)
                {
                    throw new Exception(lstExceptions[0].EXCEPTION_MESSAGE);
                }
            }
            catch (Exception exp)
            {
                throw exp;
            }
            finally
            {
                objConnection.Close();
            }

            return(updatedCount);
        }
예제 #3
0
        public List <JOBDC> LoadByFilters(string projectIDs, string doITTNTPStatusIDs, string jobCategoryIDs, string jobStatusIDs, string clientIDs = "All")
        {
            DBConnection objConnection   = new DBConnection();
            JOBDA        objMANAGE_JOBDA = new JOBDA();
            List <JOBDC> objMANAGE_JOBDC = null;

            try
            {
                objConnection.Open(false);
                objMANAGE_JOBDC = objMANAGE_JOBDA.LoadByFilters(objConnection, projectIDs, doITTNTPStatusIDs, jobCategoryIDs, jobStatusIDs, clientIDs);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                objConnection.Close();
            }
            return(objMANAGE_JOBDC);
        }
예제 #4
0
        public JOBDC LoadByKey(int PROJECT_ID, int JOB_FILE_NUMBER)
        {
            DBConnection objConnection   = new DBConnection();
            JOBDA        objMANAGE_JOBDA = new JOBDA();
            JOBDC        objMANAGE_JOBDC = null;

            try
            {
                objConnection.Open(false);
                objMANAGE_JOBDC = objMANAGE_JOBDA.LoadByKey(objConnection, PROJECT_ID, JOB_FILE_NUMBER);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                objConnection.Close();
            }
            return(objMANAGE_JOBDC);
        }
예제 #5
0
        public JOBDC LoadByPrimaryKey(int JOB_ID)
        {
            DBConnection objConnection   = new DBConnection();
            JOBDA        objMANAGE_JOBDA = new JOBDA();
            JOBDC        objMANAGE_JOBDC = null;

            try
            {
                objConnection.Open(false);
                objMANAGE_JOBDC = objMANAGE_JOBDA.LoadByPrimaryKey(objConnection, JOB_ID);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                objConnection.Close();
            }
            return(objMANAGE_JOBDC);
        }
예제 #6
0
        public List <DD_DTO> GetJobFileNumbers(string projectIDs)
        {
            DBConnection  objConnection   = new DBConnection();
            JOBDA         objMANAGE_JOBDA = new JOBDA();
            List <DD_DTO> objDD_DTO       = new List <DD_DTO>();

            try
            {
                objConnection.Open(false);
                objDD_DTO = objMANAGE_JOBDA.GetJobFileNumbers(objConnection, projectIDs);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                objConnection.Close();
            }
            return(objDD_DTO);
        }
예제 #7
0
        public List <JOBDC> LoadAll()
        {
            DBConnection objConnection   = new DBConnection();
            JOBDA        objMANAGE_JOBDA = new JOBDA();
            List <JOBDC> objMANAGE_JOBDC = null;

            try
            {
                objConnection.Open(false);
                objMANAGE_JOBDC = objMANAGE_JOBDA.LoadAll(objConnection);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                objConnection.Close();
            }
            return(objMANAGE_JOBDC);
        }
예제 #8
0
        public List <JOBDC> GetAllJobsWithInvalidLatLongs()
        {
            DBConnection objConnection   = new DBConnection();
            JOBDA        objMANAGE_JOBDA = new JOBDA();
            List <JOBDC> objMANAGE_JOBDC = null;

            try
            {
                objConnection.Open(false);
                objMANAGE_JOBDC = objMANAGE_JOBDA.GetAllJobsWithInvalidLatLongs(objConnection);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                objConnection.Close();
            }
            return(objMANAGE_JOBDC);
        }
예제 #9
0
        public int Delete(List <JOBDC> objMANAGE_JOBs, ref List <EXCEPTIONDC> lstExceptions)
        {
            int          deletedCount    = 0;
            DBConnection objConnection   = new DBConnection();
            JOBDA        objMANAGE_JOBDA = new JOBDA();

            try
            {
                objConnection.Open(true);
                deletedCount = objMANAGE_JOBDA.Delete(objConnection, objMANAGE_JOBs, ref lstExceptions);
            }
            catch (Exception ex)
            {
                objConnection.Rollback();
                throw ex;
            }
            finally
            {
                objConnection.Close();
            }
            return(deletedCount);
        }
예제 #10
0
        public int Insert(List <JOBDC> objMANAGE_JOBs)
        {
            int          insertedCount   = 0;
            DBConnection objConnection   = new DBConnection();
            JOBDA        objMANAGE_JOBDA = new JOBDA();

            try
            {
                objConnection.Open(true);
                insertedCount = objMANAGE_JOBDA.Insert(objConnection, objMANAGE_JOBs);
                objConnection.Commit();
            }
            catch (Exception ex)
            {
                objConnection.Rollback();
                throw ex;
            }
            finally
            {
                objConnection.Close();
            }
            return(insertedCount);
        }