Exemple #1
0
        //=========================
        // Saves data related to Report Details section of the Report Request Details

        public void saveDetailRepReqData(DetailsReportRequest_Model DetRepReqDataIn, ref string feedbackMssg)
        {
            feedbackMssg = "2";

            DBOps dbManager_sD = new DBOps();

            List <OracleParameter> Params_sD = new List <OracleParameter>()
            {
                new OracleParameter("p_report_desc", OracleDbType.Varchar2, 8000, (string)DetRepReqDataIn.ReportDescription, ParameterDirection.Input),
                new OracleParameter("p_created_by_nm", OracleDbType.Varchar2, 120, (string)DetRepReqDataIn.User_NM, ParameterDirection.Input),
                new OracleParameter("p_foia", OracleDbType.Varchar2, 4, (string)DetRepReqDataIn.FOIA_yes, ParameterDirection.Input),
                new OracleParameter("p_user_report_loc", OracleDbType.Varchar2, 400, (string)DetRepReqDataIn.UserReportLocation, ParameterDirection.Input),

                new OracleParameter("p_report_name", OracleDbType.Varchar2, 200, (string)DetRepReqDataIn.ReportName, ParameterDirection.Input),
                new OracleParameter("p_report_type_id", OracleDbType.Varchar2, 80, (string)DetRepReqDataIn.ReportType, ParameterDirection.Input),            // left as is since Stored Procedure signature and report type doesn't change
                new OracleParameter("p_request_id", OracleDbType.Int64, int.Parse(DetRepReqDataIn.RequestID), ParameterDirection.Input)
            };

            try
            {
                dbManager_sD.ExecSPNonQuery("APP1.APP1_SEND_REQUEST_API.ins_report", Params_sD);
            }
            catch (Exception ex)
            {
                feedbackMssg = "Error associated with the database while saving Requested Report Details, please contact your administrator";
                throw new CustomExceptions.CustomException(ex.Message + " " + ex.StackTrace);

                //string exceptionEmailText = "Error Saving Report Details using APP1.APP1_SEND_REQUEST_API.ins_report, error: " + ex.Message;
                //sendExceptionEmail(exceptionEmailText);
            }
        }
Exemple #2
0
        //=========================
        // Saves data related to Admin Related Details section of the Report Request Details

        public void updateAdmin(DetailsReportRequest_Model DetRepReqDataIn, ref string feedbackMssg)
            #region Saving Details
        {
            feedbackMssg = "1";

            string nullValidator = string.IsNullOrEmpty(DetRepReqDataIn.UpdateECTDays) ? "0" : DetRepReqDataIn.UpdateECTDays;

            DetRepReqDataIn.UpdateECTDays = nullValidator;
            nullValidator = string.IsNullOrEmpty(DetRepReqDataIn.UpdateECTHours) ? "0" : DetRepReqDataIn.UpdateECTHours;
            DetRepReqDataIn.UpdateECTHours = nullValidator;

            DBOps dbManager_sARD = new DBOps();

            List <OracleParameter> Params_sARD = new List <OracleParameter>()
            {
                new OracleParameter("p_id", OracleDbType.Varchar2, (string)DetRepReqDataIn.RequestID, ParameterDirection.Input),
                new OracleParameter("p_staff_priority", OracleDbType.Varchar2, (string)DetRepReqDataIn.StaffPriorityLevel, ParameterDirection.Input),
                new OracleParameter("p_staff_id", OracleDbType.Varchar2, (string)DetRepReqDataIn.ReportStaff, ParameterDirection.Input),
                new OracleParameter("p_status_id", OracleDbType.Varchar2, (string)DetRepReqDataIn.AdminStatus, ParameterDirection.Input),

                new OracleParameter("p_est_day", OracleDbType.Int64, int.Parse(DetRepReqDataIn.UpdateECTDays), ParameterDirection.Input),
                new OracleParameter("p_est_hr", OracleDbType.Int64, int.Parse(DetRepReqDataIn.UpdateECTHours), ParameterDirection.Input),
                //new OracleParameter("p_est_comp_time",  OracleDbType.Varchar2, (string)DetRepReqDataIn.EstimCompletionTime  ,ParameterDirection.Input),
                new OracleParameter("p_staff_comments", OracleDbType.Varchar2, (string)DetRepReqDataIn.StaffComments, ParameterDirection.Input),
                new OracleParameter("p_notes_to_user", OracleDbType.Varchar2, (string)DetRepReqDataIn.NotesToRequester, ParameterDirection.Input),
                new OracleParameter("p_modified_by", OracleDbType.Varchar2, (string)DetRepReqDataIn.UserID, ParameterDirection.Input)

                //new OracleParameter("p_output",         OracleDbType.RefCursor,ParameterDirection.Output)
            };

            try
            {
                //using (OracleDataReader dr = dbManager_sARD.ExecSP("APP1.APP1_SEND_REQUEST_API.upd_admin_section", Params_sARD));
                dbManager_sARD.ExecSPNonQuery("APP1.APP1_SEND_REQUEST_API.upd_admin_section", Params_sARD);
            }
            catch (Exception ex)
            {
                feedbackMssg = "Error associated with the database while saving Requested Report Details, please contact your administrator";
                throw new CustomExceptions.CustomException(ex.Message + " " + ex.StackTrace);

                //string exceptionEmailText = "Error retrieving User's APP1.APP1_SEND_REQUEST_API.upd_admin_section, error: " + ex.Message;
                //sendExceptionEmail(exceptionEmailText);
            }
        }