Ejemplo n.º 1
0
 public abstract int Delete(DBConnection Connection, List <HYLAN_TASKDC> hylanTaskDCList);
Ejemplo n.º 2
0
 public abstract int Insert(DBConnection Connection, List <HYLAN_TASKDC> hylanTaskDCList);
Ejemplo n.º 3
0
 public abstract HYLAN_TASKDC LoadByPrimaryKey(DBConnection Connection, int TASK_TITLE_ID, int TASK_ID);
Ejemplo n.º 4
0
 public abstract List <HYLAN_TASKDC> LoadAll(DBConnection Connection, int TASK_TITLE_ID);
Ejemplo n.º 5
0
        //public int Insert(DBConnection Connection, List<PERMITDC> objPERMITs)
        //{
        //    int insertCount = 0;
        //    foreach (PERMITDC objPERMIT in objPERMITs)
        //    {
        //        insertCount = Insert(Connection, objPERMIT);
        //    }
        //    return insertCount;
        //}
        public int Insert(DBConnection Connection, PERMITDC objPERMIT)
        {
            int insertCount = 0;

            StringBuilder sql = new StringBuilder();

            sql.Append("proc_PERMITSInsert");

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


            dbCommandWrapper.AddInParameter("p_PERMIT_ID", DbType.Int32, objPERMIT.PERMIT_ID);
            dbCommandWrapper.AddInParameter("p_PROJECT_ID", DbType.Int32, objPERMIT.PROJECT_ID);
            dbCommandWrapper.AddInParameter("p_JOB_ID", DbType.Int32, objPERMIT.JOB_ID);
            dbCommandWrapper.AddInParameter("p_CLIENT", DbType.String, objPERMIT.CLIENT);
            dbCommandWrapper.AddInParameter("p_NODE_ID1", DbType.String, objPERMIT.NODE_ID1);
            dbCommandWrapper.AddInParameter("p_NODE_ID2", DbType.String, objPERMIT.NODE_ID2);
            dbCommandWrapper.AddInParameter("p_NODE_ID3", DbType.String, objPERMIT.NODE_ID3);
            dbCommandWrapper.AddInParameter("p_HUB", DbType.String, objPERMIT.HUB);
            dbCommandWrapper.AddInParameter("p_HYLAN_PM", DbType.Int32, objPERMIT.HYLAN_PM);
            dbCommandWrapper.AddInParameter("p_STREET_ADDRESS", DbType.String, objPERMIT.STREET_ADDRESS);
            dbCommandWrapper.AddInParameter("p_CITY", DbType.String, objPERMIT.CITY);
            dbCommandWrapper.AddInParameter("p_STATE", DbType.String, objPERMIT.STATE);
            dbCommandWrapper.AddInParameter("p_ZIP", DbType.String, objPERMIT.ZIP);
            dbCommandWrapper.AddInParameter("p_LAT", DbType.String, objPERMIT.LAT);
            dbCommandWrapper.AddInParameter("p_LONG", DbType.String, objPERMIT.LONG);
            dbCommandWrapper.AddInParameter("p_POLE_LOCATION", DbType.String, objPERMIT.POLE_LOCATION);
            dbCommandWrapper.AddInParameter("p_PERMIT_NUMBER_TEXT", DbType.String, objPERMIT.PERMIT_NUMBER_TEXT);
            dbCommandWrapper.AddInParameter("p_PERMIT_TYPE", DbType.String, objPERMIT.PERMIT_TYPE);
            dbCommandWrapper.AddInParameter("p_DOT_TRACKING_NUMBER", DbType.String, objPERMIT.DOT_TRACKING_NUMBER);
            dbCommandWrapper.AddInParameter("p_SUBMITTED_DATE", DbType.DateTime, objPERMIT.SUBMITTED_DATE);
            dbCommandWrapper.AddInParameter("p_SEGMENT", DbType.String, objPERMIT.SEGMENT);
            dbCommandWrapper.AddInParameter("p_IS_PROTECTED_STREET", DbType.String, objPERMIT.IS_PROTECTED_STREET);
            dbCommandWrapper.AddInParameter("p_MARKOUT_START_DATE", DbType.DateTime, objPERMIT.MARKOUT_START_DATE);
            dbCommandWrapper.AddInParameter("p_MARKOUT_END_DATE", DbType.DateTime, objPERMIT.MARKOUT_END_DATE);
            dbCommandWrapper.AddInParameter("p_STIPULATION_DAY", DbType.Boolean, objPERMIT.STIPULATION_DAY);
            dbCommandWrapper.AddInParameter("p_STIPULATION_NIGHT", DbType.Boolean, objPERMIT.STIPULATION_NIGHT);
            dbCommandWrapper.AddInParameter("p_STIPULATION_WEEKEND", DbType.Boolean, objPERMIT.STIPULATION_WEEKEND);
            dbCommandWrapper.AddInParameter("p_STIPULATIONS_OTHER", DbType.String, objPERMIT.STIPULATIONS_OTHER);
            dbCommandWrapper.AddInParameter("p_ISSUED_DATE", DbType.DateTime, objPERMIT.ISSUED_DATE);
            dbCommandWrapper.AddInParameter("p_VALID_DATE", DbType.DateTime, objPERMIT.VALID_DATE);
            dbCommandWrapper.AddInParameter("p_EXPIRES_DATE", DbType.DateTime, objPERMIT.EXPIRES_DATE);
            dbCommandWrapper.AddInParameter("p_PERMIT_STATUS", DbType.Int32, objPERMIT.PERMIT_STATUS);
            dbCommandWrapper.AddInParameter("p_NOTES", DbType.String, objPERMIT.NOTES);
            dbCommandWrapper.AddInParameter("p_REJECTED_DATE", DbType.DateTime, objPERMIT.REJECTED_DATE);
            dbCommandWrapper.AddInParameter("p_REJECTED_REASON", DbType.Int32, objPERMIT.REJECTED_REASON);
            dbCommandWrapper.AddInParameter("p_CREATED_BY", DbType.Int32, objPERMIT.CREATED_BY);
            dbCommandWrapper.AddInParameter("p_CREATED_ON", DbType.DateTime, objPERMIT.CREATED_ON);
            dbCommandWrapper.AddInParameter("p_MODIFIED_BY", DbType.Int32, objPERMIT.MODIFIED_BY);
            dbCommandWrapper.AddInParameter("p_MODIFIED_ON", DbType.DateTime, objPERMIT.MODIFIED_ON);
            dbCommandWrapper.AddInParameter("p_LOCK_COUNTER", DbType.Int32, objPERMIT.LOCK_COUNTER);

            dbCommandWrapper.AddInParameter("p_IS_PAGE2_FILLED", DbType.Boolean, objPERMIT.IS_PAGE2_FILLED);
            dbCommandWrapper.AddInParameter("p_IsRepeatOperation", DbType.Boolean, objPERMIT.IsRepeatOperation);

            dbCommandWrapper.AddInParameter("p_CurrentPage", DbType.String, objPERMIT.CurrentPage);
            dbCommandWrapper.DBCommand.Parameters["@p_PERMIT_ID"].Direction = ParameterDirection.Output;


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

            objPERMIT.PERMIT_ID = Convert.ToInt32(dbCommandWrapper.DBCommand.Parameters["@p_PERMIT_ID"].Value);

            return(objPERMIT.PERMIT_ID);
        }
Ejemplo n.º 6
0
        public int Update(DBConnection Connection, PERMITDC objPERMIT)
        {
            int updateCount = 0;

            StringBuilder sql = new StringBuilder();

            sql.Append("proc_PERMITSUpdate");

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


            dbCommandWrapper.AddInParameter("p_PERMIT_ID", DbType.Int32, objPERMIT.PERMIT_ID);
            dbCommandWrapper.AddInParameter("p_PROJECT_ID", DbType.Int32, objPERMIT.PROJECT_ID);
            dbCommandWrapper.AddInParameter("p_JOB_ID", DbType.Int32, objPERMIT.JOB_ID);
            dbCommandWrapper.AddInParameter("p_CLIENT", DbType.String, objPERMIT.CLIENT);
            dbCommandWrapper.AddInParameter("p_NODE_ID1", DbType.String, objPERMIT.NODE_ID1);
            dbCommandWrapper.AddInParameter("p_NODE_ID2", DbType.String, objPERMIT.NODE_ID2);
            dbCommandWrapper.AddInParameter("p_NODE_ID3", DbType.String, objPERMIT.NODE_ID3);
            dbCommandWrapper.AddInParameter("p_HUB", DbType.String, objPERMIT.HUB);
            dbCommandWrapper.AddInParameter("p_HYLAN_PM", DbType.Int32, objPERMIT.HYLAN_PM);
            dbCommandWrapper.AddInParameter("p_STREET_ADDRESS", DbType.String, objPERMIT.STREET_ADDRESS);
            dbCommandWrapper.AddInParameter("p_CITY", DbType.String, objPERMIT.CITY);
            dbCommandWrapper.AddInParameter("p_STATE", DbType.String, objPERMIT.STATE);
            dbCommandWrapper.AddInParameter("p_ZIP", DbType.String, objPERMIT.ZIP);
            dbCommandWrapper.AddInParameter("p_LAT", DbType.String, objPERMIT.LAT);
            dbCommandWrapper.AddInParameter("p_LONG", DbType.String, objPERMIT.LONG);
            dbCommandWrapper.AddInParameter("p_POLE_LOCATION", DbType.String, objPERMIT.POLE_LOCATION);
            dbCommandWrapper.AddInParameter("p_PERMIT_NUMBER_TEXT", DbType.String, objPERMIT.PERMIT_NUMBER_TEXT);
            dbCommandWrapper.AddInParameter("p_PERMIT_TYPE", DbType.String, objPERMIT.PERMIT_TYPE);
            dbCommandWrapper.AddInParameter("p_DOT_TRACKING_NUMBER", DbType.String, objPERMIT.DOT_TRACKING_NUMBER);
            dbCommandWrapper.AddInParameter("p_SUBMITTED_DATE", DbType.DateTime, objPERMIT.SUBMITTED_DATE);
            dbCommandWrapper.AddInParameter("p_SEGMENT", DbType.String, objPERMIT.SEGMENT);
            dbCommandWrapper.AddInParameter("p_IS_PROTECTED_STREET", DbType.String, objPERMIT.IS_PROTECTED_STREET);
            dbCommandWrapper.AddInParameter("p_MARKOUT_START_DATE", DbType.DateTime, objPERMIT.MARKOUT_START_DATE);
            dbCommandWrapper.AddInParameter("p_MARKOUT_END_DATE", DbType.DateTime, objPERMIT.MARKOUT_END_DATE);
            dbCommandWrapper.AddInParameter("p_STIPULATION_DAY", DbType.Boolean, objPERMIT.STIPULATION_DAY);
            dbCommandWrapper.AddInParameter("p_STIPULATION_NIGHT", DbType.Boolean, objPERMIT.STIPULATION_NIGHT);
            dbCommandWrapper.AddInParameter("p_STIPULATION_WEEKEND", DbType.Boolean, objPERMIT.STIPULATION_WEEKEND);
            dbCommandWrapper.AddInParameter("p_STIPULATIONS_OTHER", DbType.String, objPERMIT.STIPULATIONS_OTHER);
            dbCommandWrapper.AddInParameter("p_ISSUED_DATE", DbType.DateTime, objPERMIT.ISSUED_DATE);
            dbCommandWrapper.AddInParameter("p_VALID_DATE", DbType.DateTime, objPERMIT.VALID_DATE);
            dbCommandWrapper.AddInParameter("p_EXPIRES_DATE", DbType.DateTime, objPERMIT.EXPIRES_DATE);
            dbCommandWrapper.AddInParameter("p_PERMIT_STATUS", DbType.Int32, objPERMIT.PERMIT_STATUS);
            dbCommandWrapper.AddInParameter("p_NOTES", DbType.String, objPERMIT.NOTES);
            dbCommandWrapper.AddInParameter("p_REJECTED_DATE", DbType.DateTime, objPERMIT.REJECTED_DATE);
            dbCommandWrapper.AddInParameter("p_REJECTED_REASON", DbType.Int32, objPERMIT.REJECTED_REASON);
            dbCommandWrapper.AddInParameter("p_CREATED_BY", DbType.Int32, objPERMIT.CREATED_BY);
            dbCommandWrapper.AddInParameter("p_CREATED_ON", DbType.DateTime, objPERMIT.CREATED_ON);
            dbCommandWrapper.AddInParameter("p_MODIFIED_BY", DbType.Int32, objPERMIT.MODIFIED_BY);
            dbCommandWrapper.AddInParameter("p_MODIFIED_ON", DbType.DateTime, objPERMIT.MODIFIED_ON);
            dbCommandWrapper.AddInParameter("p_LOCK_COUNTER", DbType.Int32, objPERMIT.LOCK_COUNTER);

            dbCommandWrapper.AddInParameter("p_CurrentPage", DbType.String, objPERMIT.CurrentPage);

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

                if (updateCount == 0)
                {
                    objPERMIT.IsDirty = IsDirty = true;
                    throw new Exception(Constants.ConcurrencyMessageSingleRow);
                }
            }
            catch (Exception exp)
            {
                //Utilities.InsertIntoErrorLog("Error: JOB UPDATE ", exp.Message + "\r\n" + exp.StackTrace, Convert.ToInt32(objPERMIT.MODIFIED_BY));
                objPERMIT.SetError(exp);
                throw exp;
            }
            return(updateCount);
        }