public static DataTable getCPARRequestFrom(string CACIId, string CAStage) { IQISSDBManager dbManager = new QISSDBManager(); DataTable dt = new DataTable(); try { dbManager.Open(); IDbDataParameter[] param = QISSDBManagerFactory.GetParameters(dbManager.ProviderType, 2); param[0] = dbManager.getparam("@CACIId", CACIId.ToString()); param[1] = dbManager.getparam("@CAStage", CAStage.ToString()); IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "usp_CPARInfo_getCPARRequestFrom", param); dt = dbManager.GetDataTable(cmd); return(dt); } catch (Exception ex) { return(dt); } finally { dt.Dispose(); dbManager.Dispose(); } }
public static DataTable getAssignedWorkInformation(string CIId) { IQISSDBManager dbManager = new QISSDBManager(); DataTable dt = new DataTable(); try { dbManager.Open(); IDbDataParameter[] param = QISSDBManagerFactory.GetParameters(dbManager.ProviderType, 1); param[0] = dbManager.getparam("@CIId", CIId.ToString()); IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "usp_CPARAction_get_AssignedWork", param); dt = dbManager.GetDataTable(cmd); return(dt); } catch (Exception ex) { return(dt); } finally { dt.Dispose(); dbManager.Dispose(); } }
} //---END ADD--- public static DataTable getAppReqCompStepCPAR(string CAAssignedTo, string CIBranchId, clsBOLGetAllCPARInformation obj) { IQISSDBManager dbManager = new QISSDBManager(); DataTable dt = new DataTable(); try { dbManager.Open(); IDbDataParameter[] param = QISSDBManagerFactory.GetParameters(dbManager.ProviderType, 6); param[0] = dbManager.getparam("@CAAssignedTo", CAAssignedTo.ToString()); param[1] = dbManager.getparam("@CIBranchId", CIBranchId.ToString()); param[2] = dbManager.getparam("@CICPARNo", obj.CICPARNo); param[3] = dbManager.getparam("@CIInitiator", obj.CIInitiator); param[4] = dbManager.getparam("@CIInitiateDate_start", obj.CIInitiateDate_start); param[5] = dbManager.getparam("@CIInitiateDate_end", obj.CIInitiateDate_end); IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "usp_CPARAction_APPRequest_CompStep", param); dt = dbManager.GetDataTable(cmd); return(dt); } catch (Exception ex) { return(dt); } finally { dbManager.Dispose(); dt.Dispose(); } }
public static Boolean delete(string DocumentRevisionDetailLogId) { IQISSDBManager dbManager = new QISSDBManager(); Boolean chk = false; try { dbManager.Open(); IDbDataParameter[] param = QISSDBManagerFactory.GetParameters(dbManager.ProviderType, 1); param[0] = dbManager.getparam("@DRDLId", DocumentRevisionDetailLogId.ToString()); IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "usp_document_revision_detail_log_delete", param); chk = dbManager.ExecuteQuery(cmd); } catch (Exception ex) { return(false); } finally { dbManager.Dispose(); } return(chk); }
//public static DataTable getbyid(string EquipId) //{ // IQISSDBManager dbManager = new QISSDBManager(); // DataTable dt = new DataTable(); // try // { // dbManager.Open(); // IDbDataParameter[] param = QISSDBManagerFactory.GetParameters(dbManager.ProviderType, 1); // param[0] = dbManager.getparam("@EquipId", EquipId.ToString().Trim()); // IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "sp_equipment_get", param); // dt = dbManager.GetDataTable(cmd); // return dt; // } // catch (Exception ex) // { // return dt; // } // finally // { // dt.Dispose(); // dbManager.Dispose(); // } //} //public static DataTable getAll(string EquipBranchId) //{ // string id = "ALL"; // IQISSDBManager dbManager = new QISSDBManager(); // DataTable dt = new DataTable(); // try // { // dbManager.Open(); // IDbDataParameter[] param = QISSDBManagerFactory.GetParameters(dbManager.ProviderType, 2); // param[0] = dbManager.getparam("@EquipId", id); // param[1] = dbManager.getparam("@EquipBranchId", EquipBranchId.ToString()); // IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "sp_equipment_get", param); // dt = dbManager.GetDataTable(cmd); // return dt; // } // catch (Exception ex) // { // return dt; // } // finally // { // dt.Dispose(); // dbManager.Dispose(); // } //} /// <summary> /// This menthod is used for add records in the DB table. /// </summary> /// <param name="objBOLNcrCategory"></param> /// <returns></returns> public static Boolean add(clsBOLCPARAction objBOLCPARAction) { //---START ADD--- IQISSDBManager dbManager = new QISSDBManager(); Boolean chk = false; try { dbManager.Open(); IDbDataParameter[] param = QISSDBManagerFactory.GetParameters(dbManager.ProviderType, 11); param[0] = dbManager.getparam("@CAId", objBOLCPARAction.CAId.ToString()); param[1] = dbManager.getparam("@CACIId", objBOLCPARAction.CACIId); param[2] = dbManager.getparam("@CAActionNo", objBOLCPARAction.CAActionNo); //param[3] = dbManager.getparam("@CAJobOrder", objBOLCPARAction.CAJobOrder); param[3] = dbManager.getparam("@CAStage", objBOLCPARAction.CAStage); //param[4] = dbManager.getparam("@CANoOfSteps", objBOLCPARAction.CANoOfSteps); param[4] = dbManager.getparam("@CAAssignedTo", objBOLCPARAction.CAAssignedTo.ToString()); param[5] = dbManager.getparam("@CADueDate", objBOLCPARAction.CADueDate.ToString()); param[6] = dbManager.getparam("@CAActionType", objBOLCPARAction.CAActionType); param[7] = dbManager.getparam("@CAFirstComment", objBOLCPARAction.CAFirstComment.ToString()); param[8] = dbManager.getparam("@CASecondComment", string.IsNullOrEmpty(objBOLCPARAction.CASecondComment.ToString()) ? string.Empty : objBOLCPARAction.CASecondComment.ToString()); param[9] = dbManager.getparam("@CAReportFile", string.IsNullOrEmpty(objBOLCPARAction.CAReportFile.ToString()) ? string.Empty : objBOLCPARAction.CAReportFile.ToString()); param[10] = dbManager.getparam("@CADateAction", objBOLCPARAction.CADateAction.ToString()); IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "usp_CPAR_Action_add", param); chk = dbManager.ExecuteQuery(cmd); } catch (Exception ex) { return(false); } finally { dbManager.Dispose(); } return(chk); } //---END ADD---
public static Boolean update(clsBOLDocumentRevisionDetail objBOLDocumentRevisionDetail) { IQISSDBManager dbManager = new QISSDBManager(); bool chk = false; try { dbManager.Open(); IDbDataParameter[] param = QISSDBManagerFactory.GetParameters(dbManager.ProviderType, 15); param[0] = dbManager.getparam("@DRDLId", objBOLDocumentRevisionDetailLog.DRDLId); param[1] = dbManager.getparam("@DRDId", objBOLDocumentRevisionDetailLog.DRDId); param[2] = dbManager.getparam("@DRDTitle", objBOLDocumentRevisionDetailLog.DRDTitle); param[3] = dbManager.getparam("@DRDDDId", objBOLDocumentRevisionDetailLog.DRDDDId); param[4] = dbManager.getparam("@DRDRevisionNo", objBOLDocumentRevisionDetailLog.DRDRevisionNo); param[5] = dbManager.getparam("@DRDManualRevisionNo", objBOLDocumentRevisionDetailLog.DRDManualRevisionNo); param[6] = dbManager.getparam("@DRDSecChange", objBOLDocumentRevisionDetailLog.DRDSecChange); param[7] = dbManager.getparam("@DRDChangeMade", objBOLDocumentRevisionDetailLog.DRDChangeMade); param[8] = dbManager.getparam("@DRDFinallyAprvFileName", objBOLDocumentRevisionDetailLog.DRDFinallyAprvFileName); if (objBOLDocumentRevisionDetailLog.DRDIsApproved == clsBOLDocumentRevisionDetailLog.IsApproved.none) { param[9] = dbManager.getparam("@DRDIsApproved", '0'); } else if (objBOLDocumentRevisionDetailLog.DRDIsApproved == clsBOLDocumentRevisionDetailLog.IsApproved.approved) { param[9] = dbManager.getparam("@DRDIsApproved", '1'); } else if (objBOLDocumentRevisionDetailLog.DRDIsApproved == clsBOLDocumentRevisionDetailLog.IsApproved.disapproved) { param[9] = dbManager.getparam("@DRDIsApproved", '2'); } else if (objBOLDocumentRevisionDetailLog.DRDIsApproved == clsBOLDocumentRevisionDetailLog.IsApproved.aborted) { param[9] = dbManager.getparam("@DRDIsApproved", '3'); } else if (objBOLDocumentRevisionDetailLog.DRDIsApproved == clsBOLDocumentRevisionDetailLog.IsApproved.obsoleted) { param[9] = dbManager.getparam("@DRDIsApproved", '4'); } param[10] = dbManager.getparam("@DRDCreationDate", objBOLDocumentRevisionDetailLog.DRDCreationDate); param[11] = dbManager.getparam("@DRDApprovalDate", objBOLDocumentRevisionDetailLog.DRDApprovalDate); param[12] = dbManager.getparam("@DRDChangedBy", objBOLDocumentRevisionDetailLog.DRDChangedBy); param[13] = dbManager.getparam("@DRDDisApproveReason", objBOLDocumentRevisionDetailLog.DRDDisApproveResion); param[14] = dbManager.getparam("@DRDDueDate", objBOLDocumentRevisionDetailLog.DRDDueDate); IDbCommand cmd = dbManager.getCommand(CommandType.StoredProcedure, "usp_document_revision_detail_log_update", param); chk = dbManager.ExecuteQuery(cmd); } catch (Exception ex) { return(false); } finally { dbManager.Dispose(); } return(chk); }