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); }
public int Insert(DBConnection Connection, USERDC objUSER) { int insertCount = 0; StringBuilder sql = new StringBuilder(); sql.Append("proc_USERSInsert"); DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection); dbCommandWrapper.AddOutParameter("p_USER_ID", DbType.Int32, Int32.MaxValue); dbCommandWrapper.AddInParameter("p_USER_NAME", DbType.String, objUSER.USER_NAME); dbCommandWrapper.AddInParameter("p_PASSWORD", DbType.String, Encryptor.Encrypt(objUSER.PASSWORD)); dbCommandWrapper.AddInParameter("p_FIRST_NAME", DbType.String, objUSER.FIRST_NAME); dbCommandWrapper.AddInParameter("p_LAST_NAME", DbType.String, objUSER.LAST_NAME); dbCommandWrapper.AddInParameter("p_ROLE_ID", DbType.Int32, objUSER.ROLE.ROLE_ID); dbCommandWrapper.AddInParameter("p_EMAIL_ADDRESS", DbType.String, objUSER.EMAIL_ADDRESS); dbCommandWrapper.AddInParameter("p_OFFICE_PHONE", DbType.String, objUSER.OFFICE_PHONE); dbCommandWrapper.AddInParameter("p_MOBILE_PHONE", DbType.String, objUSER.MOBILE_PHONE); dbCommandWrapper.AddInParameter("p_SECURITY_QUESTION", DbType.String, objUSER.SECURITY_QUESTION); dbCommandWrapper.AddInParameter("p_ANSWER", DbType.String, objUSER.ANSWER); dbCommandWrapper.AddInParameter("p_STATUS", DbType.String, objUSER.STATUS); dbCommandWrapper.AddInParameter("p_CREATED_BY", DbType.Int32, objUSER.CREATED_BY); dbCommandWrapper.AddInParameter("p_USER_COMPANY_ID", DbType.Int32, objUSER.USER_COMPANY_ID); 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: USER INSERTION ", exp.Message + "\r\n" + exp.StackTrace, objUSER.MODIFIED_BY); objUSER.SetError(exp); throw exp; } objUSER.USER_ID = (int)dbCommandWrapper.DBCommand.Parameters["@p_USER_ID"].Value; return(insertCount); }
public int Insert(DBConnection Connection, PROJECTDC objPROJECT) { int p_ID = 0; StringBuilder sql = new StringBuilder(); sql.Append("proc_PROJECTSInsert"); DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection); dbCommandWrapper.AddOutParameter("p_PROJECT_ID", DbType.Int32, objPROJECT.PROJECT_ID); dbCommandWrapper.AddInParameter("p_HYLAN_PROJECT_ID", DbType.String, objPROJECT.HYLAN_PROJECT_ID); dbCommandWrapper.AddInParameter("p_HYLAN_JOB_NUMBER", DbType.String, objPROJECT.HYLAN_JOB_NUMBER); dbCommandWrapper.AddInParameter("p_PROJECT_BID_NAME", DbType.String, objPROJECT.PROJECT_BID_NAME); dbCommandWrapper.AddInParameter("p_CLIENT", DbType.String, objPROJECT.CLIENT); dbCommandWrapper.AddInParameter("p_PROJECT_STATUS", DbType.Int16, objPROJECT.PROJECT_STATUS); dbCommandWrapper.AddInParameter("p_TENTATIVE_PROJECT_START_DATE", DbType.DateTime, objPROJECT.TENTATIVE_PROJECT_START_DATE); dbCommandWrapper.AddInParameter("p_ACTUAL_PROJECT_START_DATE", DbType.DateTime, objPROJECT.ACTUAL_PROJECT_START_DATE); dbCommandWrapper.AddInParameter("p_PROJECTED_END_DATE", DbType.DateTime, objPROJECT.PROJECTED_END_DATE); dbCommandWrapper.AddInParameter("p_ACTUAL_PROJECT_CLOSE_DATE", DbType.DateTime, objPROJECT.ACTUAL_PROJECT_CLOSE_DATE); dbCommandWrapper.AddInParameter("p_PROJECT_BID_DATE", DbType.DateTime, objPROJECT.PROJECT_BID_DATE); dbCommandWrapper.AddInParameter("p_PROJECT_AWARDED", DbType.DateTime, objPROJECT.PROJECT_AWARDED); dbCommandWrapper.AddInParameter("p_BID_DOCUMENTS", DbType.String, objPROJECT.BID_DOCUMENTS); dbCommandWrapper.AddInParameter("p_NOTES", DbType.String, objPROJECT.NOTES); dbCommandWrapper.AddInParameter("p_PO_NUMBER", DbType.String, objPROJECT.PO_NUMBER); dbCommandWrapper.AddInParameter("p_PO_AMOUNT", DbType.Decimal, objPROJECT.PO_AMOUNT); dbCommandWrapper.AddInParameter("p_CREATED_ON", DbType.DateTime, objPROJECT.CREATED_ON); dbCommandWrapper.AddInParameter("p_CREATED_BY", DbType.Int32, objPROJECT.CREATED_BY); dbCommandWrapper.AddInParameter("p_MODIFIED_ON", DbType.DateTime, objPROJECT.MODIFIED_ON); dbCommandWrapper.AddInParameter("p_MODIFIED_BY", DbType.Int32, objPROJECT.MODIFIED_BY); dbCommandWrapper.AddInParameter("p_LOCK_COUNTER", DbType.Int32, objPROJECT.LOCK_COUNTER); if (Connection.Transaction != null) { Connection.dataBase.ExecuteNonQuery(dbCommandWrapper.DBCommand, Connection.Transaction); } else { Connection.dataBase.ExecuteNonQuery(dbCommandWrapper.DBCommand); } p_ID = Convert.ToInt32(dbCommandWrapper.DBCommand.Parameters["@p_PROJECT_ID"].Value); return(p_ID); }
public int Insert(DBConnection Connection, DAILYDC objDAIL) { int p_DAILY_ID = 0; StringBuilder sql = new StringBuilder(); sql.Append("proc_DAILYInsert"); DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection); int?projId = (objDAIL.PROJECT_ID == -1) ? null : objDAIL.PROJECT_ID; int?jobId = (objDAIL.JOB_ID == -1) ? null : objDAIL.JOB_ID; dbCommandWrapper.AddOutParameter("p_DAILY_ID", DbType.Int32, objDAIL.DAILY_ID); dbCommandWrapper.AddInParameter("p_PROJECT_ID", DbType.Int32, projId); dbCommandWrapper.AddInParameter("p_JOB_ID", DbType.Int32, jobId); dbCommandWrapper.AddInParameter("p_DAILY_TYPE", DbType.Int32, objDAIL.DAILY_TYPE); dbCommandWrapper.AddInParameter("p_DAILY_DATE", DbType.DateTime, objDAIL.DAILY_DATE); dbCommandWrapper.AddInParameter("p_DAY_OF_WEEK", DbType.String, objDAIL.DAY_OF_WEEK); dbCommandWrapper.AddInParameter("p_DAILY_DAYS", DbType.Int32, objDAIL.DAILY_DAYS); dbCommandWrapper.AddInParameter("p_STATUS", DbType.Int32, objDAIL.STATUS); dbCommandWrapper.AddInParameter("p_SHIFT", DbType.Int32, objDAIL.SHIFT); dbCommandWrapper.AddInParameter("p_WORK_ORDER_NUMBER", DbType.String, objDAIL.WORK_ORDER_NUMBER); dbCommandWrapper.AddInParameter("p_DAILY_TYPE_NOTES", DbType.String, objDAIL.DAILY_TYPE_NOTES); dbCommandWrapper.AddInParameter("p_QUICK_NOTES", DbType.String, objDAIL.QUICK_NOTES); dbCommandWrapper.AddInParameter("p_CREATED_ON", DbType.DateTime, objDAIL.CREATED_ON); dbCommandWrapper.AddInParameter("p_CREATED_BY", DbType.Int32, objDAIL.CREATED_BY); dbCommandWrapper.AddInParameter("p_MODIFIED_ON", DbType.DateTime, objDAIL.MODIFIED_ON); dbCommandWrapper.AddInParameter("p_MODIFIED_BY", DbType.Int32, objDAIL.MODIFIED_BY); dbCommandWrapper.AddInParameter("p_LOCK_COUNTER", DbType.Int32, objDAIL.LOCK_COUNTER); dbCommandWrapper.AddInParameter("p_TRACK_REVENUE", DbType.Decimal, objDAIL.TRACK_REVENUE); if (Connection.Transaction != null) { p_DAILY_ID = Connection.dataBase.ExecuteNonQuery(dbCommandWrapper.DBCommand, Connection.Transaction); } else { p_DAILY_ID = Connection.dataBase.ExecuteNonQuery(dbCommandWrapper.DBCommand); } p_DAILY_ID = Convert.ToInt32(dbCommandWrapper.DBCommand.Parameters["@p_DAILY_ID"].Value); return(p_DAILY_ID); }
//public int Insert(DBConnection Connection, List<ErrorLogDC> objErrorLogs) //{ // int insertCount = 0; // foreach (ErrorLogDC errLog in objErrorLogs) // { // insertCount = Insert(Connection, errLog); // } // return insertCount; //} public int Insert(ErrorLogDC objErrorLog) { DBConnection Connection = new DBConnection(); Connection.Open(false); int insertCount = 0; try { if (objErrorLog.On == DateTime.MinValue) { objErrorLog.On = DateTime.Now; } StringBuilder sql = new StringBuilder(); sql.Append("proc_ErrorLogInsert"); DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection); dbCommandWrapper.AddOutParameter("EL_ID", DbType.Int32, objErrorLog.ErrorLogID); dbCommandWrapper.AddInParameter("AU_ERROR_RECEIVER", DbType.Int32, objErrorLog.ErrorReceiver); dbCommandWrapper.AddInParameter("EL_ERROR_ON", DbType.DateTime, objErrorLog.On); dbCommandWrapper.AddInParameter("EL_ERROR_FROM", DbType.String, objErrorLog.From); dbCommandWrapper.AddInParameter("EL_ERROR_DESCRIP", DbType.String, objErrorLog.Description); if (Connection.Transaction != null) { insertCount = Connection.dataBase.ExecuteNonQuery(dbCommandWrapper.DBCommand, Connection.Transaction); } else { insertCount = Connection.dataBase.ExecuteNonQuery(dbCommandWrapper.DBCommand); } Connection.Commit(); return(insertCount); } catch (Exception ex) { objErrorLog.SetError(ex); throw ex; } }
//public int Insert(DBConnection Connection, ROLEDC objROLEs) //{ // int insertCount = 0; // //foreach (ROLEDC objROLE in objROLEs) // //{ // insertCount = Insert(Connection, objROLEs); // // } // return insertCount; //} public int Insert(DBConnection Connection, ROLEDC objROLE) { int insertCount = 0; StringBuilder sql = new StringBuilder(); sql.Append("proc_ROLESInsert"); DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection); dbCommandWrapper.AddOutParameter("p_ROLE_ID", DbType.Int32, objROLE.ROLE_ID); dbCommandWrapper.AddInParameter("p_ROLE_NAME", DbType.String, objROLE.ROLE_NAME); dbCommandWrapper.AddInParameter("p_DESCRIPTION", DbType.String, objROLE.DESCRIPTION); dbCommandWrapper.AddInParameter("p_IS_RESTRICTED", DbType.Boolean, objROLE.IS_RESTRICTED); dbCommandWrapper.AddInParameter("p_STATUS", DbType.String, objROLE.STATUS); dbCommandWrapper.AddInParameter("p_CREATED_BY", DbType.Int32, objROLE.CREATED_BY); dbCommandWrapper.AddInParameter("p_MODIFIED_BY", DbType.Int32, objROLE.MODIFIED_BY); 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: ROLE INSERTION ", exp.Message + "\r\n" + exp.StackTrace, objROLE.MODIFIED_BY); objROLE.SetError(exp); throw exp; } objROLE.ROLE_ID = (int)dbCommandWrapper.DBCommand.Parameters["@p_ROLE_ID"].Value; return(insertCount); }
public ATTACHMENTDC Insert(DBConnection Connection, ATTACHMENTDC objATTACHMENT) { int insertCount = 0; StringBuilder sql = new StringBuilder(); sql.Append("proc_ATTACHMENTSInsert"); DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection); dbCommandWrapper.AddOutParameter("p_ATTACHMENT_ID", DbType.Int32, objATTACHMENT.ATTACHMENT_ID); dbCommandWrapper.AddInParameter("p_FILE_NAME", DbType.String, objATTACHMENT.UPDATED_FILE_NAME); dbCommandWrapper.AddInParameter("p_FILE_TITLE", DbType.String, objATTACHMENT.FILE_TITLE); dbCommandWrapper.AddInParameter("p_FILE_KEYWORD", DbType.String, objATTACHMENT.FILE_KEYWORD); dbCommandWrapper.AddInParameter("p_FILE_TYPE", DbType.String, objATTACHMENT.FILE_TYPE); dbCommandWrapper.AddInParameter("p_FILE_SIZE", DbType.String, objATTACHMENT.FILE_SIZE); dbCommandWrapper.AddInParameter("p_DOCUMENT_CATEGORY", DbType.String, objATTACHMENT.Documentcategorydc.CATEGORY_CODE); dbCommandWrapper.AddInParameter("p_CREATED_ON", DbType.DateTime, objATTACHMENT.CREATED_ON); dbCommandWrapper.AddInParameter("p_CREATED_BY", DbType.Int32, objATTACHMENT.CREATED_BY); dbCommandWrapper.AddInParameter("p_MODIFIED_ON", DbType.DateTime, objATTACHMENT.MODIFIED_ON); dbCommandWrapper.AddInParameter("p_MODIFIED_BY", DbType.Int32, objATTACHMENT.MODIFIED_BY); dbCommandWrapper.AddInParameter("p_Is_DELETED", DbType.Boolean, objATTACHMENT.IS_DELETED); dbCommandWrapper.AddInParameter("p_SCREEN_ID", DbType.Int32, objATTACHMENT.SCREEN_ID); dbCommandWrapper.AddInParameter("p_SCREEN_RECORD_ID", DbType.Int32, objATTACHMENT.SCREEN_RECORD_ID); if (Connection.Transaction != null) { insertCount = Connection.dataBase.ExecuteNonQuery(dbCommandWrapper.DBCommand, Connection.Transaction); } else { insertCount = Connection.dataBase.ExecuteNonQuery(dbCommandWrapper.DBCommand); } objATTACHMENT.ATTACHMENT_ID = (int)dbCommandWrapper.DBCommand.Parameters["@p_ATTACHMENT_ID"].Value; return(objATTACHMENT); }
public int Insert(DBConnection Connection, MAN_POWERDC objMAN_POWE) { int insertCount = 0; StringBuilder sql = new StringBuilder(); sql.Append("proc_MAN_POWERInsert"); DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection); dbCommandWrapper.AddOutParameter("p_MAN_POWER_ID", DbType.Int32, objMAN_POWE.MAN_POWER_ID); dbCommandWrapper.AddInParameter("p_DAILY_ID", DbType.Int32, objMAN_POWE.DAILY_ID); dbCommandWrapper.AddInParameter("p_FIRST_NAME", DbType.String, objMAN_POWE.FIRST_NAME); dbCommandWrapper.AddInParameter("p_LAST_NAME", DbType.String, objMAN_POWE.LAST_NAME); dbCommandWrapper.AddInParameter("p_ST_HOURS", DbType.Decimal, objMAN_POWE.ST_HOURS); dbCommandWrapper.AddInParameter("p_OT_HOURS", DbType.Decimal, objMAN_POWE.OT_HOURS); dbCommandWrapper.AddInParameter("p_HOURS_DIFF", DbType.Decimal, objMAN_POWE.HOURS_DIFF); dbCommandWrapper.AddInParameter("p_MAN_POWER_JOB_TYPE", DbType.Decimal, objMAN_POWE.MAN_POWER_JOB_TYPE); dbCommandWrapper.AddInParameter("p_CREATED_ON", DbType.DateTime, objMAN_POWE.CREATED_ON); dbCommandWrapper.AddInParameter("p_CREATED_BY", DbType.Int32, objMAN_POWE.CREATED_BY); dbCommandWrapper.AddInParameter("p_MODIFIED_ON", DbType.DateTime, objMAN_POWE.MODIFIED_ON); dbCommandWrapper.AddInParameter("p_MODIFIED_BY", DbType.Int32, objMAN_POWE.MODIFIED_BY); dbCommandWrapper.AddInParameter("p_LOCK_COUNTER", DbType.Int32, objMAN_POWE.LOCK_COUNTER); if (Connection.Transaction != null) { insertCount = Connection.dataBase.ExecuteNonQuery(dbCommandWrapper.DBCommand, Connection.Transaction); } else { insertCount = Connection.dataBase.ExecuteNonQuery(dbCommandWrapper.DBCommand); } return(insertCount); }
public int Insert(DBConnection Connection, COMPANIEDC objCOMPANIE) { int insertCount = 0; StringBuilder sql = new StringBuilder(); sql.Append("proc_COMPANIESInsert"); DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection); dbCommandWrapper.AddOutParameter("p_COMPANY_ID", DbType.Int32, objCOMPANIE.COMPANY_ID); dbCommandWrapper.AddInParameter("p_COMPANY_NAME", DbType.String, objCOMPANIE.COMPANY_NAME); //dbCommandWrapper.AddInParameter("p_TOTAL_CUSTOMERS", DbType.Int64, objCOMPANIE.TOTAL_CUSTOMERS); //dbCommandWrapper.AddInParameter("p_HOME_RMAG", DbType.Int32, objCOMPANIE.HOME_RMAG); dbCommandWrapper.AddInParameter("p_COMPANY_PHONE_NUMBER", DbType.String, objCOMPANIE.COMPANY_PHONE_NUMBER); dbCommandWrapper.AddInParameter("p_PRIMARY_CONTACT_NAME", DbType.String, objCOMPANIE.PRIMARY_CONTACT_NAME); dbCommandWrapper.AddInParameter("p_PRIMARY_CONTACT_EMAIL", DbType.String, objCOMPANIE.PRIMARY_CONTACT_EMAIL); dbCommandWrapper.AddInParameter("p_COMPANY_CITY", DbType.String, objCOMPANIE.COMPANY_CITY); if (!string.IsNullOrEmpty(objCOMPANIE.COMPANY_STATE)) { dbCommandWrapper.AddInParameter("p_COMPANY_STATE", DbType.String, objCOMPANIE.COMPANY_STATE); } else { dbCommandWrapper.AddInParameter("p_COMPANY_STATE", DbType.String, DBNull.Value); } dbCommandWrapper.AddInParameter("p_COMPANY_ZIP", DbType.String, objCOMPANIE.COMPANY_ZIP); dbCommandWrapper.AddInParameter("p_COMPANY_ADDRESS", DbType.String, objCOMPANIE.COMPANY_ADDRESS); dbCommandWrapper.AddInParameter("p_STATUS", DbType.String, objCOMPANIE.STATUS); dbCommandWrapper.AddInParameter("p_CREATED_ON", DbType.DateTime, objCOMPANIE.CREATED_ON); dbCommandWrapper.AddInParameter("p_CREATED_BY", DbType.Int32, objCOMPANIE.CREATED_BY); dbCommandWrapper.AddInParameter("p_MODIFIED_ON", DbType.DateTime, objCOMPANIE.MODIFIED_ON); dbCommandWrapper.AddInParameter("p_MODIFIED_BY", DbType.Int32, objCOMPANIE.MODIFIED_BY); dbCommandWrapper.AddInParameter("p_BILLING_CONTACT_NAME", DbType.String, objCOMPANIE.BILLING_CONTACT_NAME); dbCommandWrapper.AddInParameter("p_BILLING_PHONE", DbType.String, objCOMPANIE.BILLING_PHONE); dbCommandWrapper.AddInParameter("p_BILLING_CONTACT_EMAIL", DbType.String, objCOMPANIE.BILLING_CONTACT_EMAIL); dbCommandWrapper.AddInParameter("p_PROJECT_DIRECTOR_NAME", DbType.String, objCOMPANIE.PROJECT_DIRECTOR_NAME); dbCommandWrapper.AddInParameter("p_PROJECT_DIRECTOR_PHONE", DbType.String, objCOMPANIE.PROJECT_DIRECTOR_PHONE); dbCommandWrapper.AddInParameter("p_PROJECT_DIRECTOR_EMAIL", DbType.String, objCOMPANIE.PROJECT_DIRECTOR_EMAIL); dbCommandWrapper.AddInParameter("p_PROJECT_MANAGER_NAME", DbType.String, objCOMPANIE.PROJECT_MANAGER_NAME); dbCommandWrapper.AddInParameter("p_PROJECT_MANAGER_PHONE", DbType.String, objCOMPANIE.PROJECT_MANAGER_PHONE); dbCommandWrapper.AddInParameter("p_PROJECT_MANAGER_EMAIL", DbType.String, objCOMPANIE.PROJECT_MANAGER_EMAIL); 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: CLIENTS INSERTION ", exp.Message + "\r\n" + exp.StackTrace, objCOMPANIE.MODIFIED_BY); objCOMPANIE.SetError(exp); throw exp; } objCOMPANIE.COMPANY_ID = (int)dbCommandWrapper.DBCommand.Parameters["@p_COMPANY_ID"].Value; return(insertCount); }
private int Insert(DBConnection Connection, JOBDC objMANAGE_JOB) { int p_JOB_ID = 0; StringBuilder sql = new StringBuilder(); sql.Append("proc_MANAGE_JOBSInsert"); DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection); dbCommandWrapper.AddOutParameter("p_JOB_ID", DbType.Int32, objMANAGE_JOB.JOB_ID); dbCommandWrapper.AddInParameter("p_PROJECT_ID", DbType.Int32, objMANAGE_JOB.PROJECT_ID); dbCommandWrapper.AddInParameter("p_JOB_FILE_NUMBER", DbType.String, objMANAGE_JOB.JOB_FILE_NUMBER); dbCommandWrapper.AddInParameter("p_NODE_ID1", DbType.String, objMANAGE_JOB.NODE_ID1); dbCommandWrapper.AddInParameter("p_NODE_ID2", DbType.String, objMANAGE_JOB.NODE_ID2); dbCommandWrapper.AddInParameter("p_NODE_ID3", DbType.String, objMANAGE_JOB.NODE_ID3); dbCommandWrapper.AddInParameter("p_HUB", DbType.String, objMANAGE_JOB.HUB); dbCommandWrapper.AddInParameter("p_HYLAN_PM", DbType.Int32, objMANAGE_JOB.HYLAN_PM); dbCommandWrapper.AddInParameter("p_STREET_ADDRESS", DbType.String, objMANAGE_JOB.STREET_ADDRESS); dbCommandWrapper.AddInParameter("p_CITY", DbType.String, objMANAGE_JOB.CITY); dbCommandWrapper.AddInParameter("p_STATE", DbType.String, objMANAGE_JOB.STATE); dbCommandWrapper.AddInParameter("p_ZIP", DbType.String, objMANAGE_JOB.ZIP); dbCommandWrapper.AddInParameter("p_LAT", DbType.String, objMANAGE_JOB.LAT); dbCommandWrapper.AddInParameter("p_LONG", DbType.String, objMANAGE_JOB.LONG); dbCommandWrapper.AddInParameter("p_POLE_LOCATION", DbType.String, objMANAGE_JOB.POLE_LOCATION); dbCommandWrapper.AddInParameter("p_DOITT_NTP_STATUS", DbType.Int32, objMANAGE_JOB.DOITT_NTP_STATUS); dbCommandWrapper.AddInParameter("p_DOITT_NTP_GRANTED_DATE", DbType.DateTime, objMANAGE_JOB.DOITT_NTP_GRANTED_DATE); dbCommandWrapper.AddInParameter("p_JOB_CATEGORY", DbType.Int32, objMANAGE_JOB.JOB_CATEGORY); dbCommandWrapper.AddInParameter("p_JOB_STATUS", DbType.Int32, objMANAGE_JOB.JOB_STATUS); dbCommandWrapper.AddInParameter("p_ON_HOLD_REASON", DbType.String, objMANAGE_JOB.ON_HOLD_REASON); dbCommandWrapper.AddInParameter("p_CLIENT_PM", DbType.String, objMANAGE_JOB.CLIENT_PM); dbCommandWrapper.AddInParameter("p_JOB_NOTES", DbType.String, objMANAGE_JOB.JOB_NOTES); dbCommandWrapper.AddInParameter("p_NUMBER_OF_SUBMITTED_PERMITS", DbType.Int32, objMANAGE_JOB.NUMBER_OF_SUBMITTED_PERMITS); dbCommandWrapper.AddInParameter("p_PERMIT_NOTES", DbType.String, objMANAGE_JOB.PERMIT_NOTES); dbCommandWrapper.AddInParameter("p_PUNCHLIST_COMPLETE", DbType.String, objMANAGE_JOB.PUNCHLIST_COMPLETE); dbCommandWrapper.AddInParameter("p_PUNCHLIST_SUBMITTED_DATE", DbType.DateTime, objMANAGE_JOB.PUNCHLIST_SUBMITTED_DATE); dbCommandWrapper.AddInParameter("p_CLIENT_APPROVAL_DATE", DbType.DateTime, objMANAGE_JOB.CLIENT_APPROVAL_DATE); dbCommandWrapper.AddInParameter("p_PRIORITY", DbType.String, objMANAGE_JOB.PRIORITY); dbCommandWrapper.AddInParameter("p_CJ_NUMBER", DbType.String, objMANAGE_JOB.CJ_NUMBER); dbCommandWrapper.AddInParameter("p_DID_NUMBER", DbType.String, objMANAGE_JOB.DID_NUMBER); dbCommandWrapper.AddInParameter("p_CREATED_BY", DbType.Int32, objMANAGE_JOB.CREATED_BY); dbCommandWrapper.AddInParameter("p_CREATED_ON", DbType.DateTime, objMANAGE_JOB.CREATED_ON); dbCommandWrapper.AddInParameter("p_MODIFIED_BY", DbType.String, objMANAGE_JOB.MODIFIED_BY); dbCommandWrapper.AddInParameter("p_MODIFIED_ON", DbType.DateTime, objMANAGE_JOB.MODIFIED_ON); dbCommandWrapper.AddInParameter("p_LOCK_COUNTER", DbType.Int32, objMANAGE_JOB.LOCK_COUNTER); dbCommandWrapper.AddInParameter("p_PO_NUMBER", DbType.String, objMANAGE_JOB.PO_NUMBER); dbCommandWrapper.AddInParameter("p_PO_AMOUNT", DbType.Decimal, objMANAGE_JOB.PO_AMOUNT); dbCommandWrapper.AddInParameter("p_INVOICE_DATE", DbType.DateTime, objMANAGE_JOB.INVOICE_DATE); dbCommandWrapper.AddInParameter("p_INVOICE_AMOUNT", DbType.Decimal, objMANAGE_JOB.INVOICE_AMOUNT); if (Connection.Transaction != null) { p_JOB_ID = Connection.dataBase.ExecuteNonQuery(dbCommandWrapper.DBCommand, Connection.Transaction); } else { p_JOB_ID = Connection.dataBase.ExecuteNonQuery(dbCommandWrapper.DBCommand); } p_JOB_ID = Convert.ToInt32(dbCommandWrapper.DBCommand.Parameters["@p_JOB_ID"].Value); return(p_JOB_ID); }