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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }