Example #1
0
        public ExceptionTypes SetCurrentBatchStatus(out string errorMessage)
        {
            try
            {
                DAHelper dah     = new DAHelper();
                DataSet  dsTable = new DataSet();
                errorMessage = string.Empty;

                long executionResult = 0;

                executionResult = dah.ExecuteScalar(ConstantTexts.Query_Update_MQTRRBatchStatus, new List <SqlParameter>().ToArray(), out object obj, out string erorrMessage);

                if (executionResult == 0)
                {
                    return(ExceptionTypes.Success);
                }
                else
                {
                    return(ExceptionTypes.UnknownError);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error : " + ex.Message);
                errorMessage = ex.Message;
                return(ExceptionTypes.UnknownError);
            }
        }
Example #2
0
        public ExceptionTypes CheckValidRecordCount(long BulkImportID, out string errorMessage)
        {
            try
            {
                DAHelper dah           = new DAHelper();
                long     lErrocode     = 0;
                long     lErrorNumber  = 0;
                long     lRowsEffected = 0;
                DataSet  dsTable       = new DataSet();
                errorMessage = string.Empty;

                List <SqlParameter> parameters = new List <SqlParameter>();
                SqlParameter        sqlParam;

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@GEN_FDRBulkImportId";
                sqlParam.SqlDbType     = SqlDbType.BigInt;
                sqlParam.Value         = BulkImportID;
                parameters.Add(sqlParam);
                sqlParam = new SqlParameter();

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@ImportStatusLkup";
                sqlParam.SqlDbType     = SqlDbType.BigInt;
                sqlParam.Value         = (long)ImportStatus.ImportSuccessful;
                parameters.Add(sqlParam);
                sqlParam = new SqlParameter();


                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@ErrorMessage";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = string.Empty;
                sqlParam.Direction     = ParameterDirection.Output;
                sqlParam.Size          = 2000;
                parameters.Add(sqlParam);

                long executionResult = 0;
                executionResult = executionResult = dah.ExecuteDMLSP(ConstantTexts.SP_USP_BGP_UPD_FDRTotalRecordsCount, parameters.ToArray(), out lErrocode, out lErrorNumber, out lRowsEffected, out errorMessage);
                sqlParam        = parameters.FirstOrDefault(x => x.ParameterName == "@ErrorMessage");
                if (sqlParam != null && sqlParam.Value != null)
                {
                    errorMessage += sqlParam.Value.ToString();
                }
                if (executionResult == (long)ExceptionTypes.Success && string.IsNullOrEmpty(errorMessage))
                {
                    return(ExceptionTypes.Success);
                }
                else
                {
                    return(ExceptionTypes.UnknownError);
                }
            }
            catch (Exception ex)
            {
                errorMessage = ex.Message;
                return(ExceptionTypes.UnknownError);
            }
        }
Example #3
0
        public ExceptionTypes CheckDuplicateDep(long?TimeZone, DOCMN_Department objDOCMN_Department, out List <DOCMN_Department> lstDOCMN_Department, out string errorMessage)
        {
            lstDOCMN_Department = new List <DOCMN_Department>();
            errorMessage        = string.Empty;
            try
            {
                DAHelper dah          = new DAHelper();
                long     lErrocode    = 0;
                long     lErrorNumber = 0;
                DataSet  dsResultData = new DataSet();

                List <SqlParameter> parameters = new List <SqlParameter>();
                SqlParameter        sqlParam;

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@BusinessSegmentLkup";
                sqlParam.SqlDbType     = SqlDbType.BigInt;
                sqlParam.Value         = objDOCMN_Department.BusinessSegmentLkup;
                parameters.Add(sqlParam);

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@DepartmentLkup";
                sqlParam.SqlDbType     = SqlDbType.BigInt;
                sqlParam.Value         = objDOCMN_Department.DepartmentLkup;
                parameters.Add(sqlParam);

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@ErrorMessage";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = string.Empty;
                sqlParam.Direction     = ParameterDirection.Output;
                sqlParam.Size          = 2000;
                parameters.Add(sqlParam);

                long executionResult = dah.ExecuteSelectSP(ConstantTexts.SP_USP_APP_SEL_Department, parameters.ToArray(), out dsResultData, out lErrocode, out lErrorNumber, out errorMessage);
                if (executionResult == 0)
                {
                    if (dsResultData.Tables.Count > 0 && dsResultData.Tables[0].Rows.Count > 0)
                    {
                        MapDepartmentDetails(TimeZone, dsResultData.Tables[0], out lstDOCMN_Department);
                        return(ExceptionTypes.Success);
                    }
                    else
                    {
                        return(ExceptionTypes.ZeroRecords);
                    }
                }
                else
                {
                    return(ExceptionTypes.UnknownError);
                }
            }
            catch (Exception ex)
            {
                errorMessage = ex.Message;
                return(ExceptionTypes.UnknownError);
            }
        }
Example #4
0
        public ExceptionTypes SearchCOnfigurationID(long?TimeZone, DOMGR_ConfigMaster configMaster, out List <DOMGR_ConfigMaster> lstDOMGR_ConfigMaster, out string errorMessage)
        {
            lstDOMGR_ConfigMaster = new List <DOMGR_ConfigMaster>();
            errorMessage          = string.Empty;
            try
            {
                DAHelper dah          = new DAHelper();
                long     lErrocode    = 0;
                long     lErrorNumber = 0;
                DataSet  dsResultData = new DataSet();

                List <SqlParameter> parameters = new List <SqlParameter>();
                SqlParameter        sqlParam;

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@MGR_ConfigMasterId";
                sqlParam.SqlDbType     = SqlDbType.BigInt;
                sqlParam.Value         = configMaster.MGR_ConfigMasterId;
                parameters.Add(sqlParam);

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@IsActive";
                sqlParam.SqlDbType     = SqlDbType.Bit;
                sqlParam.Value         = configMaster.IsActive;
                parameters.Add(sqlParam);

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@ErrorMessage";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = string.Empty;
                sqlParam.Direction     = ParameterDirection.Output;
                sqlParam.Size          = 2000;
                parameters.Add(sqlParam);

                long executionResult = dah.ExecuteSelectSP(ConstantTexts.USP_APP_SEL_ConfigMaster, parameters.ToArray(), out dsResultData, out lErrocode, out lErrorNumber, out errorMessage);
                if (executionResult == 0)
                {
                    if (dsResultData.Tables.Count > 0 && dsResultData.Tables[0].Rows.Count > 0)
                    {
                        MapConfigMstDetails(TimeZone, dsResultData.Tables[0], out lstDOMGR_ConfigMaster);
                        return(ExceptionTypes.Success);
                    }
                    else
                    {
                        return(ExceptionTypes.ZeroRecords);
                    }
                }
                else
                {
                    return(ExceptionTypes.UnknownError);
                }
            }
            catch (Exception ex)
            {
                errorMessage = ex.Message;
                return(ExceptionTypes.UnknownError);
            }
        }
Example #5
0
        public ExceptionTypes GetAccessGroupForEdit(DOADM_AccessGroupMaster objDOADM_AccessGroupMaster, out UIDOAccessGroup objUIDOAccessGroup)
        {
            objUIDOAccessGroup = new UIDOAccessGroup();
            try
            {
                DAHelper dah          = new DAHelper();
                long     lErrocode    = 0;
                long     lErrorNumber = 0;
                DataSet  dsTable      = new DataSet();
                string   errorMessage;

                List <SqlParameter> parameters = new List <SqlParameter>();
                SqlParameter        sqlParam;

                if (objDOADM_AccessGroupMaster.ADM_AccessGroupMasterId > 0)
                {
                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@AccessGroupMasterId";
                    sqlParam.SqlDbType     = SqlDbType.BigInt;
                    sqlParam.Value         = objDOADM_AccessGroupMaster.ADM_AccessGroupMasterId;
                    parameters.Add(sqlParam);
                }

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@ErrorMessage";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = string.Empty;
                sqlParam.Direction     = ParameterDirection.Output;
                sqlParam.Size          = 2000;
                parameters.Add(sqlParam);

                long executionResult = dah.ExecuteSelectSP(ConstantTexts.SP_USP_APP_SEL_AccesssGroup, parameters.ToArray(), out dsTable, out lErrocode, out lErrorNumber, out errorMessage);
                if (executionResult == 0)
                {
                    if (dsTable.Tables.Count > 0 && dsTable.Tables[0].Rows.Count > 0)
                    {
                        MapUIDOAccessGroupObjectProperties(dsTable, out objUIDOAccessGroup);
                        if (objUIDOAccessGroup != null)
                        {
                            return(ExceptionTypes.Success);
                        }
                    }
                    return(ExceptionTypes.ZeroRecords);
                }
                else if (executionResult == 2)
                {
                    return(ExceptionTypes.ZeroRecords);
                }
                else
                {
                    return(ExceptionTypes.UnknownError);
                }
            }
            catch (Exception ex)
            {
                return(ExceptionTypes.UnknownError);
            }
        }
Example #6
0
        public ExceptionTypes GetAllLookups(long?lookupTypeId, out List <DOCMN_LookupType> lstLookupType, out List <DOCMN_LookupMaster> lstLookupMaster) //out List<DOCMN_LookupMaster> lstDOCMN_LookupMaster)
        {
            lstLookupType   = new List <DOCMN_LookupType>();
            lstLookupMaster = new List <DOCMN_LookupMaster>();

            try
            {
                DAHelper dah          = new DAHelper();
                long     lErrocode    = 0;
                long     lErrorNumber = 0;
                _dsResult = new DataSet();
                string errorMessage;

                _lstParameters = new List <SqlParameter>();
                SqlParameter sqlParam;

                if (lookupTypeId != null && lookupTypeId > 0)
                {
                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@CMN_LookupTypeId";
                    sqlParam.SqlDbType     = SqlDbType.VarChar;
                    sqlParam.Value         = lookupTypeId;
                    _lstParameters.Add(sqlParam);
                }

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@ErrorMessage";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = string.Empty;
                sqlParam.Direction     = ParameterDirection.Output;
                sqlParam.Size          = 2000;
                _lstParameters.Add(sqlParam);

                long executionResult = dah.ExecuteSelectSP(ConstantTexts.SP_APP_SEL_Lookups, _lstParameters.ToArray(), out _dsResult, out lErrocode, out lErrorNumber, out errorMessage);
                if (executionResult == 0)
                {
                    if (_dsResult.Tables.Count > 0 && _dsResult.Tables[1].Rows.Count > 0)
                    {
                        MapAllLookups(_dsResult, out lstLookupType, out lstLookupMaster);
                        return(ExceptionTypes.Success);
                    }
                    else
                    {
                        return(ExceptionTypes.ZeroRecords);
                    }
                }
                else
                {
                    return(ExceptionTypes.UnknownError);
                }
            }
            catch
            {
                //need log
                return(ExceptionTypes.UnknownError);
            }
        }
Example #7
0
        /// <summary>
        /// Method to update the cases for TRC155 Macro
        /// </summary>
        /// <param name="objDOMacroUpdate"></param>
        /// <param name="userid"></param>
        /// <returns></returns>
        public ExceptionTypes UpdateCaseForTRC155Macro(DOMacroUpdate objDOMacroUpdate, long userid, out string errormessage)
        {
            DAHelper dah          = new DAHelper();
            long     lErrocode    = 0;
            long     lErrorNumber = 0;

            errormessage = string.Empty;
            SqlParameter        sqlParam       = new SqlParameter();
            List <SqlParameter> _lstParameters = new List <SqlParameter>();

            //call function to map object properties to SQL parameters for query execution

            sqlParam = new SqlParameter();
            sqlParam.ParameterName = "@GEN_QueueId";
            sqlParam.SqlDbType     = SqlDbType.BigInt;
            sqlParam.Value         = objDOMacroUpdate.GEN_QueueId;
            _lstParameters.Add(sqlParam);

            sqlParam = new SqlParameter();
            sqlParam.ParameterName = "@Status";
            sqlParam.SqlDbType     = SqlDbType.VarChar;
            sqlParam.Value         = objDOMacroUpdate.Status;
            _lstParameters.Add(sqlParam);

            //sqlParam = new SqlParameter();
            //sqlParam.ParameterName = "@CurrentUser";
            //sqlParam.SqlDbType = SqlDbType.VarChar;
            //sqlParam.Value = objDOMacroUpdate.LoginID;
            //_lstParameters.Add(sqlParam);

            sqlParam = new SqlParameter();
            sqlParam.ParameterName = "@ErrorMessage";
            sqlParam.SqlDbType     = SqlDbType.VarChar;
            sqlParam.Value         = string.Empty;
            sqlParam.Direction     = ParameterDirection.Output;
            sqlParam.Size          = 2000;
            _lstParameters.Add(sqlParam);

            long executionResult = dah.ExecuteDMLSP(ConstantTexts.SP_UPD_TRC155_Macro, _lstParameters.ToArray(), out lErrocode, out lErrorNumber, out long lRowsEffected, out string errorMessage);

            sqlParam = _lstParameters.FirstOrDefault(x => x.ParameterName == "@ErrorMessage");
            if (sqlParam != null && sqlParam.Value != null)
            {
                errormessage += sqlParam.Value.ToString();
            }
            if (executionResult == (long)ExceptionTypes.Success && string.IsNullOrEmpty(errorMessage))
            {
                return(ExceptionTypes.Success);
            }
            else
            {
                return(ExceptionTypes.UnknownError);
            }
        }
Example #8
0
        public ExceptionTypes UpdateOOAMIIMComments(List <DOMIIMOOACommentUpdate> lstDOMIIMOOACommentUpdate, long userid)
        {
            DAHelper            dah            = new DAHelper();
            long                lErrocode      = 0;
            long                lErrorNumber   = 0;
            SqlParameter        sqlParam       = new SqlParameter();
            List <SqlParameter> _lstParameters = new List <SqlParameter>();

            //call function to map object properties to SQL parameters for query execution
            if (lstDOMIIMOOACommentUpdate.Count() > 0)
            {
                DataSet ds = new DataSet("tbl_Comments");
                ds.Tables.Add(lstDOMIIMOOACommentUpdate.Where(x => x.ERSCaseId != 0).ToList().ToDataTable());
                string xmlData = ds.GetXml();

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@XMLComments";
                sqlParam.SqlDbType     = SqlDbType.NVarChar;
                sqlParam.Value         = xmlData;
                _lstParameters.Add(sqlParam);
            }

            sqlParam = new SqlParameter();
            sqlParam.ParameterName = "@LoginUserId";
            sqlParam.SqlDbType     = SqlDbType.BigInt;
            sqlParam.Value         = userid;
            _lstParameters.Add(sqlParam);

            sqlParam = new SqlParameter();
            sqlParam.ParameterName = "@ErrorMessage";
            sqlParam.SqlDbType     = SqlDbType.VarChar;
            sqlParam.Value         = string.Empty;
            sqlParam.Direction     = ParameterDirection.Output;
            sqlParam.Size          = 2000;
            _lstParameters.Add(sqlParam);

            long executionResult = dah.ExecuteDMLSP(ConstantTexts.SP_APP_UPD_UpdateOOAComments, _lstParameters.ToArray(), out lErrocode, out lErrorNumber, out long lRowsEffected, out string errorMessage);

            sqlParam = _lstParameters.FirstOrDefault(x => x.ParameterName == "@ErrorMessage");
            if (sqlParam != null && sqlParam.Value != null)
            {
                errorMessage += sqlParam.Value.ToString();
            }
            if (executionResult == (long)ExceptionTypes.Success && string.IsNullOrEmpty(errorMessage))
            {
                return(ExceptionTypes.Success);
            }
            else
            {
                return(ExceptionTypes.UnknownError);
            }
        }
Example #9
0
        public ExceptionTypes GetIncludeInTodaysSubmission(out List <IncludeInTodaysSubmission> lstIncludeInTodaysSubmission, out string errorMessage)
        {
            DAHelper dah           = new DAHelper();
            long     lErrocode     = 0;
            long     lErrorNumber  = 0;
            long     lRowsEffected = 0;
            DataSet  dsTable       = new DataSet();

            errorMessage = string.Empty;
            lstIncludeInTodaysSubmission = new List <IncludeInTodaysSubmission>();
            errorMessage = string.Empty;

            List <SqlParameter> parameters = new List <SqlParameter>();
            SqlParameter        sqlParam;

            try
            {
                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@ErrorMessage";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = string.Empty;
                sqlParam.Direction     = ParameterDirection.Output;
                sqlParam.Size          = 2000;
                parameters.Add(sqlParam);

                long executionResult = 0;
                executionResult = executionResult = dah.ExecuteDMLSP(ConstantTexts.SP_BGP_SEL_IncludeInTodaysSubmission, parameters.ToArray(), out lErrocode, out lErrorNumber, out lRowsEffected, out errorMessage);
                sqlParam        = parameters.FirstOrDefault(x => x.ParameterName == "@ErrorMessage");
                if (sqlParam != null && sqlParam.Value != null)
                {
                    errorMessage += sqlParam.Value.ToString();
                }
                if (executionResult == (long)ExceptionTypes.Success && string.IsNullOrEmpty(errorMessage))
                {
                    return(ExceptionTypes.Success);
                }
                else
                {
                    return(ExceptionTypes.UnknownError);
                }
            }
            catch (Exception ex)
            {
                errorMessage = ex.Message;
                return(ExceptionTypes.UnknownError);
            }
        }
Example #10
0
        public ExceptionTypes SearchResources(long?TimeZone, DOADM_ResourceDetails objDOADM_ResourceDetails, out List <DOADM_ResourceDetails> lstDOADM_ResourceDetails, out string errorMessage)
        {
            lstDOADM_ResourceDetails = new List <DOADM_ResourceDetails>();
            errorMessage             = string.Empty;
            try
            {
                DAHelper dah          = new DAHelper();
                long     lErrocode    = 0;
                long     lErrorNumber = 0;
                DataSet  dsResultData = new DataSet();

                List <SqlParameter> parameters = new List <SqlParameter>();

                //call function to map object properties to SQL parameters for query execution
                parameters = MapResourceDetailsResourceDO(objDOADM_ResourceDetails);
                //Is it required
                SqlParameter sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@ConsiderDates";
                sqlParam.SqlDbType     = SqlDbType.Bit;
                sqlParam.Value         = objDOADM_ResourceDetails.ConsiderDates;
                parameters.Add(sqlParam);

                long executionResult = dah.ExecuteSelectSP(ConstantTexts.SP_USP_ERS_APP_SEL_ResourceDetails, parameters.ToArray(), out dsResultData, out lErrocode, out lErrorNumber, out errorMessage);
                if (executionResult == 0)
                {
                    if (dsResultData.Tables.Count > 0 && dsResultData.Tables[0].Rows.Count > 0)
                    {
                        //call function to map dataset result to object properties
                        MapResourceDOResourceDetails(TimeZone, dsResultData.Tables[0], out lstDOADM_ResourceDetails);
                        return(ExceptionTypes.Success);
                    }
                    else
                    {
                        return(ExceptionTypes.ZeroRecords);
                    }
                }
                else
                {
                    return(ExceptionTypes.UnknownError);
                }
            }
            catch (Exception ex)
            {
                errorMessage = ex.Message;
                return(ExceptionTypes.UnknownError);
            }
        }
Example #11
0
        public ExceptionTypes GetMIIMQueueDetailsByHICN(string MemberHICN, out List <DOMIIMGetQueue> Queues)
        {
            List <DOMIIMGetQueue> lstDOMIIMGetQueue = new List <DOMIIMGetQueue>();
            string errorMessage = string.Empty;

            Queues = new List <DOMIIMGetQueue>();
            DataSet dsResultData = new DataSet();

            try
            {
                DAHelper dah          = new DAHelper();
                long     lErrocode    = 0;
                long     lErrorNumber = 0;

                List <SqlParameter> parameters = new List <SqlParameter>();

                //call function to map object properties to SQL parameters for query execution
                SqlParameter sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@HICN";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = MemberHICN;
                parameters.Add(sqlParam);

                long executionResult = dah.ExecuteSelectSP(ConstantTexts.SP_APP_SEL_GetQueueDetailsByHICN, parameters.ToArray(), out dsResultData, out lErrocode, out lErrorNumber, out errorMessage);
                if (executionResult == 0)
                {
                    if (dsResultData.Tables.Count > 0 && dsResultData.Tables[0].Rows.Count > 0)
                    {
                        MappingDatasetToObject(dsResultData, out Queues);
                        return(ExceptionTypes.Success);
                    }
                    else
                    {
                        return(ExceptionTypes.ZeroRecords);
                    }
                }
                else
                {
                    return(ExceptionTypes.UnknownError);
                }
            }
            catch (Exception ex)
            {
                errorMessage = ex.Message;
                return(ExceptionTypes.UnknownError);
            }
        }
Example #12
0
        public ExceptionTypes SaveAlert(DOADM_AlertDetails objDOADM_AlertDetails, out string errorMessage)
        {
            errorMessage = string.Empty;
            try
            {
                DAHelper dah          = new DAHelper();
                long     lErrocode    = 0;
                long     lErrorNumber = 0;

                List <SqlParameter> parameters = new List <SqlParameter>();

                //call function to map object properties to SQL parameters for query execution
                parameters = MapAlertDetailsAlertDO(objDOADM_AlertDetails);

                //Extra parameter when adding or editing record for releasing lock
                //not needed when searching records
                SqlParameter sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@ScreenLkup";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = (long)ScreenType.Alerts;
                parameters.Add(sqlParam);


                long executionResult = dah.ExecuteDMLSP(ConstantTexts.USP_APP_INS_UPD_AlertsDetails, parameters.ToArray(), out lErrocode, out lErrocode, out lErrorNumber, out errorMessage);
                if (executionResult == 0)
                {
                    return(ExceptionTypes.Success);
                }
                else
                {
                    return(ExceptionTypes.UnknownError);
                }
            }
            catch (Exception ex)
            {
                errorMessage = ex.Message;
                return(ExceptionTypes.UnknownError);
            }
        }
Example #13
0
        public ExceptionTypes GetCaseDiscrepancyCategory(long lQueueID, out long lDiscrepancyCategory, out string errorMessage)
        {
            DAHelper dah = new DAHelper();

            errorMessage = string.Empty;

            List <SqlParameter> parameters = new List <SqlParameter>();

            //call function to map object properties to SQL parameters for query execution
            SqlParameter sqlParam = new SqlParameter();

            sqlParam.ParameterName = "@lQueueID";
            sqlParam.SqlDbType     = SqlDbType.VarChar;
            sqlParam.Value         = lQueueID;
            parameters.Add(sqlParam);

            string query           = "Select DiscrepancyCategoryLkup from Gen_Queue where Gen_QueueId=@lQueueID";
            long   executionResult = dah.ExecuteScalar(query, parameters.ToArray(), out object DiscrepancyCategoryLkup, out string erorrMessage);

            lDiscrepancyCategory = (!DiscrepancyCategoryLkup.IsNull()) ? DiscrepancyCategoryLkup.ToInt64() : 0;
            return((ExceptionTypes)executionResult);
        }
Example #14
0
        public ExceptionTypes GetQueueIdFromMIIMRefernceId(string strMIIMReferenceId, out string strErsCaseId, out string errorMessage)
        {
            DAHelper dah = new DAHelper();

            errorMessage = string.Empty;
            strErsCaseId = string.Empty;

            List <SqlParameter> parameters = new List <SqlParameter>();

            //call function to map object properties to SQL parameters for query execution
            SqlParameter sqlParam = new SqlParameter();

            sqlParam.ParameterName = "@strMIIMReferenceId";
            sqlParam.SqlDbType     = SqlDbType.VarChar;
            sqlParam.Value         = strMIIMReferenceId;
            parameters.Add(sqlParam);

            string query           = "Select GEN_QueueId from Gen_Queue where MIIMReferenceId = @strMIIMReferenceId";
            long   executionResult = dah.ExecuteSQL(query, parameters.ToArray(), out DataSet GEN_QueueIds, out string erorrMessage, true);

            strErsCaseId = (!GEN_QueueIds.IsNull()) ? String.Join(",", GEN_QueueIds.Tables[0].AsEnumerable().Select(x => x.Field <Int64>("GEN_QueueId").ToString()).ToArray()) : string.Empty;
            return((ExceptionTypes)executionResult);
        }
Example #15
0
        public ExceptionTypes InsertFDRBulkImport(DOGEN_FDR objDOGEN_FDR, out string errorMessage)
        {
            try
            {
                DAHelper dah           = new DAHelper();
                long     lErrocode     = 0;
                long     lErrorNumber  = 0;
                long     lRowsEffected = 0;
                DataSet  dsTable       = new DataSet();
                errorMessage = string.Empty;

                List <SqlParameter> parameters = new List <SqlParameter>();
                SqlParameter        sqlParam;

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@SubmissionId";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = objDOGEN_FDR.SubmissionID;
                parameters.Add(sqlParam);
                sqlParam = new SqlParameter();

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@ContractNumber";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = objDOGEN_FDR.ContractNumber;
                parameters.Add(sqlParam);
                sqlParam = new SqlParameter();


                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@TransactionType";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = objDOGEN_FDR.TransactionTypeLValue;
                parameters.Add(sqlParam);
                sqlParam = new SqlParameter();

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@ExcelFileName";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = objDOGEN_FDR.ExcelFileName;
                parameters.Add(sqlParam);
                sqlParam = new SqlParameter();

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@ExcelFilePath";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = objDOGEN_FDR.ExcelFilePath;
                parameters.Add(sqlParam);
                sqlParam = new SqlParameter();

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@ImportStatusLkup";
                sqlParam.SqlDbType     = SqlDbType.BigInt;
                sqlParam.Value         = (long)ImportStatus.ReadyForImport;
                parameters.Add(sqlParam);
                sqlParam = new SqlParameter();

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@ErrorMessage";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = string.Empty;
                sqlParam.Direction     = ParameterDirection.Output;
                sqlParam.Size          = 2000;
                parameters.Add(sqlParam);

                long executionResult = 0;
                executionResult = executionResult = dah.ExecuteDMLSP(ConstantTexts.SP_USP_BGP_INS_FDR_BulkImport, parameters.ToArray(), out lErrocode, out lErrorNumber, out lRowsEffected, out errorMessage);
                sqlParam        = parameters.FirstOrDefault(x => x.ParameterName == "@ErrorMessage");
                if (sqlParam != null && sqlParam.Value != null)
                {
                    errorMessage += sqlParam.Value.ToString();
                }
                if (executionResult == (long)ExceptionTypes.Success && string.IsNullOrEmpty(errorMessage))
                {
                    return(ExceptionTypes.Success);
                }
                else
                {
                    return(ExceptionTypes.UnknownError);
                }
            }
            catch (Exception ex)
            {
                errorMessage = ex.Message;
                return(ExceptionTypes.UnknownError);
            }
        }
Example #16
0
        // Save Configuration Master
        public ExceptionTypes SaveConfigMaster(DOMGR_ConfigMaster objDOMGR_ConfigMaster, out string errorMessage)
        {
            try
            {
                DAHelper dah           = new DAHelper();
                long     lErrocode     = 0;
                long     lErrorNumber  = 0;
                long     lRowsEffected = 0;
                DataSet  dsTable       = new DataSet();
                errorMessage = string.Empty;

                List <SqlParameter> parameters = new List <SqlParameter>();
                SqlParameter        sqlParam;

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@ConfigId";
                sqlParam.SqlDbType     = SqlDbType.BigInt;
                sqlParam.Value         = objDOMGR_ConfigMaster.MGR_ConfigMasterId;
                parameters.Add(sqlParam);

                if (!string.IsNullOrEmpty(objDOMGR_ConfigMaster.ConfigName))
                {
                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@ConfigName";
                    sqlParam.SqlDbType     = SqlDbType.VarChar;
                    sqlParam.Value         = objDOMGR_ConfigMaster.ConfigName;
                    parameters.Add(sqlParam);
                }
                if (!string.IsNullOrEmpty(objDOMGR_ConfigMaster.ConfigValue))
                {
                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@ConfigValue";
                    sqlParam.SqlDbType     = SqlDbType.VarChar;
                    sqlParam.Value         = objDOMGR_ConfigMaster.ConfigValue;
                    parameters.Add(sqlParam);
                }
                if (objDOMGR_ConfigMaster.StartDate != null)
                {
                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@StartDate";
                    sqlParam.SqlDbType     = SqlDbType.DateTime;
                    sqlParam.Value         = objDOMGR_ConfigMaster.StartDate;
                    parameters.Add(sqlParam);
                }
                if (objDOMGR_ConfigMaster.EndDate != null)
                {
                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@EndDate";
                    sqlParam.SqlDbType     = SqlDbType.DateTime;
                    sqlParam.Value         = objDOMGR_ConfigMaster.EndDate;
                    parameters.Add(sqlParam);
                }

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@IsActive";
                sqlParam.SqlDbType     = SqlDbType.Bit;
                sqlParam.Value         = objDOMGR_ConfigMaster.IsActive;
                parameters.Add(sqlParam);

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@LoginUserId";
                sqlParam.SqlDbType     = SqlDbType.BigInt;
                sqlParam.Value         = objDOMGR_ConfigMaster.CreatedByRef;
                parameters.Add(sqlParam);

                //Extra parameter when adding or editing record for releasing lock
                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@ScreenLkup";
                sqlParam.SqlDbType     = SqlDbType.BigInt;
                sqlParam.Value         = (long)ScreenType.Configuration;
                parameters.Add(sqlParam);

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@ErrorMessage";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = string.Empty;
                sqlParam.Direction     = ParameterDirection.Output;
                sqlParam.Size          = 2000;
                parameters.Add(sqlParam);

                long executionResult = 0;
                executionResult = executionResult = dah.ExecuteDMLSP(ConstantTexts.USP_APP_INS_UPD_ConfigMaster, parameters.ToArray(), out lErrocode, out lErrorNumber, out lRowsEffected, out errorMessage);

                if (executionResult == 0)
                {
                    return(ExceptionTypes.Success);
                }
                else
                {
                    return(ExceptionTypes.UnknownError);
                }
            }
            catch (Exception ex)
            {
                errorMessage = ex.Message;
                return(ExceptionTypes.UnknownError);
            }
        }
Example #17
0
        public ExceptionTypes SearchSkills(long?TimeZone, DOADM_SkillsMaster objDOADM_SkillsDetails, out List <DOADM_SkillsMaster> lstDOADM_SkillsDetails, out string errorMessage)
        {
            lstDOADM_SkillsDetails = new List <DOADM_SkillsMaster>();
            objDOADM_SkillsDetails.lstDOADM_SkillWorkQueuesCorrelation = new List <DOADM_SkillWorkQueuesCorrelation>();
            errorMessage = string.Empty;
            try
            {
                DAHelper dah          = new DAHelper();
                long     lErrocode    = 0;
                long     lErrorNumber = 0;
                DataSet  dsResultData = new DataSet();

                List <SqlParameter> parameters = new List <SqlParameter>();
                SqlParameter        sqlParam;

                if (objDOADM_SkillsDetails.ADM_SkillsMasterId != 0)
                {
                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@ADM_SkillsMasterId";
                    sqlParam.SqlDbType     = SqlDbType.BigInt;
                    sqlParam.Value         = objDOADM_SkillsDetails.ADM_SkillsMasterId;
                    parameters.Add(sqlParam);
                }

                if (!string.IsNullOrEmpty(objDOADM_SkillsDetails.SkillsName))
                {
                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@SkillsName";
                    sqlParam.SqlDbType     = SqlDbType.VarChar;
                    sqlParam.Value         = objDOADM_SkillsDetails.SkillsName;
                    parameters.Add(sqlParam);
                }

                if (objDOADM_SkillsDetails.RoleLkup != 0)
                {
                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@RoleLkup";
                    sqlParam.SqlDbType     = SqlDbType.VarChar;
                    sqlParam.Value         = objDOADM_SkillsDetails.RoleLkup;
                    parameters.Add(sqlParam);
                }

                if (objDOADM_SkillsDetails.BusinessSegmentLkup != 0)
                {
                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@BusinessSegmentLkup";
                    sqlParam.SqlDbType     = SqlDbType.VarChar;
                    sqlParam.Value         = objDOADM_SkillsDetails.BusinessSegmentLkup;
                    parameters.Add(sqlParam);
                }
                if (objDOADM_SkillsDetails.DiscrepancyCategoryLkup != 0)
                {
                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@DiscrepancyCategoryLkup";
                    sqlParam.SqlDbType     = SqlDbType.VarChar;
                    sqlParam.Value         = objDOADM_SkillsDetails.DiscrepancyCategoryLkup;
                    parameters.Add(sqlParam);
                }

                if (objDOADM_SkillsDetails.CMN_DepartmentRef != 0)
                {
                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@CMN_DepartmentRef";
                    sqlParam.SqlDbType     = SqlDbType.VarChar;
                    sqlParam.Value         = objDOADM_SkillsDetails.CMN_DepartmentRef;
                    parameters.Add(sqlParam);
                }

                if (objDOADM_SkillsDetails.WorkBasketLkup != 0)
                {
                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@WorkBasketLkup";
                    sqlParam.SqlDbType     = SqlDbType.VarChar;
                    sqlParam.Value         = objDOADM_SkillsDetails.WorkBasketLkup;
                    parameters.Add(sqlParam);
                }

                //Uncomment after User search SP modofication

                //No Null check, IsActive key boolean key by defaut will be false and cannot be null
                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@IsActive";
                sqlParam.SqlDbType     = SqlDbType.Bit;
                sqlParam.Value         = objDOADM_SkillsDetails.IsActive;
                parameters.Add(sqlParam);

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@ErrorMessage";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = string.Empty;
                sqlParam.Direction     = ParameterDirection.Output;
                sqlParam.Size          = 2000;
                parameters.Add(sqlParam);

                long executionResult = dah.ExecuteSelectSP(ConstantTexts.SP_USP_APP_SEL_Skills, parameters.ToArray(), out dsResultData, out lErrocode, out lErrorNumber, out errorMessage);
                if (executionResult == 0)
                {
                    if (dsResultData.Tables.Count > 0 && dsResultData.Tables[0].Rows.Count > 0)
                    {
                        MapSkillsDOSkillsMaster(TimeZone, dsResultData, out lstDOADM_SkillsDetails);
                        return(ExceptionTypes.Success);
                    }
                    else
                    {
                        return(ExceptionTypes.ZeroRecords);
                    }
                }
                else
                {
                    return(ExceptionTypes.UnknownError);
                }
            }
            catch (Exception ex)
            {
                errorMessage = ex.Message;
                return(ExceptionTypes.UnknownError);
            }
        }
Example #18
0
        public ExceptionTypes AddSkills(DOADM_SkillsMaster objDOADM_SkillsDetails, long lLoginId, out string errorMessage)
        {
            errorMessage = string.Empty;
            try
            {
                DAHelper dah = new DAHelper();

                List <SqlParameter> parameters = new List <SqlParameter>();
                long         lErrorCode        = 0;
                long         lErrorNumber      = 0;
                DataSet      dsResultData      = new DataSet();
                SqlParameter sqlParam;

                if (objDOADM_SkillsDetails.ADM_SkillsMasterId != 0)
                {
                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@ADM_SkillsMasterId";
                    sqlParam.SqlDbType     = SqlDbType.BigInt;
                    sqlParam.Value         = objDOADM_SkillsDetails.ADM_SkillsMasterId;
                    parameters.Add(sqlParam);
                }

                if (!string.IsNullOrEmpty(objDOADM_SkillsDetails.SkillsName))
                {
                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@SkillsName";
                    sqlParam.SqlDbType     = SqlDbType.VarChar;
                    sqlParam.Value         = objDOADM_SkillsDetails.SkillsName;
                    parameters.Add(sqlParam);
                }

                if (objDOADM_SkillsDetails.RoleLkup != 0)
                {
                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@RoleLkup";
                    sqlParam.SqlDbType     = SqlDbType.VarChar;
                    sqlParam.Value         = objDOADM_SkillsDetails.RoleLkup;
                    parameters.Add(sqlParam);
                }

                if (objDOADM_SkillsDetails.BusinessSegmentLkup != 0)
                {
                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@BusinessSegmentLkup";
                    sqlParam.SqlDbType     = SqlDbType.VarChar;
                    sqlParam.Value         = objDOADM_SkillsDetails.BusinessSegmentLkup;
                    parameters.Add(sqlParam);
                }
                if (objDOADM_SkillsDetails.DiscrepancyCategoryLkup != 0)
                {
                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@DiscrepancyCategoryLkup";
                    sqlParam.SqlDbType     = SqlDbType.VarChar;
                    sqlParam.Value         = objDOADM_SkillsDetails.DiscrepancyCategoryLkup;
                    parameters.Add(sqlParam);
                }


                if (objDOADM_SkillsDetails.CMN_DepartmentRef != 0)
                {
                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@CMN_DepartmentRef";
                    sqlParam.SqlDbType     = SqlDbType.VarChar;
                    sqlParam.Value         = objDOADM_SkillsDetails.CMN_DepartmentRef;
                    parameters.Add(sqlParam);
                }

                if (objDOADM_SkillsDetails.WorkBasketLkup != 0)
                {
                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@WorkBasketLkup";
                    sqlParam.SqlDbType     = SqlDbType.VarChar;
                    sqlParam.Value         = objDOADM_SkillsDetails.WorkBasketLkup;
                    parameters.Add(sqlParam);
                }

                if (!string.IsNullOrEmpty(objDOADM_SkillsDetails.IsActive.ToString()))
                {
                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@IsActive";
                    sqlParam.SqlDbType     = SqlDbType.Bit;
                    sqlParam.Value         = objDOADM_SkillsDetails.IsActive;
                    parameters.Add(sqlParam);
                }

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@LoginUserId";
                sqlParam.SqlDbType     = SqlDbType.BigInt;
                sqlParam.Value         = lLoginId;
                parameters.Add(sqlParam);

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@ScreenLkup";
                sqlParam.SqlDbType     = SqlDbType.BigInt;
                sqlParam.Value         = ScreenType.Skills;
                parameters.Add(sqlParam);

                if (objDOADM_SkillsDetails.lstDOADM_SkillWorkQueuesCorrelation.Count() > 0)
                {
                    DataTable skillsWorkQueue;
                    SetSkillsWorkQueue(objDOADM_SkillsDetails.lstDOADM_SkillWorkQueuesCorrelation, out skillsWorkQueue);
                    DataTableReader dtrSkillWorkQueues = new DataTableReader(skillsWorkQueue);

                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@TV_Queues";
                    sqlParam.SqlDbType     = SqlDbType.Structured;
                    sqlParam.Value         = dtrSkillWorkQueues;
                    parameters.Add(sqlParam);
                }


                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@ErrorMessage";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = string.Empty;
                sqlParam.Direction     = ParameterDirection.Output;
                sqlParam.Size          = 2000;
                parameters.Add(sqlParam);

                long executionResult = dah.ExecuteDMLSP(ConstantTexts.SP_USP_APP_INS_UPD_Skills, parameters.ToArray(), out lErrorCode, out lErrorCode, out lErrorNumber, out errorMessage);

                sqlParam = parameters.FirstOrDefault(x => x.ParameterName == "@ErrorMessage");

                if (sqlParam != null && sqlParam.Value != null)
                {
                    errorMessage += sqlParam.Value.ToString();
                }

                if (executionResult == (long)ExceptionTypes.Success && string.IsNullOrEmpty(errorMessage))
                {
                    return(ExceptionTypes.Success);
                }
                else
                {
                    return(ExceptionTypes.UnknownError);
                }
            }
            catch (Exception ex)
            {
                errorMessage = ex.Message;
                return(ExceptionTypes.UnknownError);
            }
        }
Example #19
0
        public ExceptionTypes InsertFDRSubmissionLog(List <FDRSubmissionRow> lstCases, long LoginUserId, bool IsFDRSubmissionCompleted, string errormessage, out string errorMessage)
        {
            FDRSubmissionRow objFDRSubmissionRow = new FDRSubmissionRow();

            try
            {
                DAHelper dah = new DAHelper();

                List <SqlParameter> parameters = new List <SqlParameter>();
                long         lErrorCode        = 0;
                long         lErrorNumber      = 0;
                DataSet      dsResultData      = new DataSet();
                SqlParameter sqlParam;

                if (lstCases.Count() > 0)
                {
                    DataTable dtCases;
                    SetFDRSubmissionLog(lstCases, IsFDRSubmissionCompleted, errormessage, out dtCases);
                    DataTableReader dtrFDRSubmissionLog = new DataTableReader(dtCases);
                    //DataSet ds = new DataSet("TVP_FDRStaging");
                    //ds.Tables.Add(dtCases);
                    //string xmlData = ds.GetXml();

                    //sqlParam = new SqlParameter();
                    //sqlParam.ParameterName = "@XMLData";
                    //sqlParam.SqlDbType = SqlDbType.NVarChar;
                    //sqlParam.Value = xmlData;
                    //parameters.Add(sqlParam);

                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@TVP_FDRSubmissionLog";
                    sqlParam.SqlDbType     = SqlDbType.Structured;
                    sqlParam.Value         = dtrFDRSubmissionLog;
                    parameters.Add(sqlParam);
                }

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@LoginUserId";
                sqlParam.SqlDbType     = SqlDbType.BigInt;
                sqlParam.Value         = LoginUserId;
                parameters.Add(sqlParam);


                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@ErrorMessage";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = string.Empty;
                sqlParam.Direction     = ParameterDirection.Output;
                sqlParam.Size          = 2000;
                parameters.Add(sqlParam);

                long executionResult = dah.ExecuteDMLSP(ConstantTexts.SP_USP_APP_INS_FDRSubmissionLog, parameters.ToArray(), out lErrorCode, out lErrorCode, out lErrorNumber, out errorMessage);

                sqlParam = parameters.FirstOrDefault(x => x.ParameterName == "@ErrorMessage");

                if (sqlParam != null && sqlParam.Value != null)
                {
                    errorMessage += sqlParam.Value.ToString();
                }

                if (executionResult == (long)ExceptionTypes.Success && string.IsNullOrEmpty(errorMessage))
                {
                    return(ExceptionTypes.Success);
                }
                else
                {
                    return(ExceptionTypes.UnknownError);
                }
            }
            catch (Exception ex)
            {
                errorMessage = ex.Message;
                return(ExceptionTypes.UnknownError);
            }
        }
Example #20
0
        /// <summary>
        /// Method to get the cases for TRC155 macros
        /// </summary>
        /// <param name="p_HouseholdID"></param>
        /// <param name="p_HICN"></param>
        /// <param name="p_Contract"></param>
        /// <param name="p_PBP"></param>
        /// <param name="p_EffectiveDate"></param>
        /// <param name="p_DiscrepancyType"></param>
        /// <param name="Queues"></param>
        /// <returns></returns>
        public ExceptionTypes GetCasesForTRC155Macro(string p_HouseholdID, string p_HICN, string p_Contract, String p_PBP, string p_EffectiveDate, string p_DiscrepancyType, out List <DOMacroData> Queues, out string errorMessage)
        {
            List <DOMacroData> lstDoMacroTRCData = new List <DOMacroData>();

            p_HouseholdID     = ((p_HouseholdID == null) || (p_HouseholdID == "null")) ? null : p_HouseholdID;
            p_HICN            = ((p_HICN == null) || (p_HICN == "null")) ? null : p_HICN;
            p_Contract        = ((p_Contract == null) || (p_Contract == "null")) ? null : p_Contract;
            p_PBP             = ((p_PBP == null) || (p_PBP == "null")) ? null : p_PBP;
            p_EffectiveDate   = ((p_EffectiveDate == "null") || (p_EffectiveDate == "01/01/0001") || (p_EffectiveDate == null)) ? null : p_EffectiveDate.Replace('-', '/');
            p_DiscrepancyType = ((p_DiscrepancyType == null) || (p_DiscrepancyType == "null")) ? null : p_DiscrepancyType;

            errorMessage = string.Empty;
            Queues       = new List <DOMacroData>();
            DataSet dsResultData = new DataSet();

            try
            {
                DAHelper            dah          = new DAHelper();
                long                lErrocode    = 0;
                long                lErrorNumber = 0;
                SqlParameter        sqlParam     = new SqlParameter();
                List <SqlParameter> parameters   = new List <SqlParameter>();

                //call function to map object properties to SQL parameters for query execution
                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@HouseholdID";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = p_HouseholdID;
                parameters.Add(sqlParam);

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@HICN";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = p_HICN;
                parameters.Add(sqlParam);

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@Contract";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = p_Contract;
                parameters.Add(sqlParam);

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@PBP";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = p_PBP;
                parameters.Add(sqlParam);

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@EffectiveDate";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = p_EffectiveDate;
                parameters.Add(sqlParam);

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@DiscrepancyType";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = p_DiscrepancyType;
                parameters.Add(sqlParam);

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@ErrorMessage";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = string.Empty;
                sqlParam.Direction     = ParameterDirection.Output;
                sqlParam.Size          = 2000;
                parameters.Add(sqlParam);


                long executionResult = dah.ExecuteSelectSP(ConstantTexts.SP_APP_SEL_TRC155_Macro, parameters.ToArray(), out dsResultData, out lErrocode, out lErrorNumber, out errorMessage);
                sqlParam = parameters.FirstOrDefault(x => x.ParameterName == "@ErrorMessage");

                if (sqlParam != null && sqlParam.Value != null)
                {
                    errorMessage += sqlParam.Value.ToString();
                }
                if (executionResult == 0 && string.IsNullOrEmpty(errorMessage))
                {
                    if (dsResultData.Tables.Count > 0 && dsResultData.Tables[0].Rows.Count > 0)
                    {
                        MappingDatasetToObject(dsResultData, out Queues);
                        return(ExceptionTypes.Success);
                    }
                    else
                    {
                        return(ExceptionTypes.ZeroRecords);
                    }
                }
                else
                {
                    return(ExceptionTypes.UnknownError);
                }
            }
            catch (Exception ex)
            {
                DALCommon.LogError(23, MethodBase.GetCurrentMethod().ToString(), (long)ErrorModuleName.Macro, (long)ExceptionTypes.Exception, ex.InnerException.Message, "");
                errorMessage = ex.Message;
                return(ExceptionTypes.UnknownError);
            }
        }
Example #21
0
        public ExceptionTypes GetBulkImportID(out long BulkImportID, out string ExcelFilePath, out string errorMessage)
        {
            BulkImportID  = 0;
            ExcelFilePath = string.Empty;
            try
            {
                DAHelper dah           = new DAHelper();
                long     lErrocode     = 0;
                long     lErrorNumber  = 0;
                long     lRowsEffected = 0;
                DataSet  dsTable       = new DataSet();
                errorMessage = string.Empty;

                List <SqlParameter> parameters = new List <SqlParameter>();
                SqlParameter        sqlParam;

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@GEN_FDRBulkImportId";
                sqlParam.SqlDbType     = SqlDbType.BigInt;
                sqlParam.Direction     = ParameterDirection.Output;
                sqlParam.Size          = 200000000;
                parameters.Add(sqlParam);


                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@ExcelFilePath";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = string.Empty;
                sqlParam.Direction     = ParameterDirection.Output;
                sqlParam.Size          = 2000;
                parameters.Add(sqlParam);

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@ErrorMessage";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = string.Empty;
                sqlParam.Direction     = ParameterDirection.Output;
                sqlParam.Size          = 2000;
                parameters.Add(sqlParam);

                long executionResult = 0;
                executionResult = executionResult = dah.ExecuteDMLSP(ConstantTexts.SP_USP_BGP_SEL_FDR_BulkImportPath, parameters.ToArray(), out lErrocode, out lErrorNumber, out lRowsEffected, out errorMessage);
                sqlParam        = parameters.FirstOrDefault(x => x.ParameterName == "@ErrorMessage");
                if (sqlParam != null && sqlParam.Value != null)
                {
                    errorMessage += sqlParam.Value.ToString();
                }
                sqlParam = parameters.FirstOrDefault(x => x.ParameterName == "@GEN_FDRBulkImportId");
                if (sqlParam != null && sqlParam.Value != null)
                {
                    BulkImportID = Convert.ToInt64(sqlParam.Value);
                }
                sqlParam = parameters.FirstOrDefault(x => x.ParameterName == "@ExcelFilePath");
                if (sqlParam != null && sqlParam.Value != null)
                {
                    ExcelFilePath = Convert.ToString(sqlParam.Value);
                }
                if (executionResult == (long)ExceptionTypes.Success && string.IsNullOrEmpty(errorMessage))
                {
                    return(ExceptionTypes.Success);
                }
                else
                {
                    return(ExceptionTypes.UnknownError);
                }
            }
            catch (Exception ex)
            {
                errorMessage = ex.Message;
                return(ExceptionTypes.UnknownError);
            }
        }
Example #22
0
        public ExceptionTypes UpdatMQTRRCaseDetails(long lMQTRRWorkQueueItemId, long lMQSourceTypeLkup, long lUpdateCMSTransactionCaseNumber, long CurrentUserId, out string errorMessage)
        {
            try
            {
                DAHelper dah           = new DAHelper();
                long     lErrocode     = 0;
                long     lErrorNumber  = 0;
                long     lRowsEffected = 0;
                DataSet  dsTable       = new DataSet();
                errorMessage = string.Empty;
                long executionResult = 0;

                List <SqlParameter> parameters = new List <SqlParameter>();
                SqlParameter        sqlParam;

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@MQTRRWorkQueueItemsId";
                sqlParam.SqlDbType     = SqlDbType.BigInt;
                sqlParam.Value         = lMQTRRWorkQueueItemId;
                parameters.Add(sqlParam);

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@MQSourceTypeLkup";
                sqlParam.SqlDbType     = SqlDbType.BigInt;
                sqlParam.Value         = lMQSourceTypeLkup;
                parameters.Add(sqlParam);

                if (lUpdateCMSTransactionCaseNumber != 0)
                {
                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@GEN_QueueId";
                    sqlParam.SqlDbType     = SqlDbType.BigInt;
                    sqlParam.Value         = lUpdateCMSTransactionCaseNumber;
                    parameters.Add(sqlParam);
                }

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@CurrentUserId";
                sqlParam.SqlDbType     = SqlDbType.BigInt;
                sqlParam.Value         = CurrentUserId;
                parameters.Add(sqlParam);

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@ErrorMessage";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = string.Empty;
                sqlParam.Direction     = ParameterDirection.Output;
                sqlParam.Size          = 2000;
                parameters.Add(sqlParam);

                executionResult = dah.ExecuteDMLSP(ConstantTexts.SP_USP_BGP_INS_UPD_MQTRRProcess, parameters.ToArray(), out lErrocode, out lErrorNumber, out lRowsEffected, out errorMessage);
                sqlParam        = parameters.FirstOrDefault(x => x.ParameterName == "@ErrorMessage");
                if (sqlParam != null && sqlParam.Value != null)
                {
                    errorMessage += sqlParam.Value.ToString();
                }
                if (executionResult == (long)ExceptionTypes.Success && string.IsNullOrEmpty(errorMessage))
                {
                    return(ExceptionTypes.Success);
                }
                else
                {
                    return(ExceptionTypes.UnknownError);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error : " + ex.Message);
                errorMessage = ex.Message;
                return(ExceptionTypes.UnknownError);
            }
        }
Example #23
0
        public ExceptionTypes InsertFDRStagingData(DOGEN_FDR objDOGEN_FDR, out string errorMessage)
        {
            try
            {
                DAHelper dah           = new DAHelper();
                long     lErrocode     = 0;
                long     lErrorNumber  = 0;
                long     lRowsEffected = 0;
                DataSet  dsTable       = new DataSet();
                errorMessage = string.Empty;

                List <SqlParameter> parameters = new List <SqlParameter>();
                SqlParameter        sqlParam;

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@GEN_FDRBulkImportId";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = objDOGEN_FDR.FDRBulkImportID;
                parameters.Add(sqlParam);
                sqlParam = new SqlParameter();

                //DataTableReader drTable = new DataTableReader(objDOGEN_FDR.dtExcelData);
                DataSet ds = new DataSet("TVP_FDRStaging");
                ds.Tables.Add(objDOGEN_FDR.dtExcelData);
                string xmlData = ds.GetXml();

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@XMLData";
                sqlParam.SqlDbType     = SqlDbType.NVarChar;
                sqlParam.Value         = xmlData;
                parameters.Add(sqlParam);

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@ErrorMessage";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = string.Empty;
                sqlParam.Direction     = ParameterDirection.Output;
                sqlParam.Size          = 2000;
                parameters.Add(sqlParam);


                DataSet dsResult        = new DataSet();
                long    executionResult = 0;
                executionResult = dah.ExecuteDMLSP(ConstantTexts.SP_USP_BGP_INS_FDR_Staging, parameters.ToArray(), out lErrocode, out lErrorNumber, out lRowsEffected, out errorMessage);
                // executionResult = dah.ExecuteSelectSP(ConstantTexts.SP_USP_BGP_INS_FDR_Staging, parameters.ToArray(),out dsResult, out lErrorNumber, out lRowsEffected, out errorMessage);
                sqlParam = parameters.FirstOrDefault(x => x.ParameterName == "@ErrorMessage");
                if (sqlParam != null && sqlParam.Value != null)
                {
                    errorMessage += sqlParam.Value.ToString();
                }

                if (executionResult == (long)ExceptionTypes.Success && string.IsNullOrEmpty(errorMessage))
                {
                    return(ExceptionTypes.Success);
                }
                else
                {
                    return(ExceptionTypes.UnknownError);
                }
            }
            catch (Exception ex)
            {
                errorMessage = ex.Message;
                return(ExceptionTypes.UnknownError);
            }
        }
Example #24
0
        public ExceptionTypes AddEditAccessGroup(long lLoggedInUserId, UIDOAccessGroup objUIDOAccessGroup, out string errorMessage)
        {
            errorMessage = string.Empty;
            try
            {
                DAHelper dah                   = new DAHelper();
                long     lErrocode             = 0;
                long     lErrorNumber          = 0;
                long     lNumberOfRowsEffected = 0;
                DataSet  dsTable               = new DataSet();

                List <SqlParameter> parameters = new List <SqlParameter>();
                SqlParameter        sqlParam;

                if (objUIDOAccessGroup.ADM_AccessGroupMasterId > 0)
                {
                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@ADM_AccessGroupMasterId";
                    sqlParam.SqlDbType     = SqlDbType.BigInt;
                    sqlParam.Value         = objUIDOAccessGroup.ADM_AccessGroupMasterId;
                    parameters.Add(sqlParam);
                }
                if (objUIDOAccessGroup.AccessGroupName != string.Empty)
                {
                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@AccessGroupName";
                    sqlParam.SqlDbType     = SqlDbType.VarChar;
                    sqlParam.Value         = objUIDOAccessGroup.AccessGroupName;
                    parameters.Add(sqlParam);
                }
                if (objUIDOAccessGroup.AccessGroupDescription != string.Empty)
                {
                    if (objUIDOAccessGroup.AccessGroupDescription == null)
                    {
                        objUIDOAccessGroup.AccessGroupDescription = "";
                    }
                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@AccessGroupDescription";
                    sqlParam.SqlDbType     = SqlDbType.VarChar;
                    sqlParam.Value         = objUIDOAccessGroup.AccessGroupDescription;
                    parameters.Add(sqlParam);
                }
                if (objUIDOAccessGroup.RoleLkup > 0)
                {
                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@RoleLkup";
                    sqlParam.SqlDbType     = SqlDbType.BigInt;
                    sqlParam.Value         = objUIDOAccessGroup.RoleLkup;
                    parameters.Add(sqlParam);
                }
                if (objUIDOAccessGroup.WorkBasketLkup > 0)
                {
                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@WorkBasketLkup";
                    sqlParam.SqlDbType     = SqlDbType.BigInt;
                    sqlParam.Value         = objUIDOAccessGroup.WorkBasketLkup;
                    parameters.Add(sqlParam);
                }
                if (objUIDOAccessGroup.DescripancyCatLkup > 0)
                {
                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@DiscrepancyCategoryLkup";
                    sqlParam.SqlDbType     = SqlDbType.BigInt;
                    sqlParam.Value         = objUIDOAccessGroup.DescripancyCatLkup;
                    parameters.Add(sqlParam);
                }

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@IsActive";
                sqlParam.SqlDbType     = SqlDbType.Bit;
                sqlParam.Value         = objUIDOAccessGroup.IsActive;
                parameters.Add(sqlParam);

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@LoginUserId";
                sqlParam.SqlDbType     = SqlDbType.BigInt;
                sqlParam.Value         = lLoggedInUserId;
                parameters.Add(sqlParam);

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@ScreenLkup";
                sqlParam.SqlDbType     = SqlDbType.BigInt;
                sqlParam.Value         = ScreenType.AccessGroup;
                parameters.Add(sqlParam);

                if (objUIDOAccessGroup.lstDOADM_AccessGroupSkillsCorrelation.Count() > 0)
                {
                    DataTable accessGroupSkills;
                    SetAccessGroupSkills(objUIDOAccessGroup.lstDOADM_AccessGroupSkillsCorrelation, out accessGroupSkills);
                    DataTableReader dtrAccessGroupSkills = new DataTableReader(accessGroupSkills);

                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@TV_Skills";
                    sqlParam.SqlDbType     = SqlDbType.Structured;
                    sqlParam.Value         = dtrAccessGroupSkills;
                    parameters.Add(sqlParam);
                }

                if (objUIDOAccessGroup.lstDOADM_AccessGroupReportCorrelation.Count() > 0)
                {
                    DataTable accessGroupReports;
                    SetAccessGroupReports(objUIDOAccessGroup.lstDOADM_AccessGroupReportCorrelation, out accessGroupReports);
                    DataTableReader dtrAccessGroupReport = new DataTableReader(accessGroupReports);

                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@TV_Reports";
                    sqlParam.SqlDbType     = SqlDbType.Structured;
                    sqlParam.Value         = dtrAccessGroupReport;
                    parameters.Add(sqlParam);
                }

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@ErrorMessage";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = string.Empty;
                sqlParam.Direction     = ParameterDirection.Output;
                sqlParam.Size          = 2000;
                parameters.Add(sqlParam);

                long executionResult = dah.ExecuteDMLSP(ConstantTexts.SP_USP_APP_INS_UPD_AccessGroup, parameters.ToArray(), out lErrocode, out lErrorNumber, out lNumberOfRowsEffected, out errorMessage);
                sqlParam = parameters.FirstOrDefault(x => x.ParameterName == "@ErrorMessage");

                if (sqlParam != null && sqlParam.Value != null)
                {
                    errorMessage += sqlParam.Value.ToString();
                }

                if (executionResult == (long)ExceptionTypes.Success && string.IsNullOrEmpty(errorMessage))
                {
                    return(ExceptionTypes.Success);
                }
                else
                {
                    return(ExceptionTypes.UnknownError);
                }
            }
            catch (Exception ex)
            {
                return(ExceptionTypes.UnknownError);
            }
        }
Example #25
0
        public ExceptionTypes GetAccessGroupBasedOnSearch(long?TimeZone, DOADM_AccessGroupMaster objDOADM_AccessGroupMaster, out List <DOADM_AccessGroupMaster> lstDOADM_AccessGroupMaster)
        {
            lstDOADM_AccessGroupMaster = new List <DOADM_AccessGroupMaster>();
            try
            {
                DAHelper dah          = new DAHelper();
                long     lErrocode    = 0;
                long     lErrorNumber = 0;
                DataSet  dsTable      = new DataSet();
                string   errorMessage;

                List <SqlParameter> parameters = new List <SqlParameter>();
                SqlParameter        sqlParam;

                if (objDOADM_AccessGroupMaster.ADM_AccessGroupMasterId > 0)
                {
                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@AccessGroupMasterId";
                    sqlParam.SqlDbType     = SqlDbType.BigInt;
                    sqlParam.Value         = objDOADM_AccessGroupMaster.ADM_AccessGroupMasterId;
                    parameters.Add(sqlParam);
                }
                if (!string.IsNullOrEmpty(objDOADM_AccessGroupMaster.AccessGroupName))
                {
                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@AccessGroupName";
                    sqlParam.SqlDbType     = SqlDbType.VarChar;
                    sqlParam.Value         = objDOADM_AccessGroupMaster.AccessGroupName;
                    parameters.Add(sqlParam);
                }
                if (!string.IsNullOrEmpty(objDOADM_AccessGroupMaster.AccessGroupDescription))
                {
                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@AccessGroupDescription";
                    sqlParam.SqlDbType     = SqlDbType.VarChar;
                    sqlParam.Value         = objDOADM_AccessGroupMaster.AccessGroupDescription;
                    parameters.Add(sqlParam);
                }

                if (objDOADM_AccessGroupMaster.IsActive != null)
                {
                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@IsActive";
                    sqlParam.SqlDbType     = SqlDbType.Bit;
                    sqlParam.Value         = objDOADM_AccessGroupMaster.IsActive;
                    parameters.Add(sqlParam);
                }

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@ErrorMessage";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = string.Empty;
                sqlParam.Direction     = ParameterDirection.Output;
                sqlParam.Size          = 2000;
                parameters.Add(sqlParam);

                long executionResult = dah.ExecuteSelectSP(ConstantTexts.SP_USP_APP_SEL_AccesssGroup, parameters.ToArray(), out dsTable, out lErrocode, out lErrorNumber, out errorMessage);
                if (executionResult == 0)
                {
                    if (dsTable.Tables.Count > 0 && dsTable.Tables[0].Rows.Count > 0)
                    {
                        MapObjectProperties(TimeZone, dsTable, out lstDOADM_AccessGroupMaster);
                        if (lstDOADM_AccessGroupMaster.Count > 0)
                        {
                            return(ExceptionTypes.Success);
                        }
                    }
                    return(ExceptionTypes.ZeroRecords);
                }
                else if (executionResult == 2)
                {
                    return(ExceptionTypes.ZeroRecords);
                }
                else
                {
                    return(ExceptionTypes.UnknownError);
                }
            }
            catch (Exception ex)
            {
                return(ExceptionTypes.UnknownError);
            }
        }
Example #26
0
        public ExceptionTypes MQTRRRecordsToProcess(long savedMessagesBGPId, out List <DOMQTRRWorkQueueItems> lstDOMQTRRWorkQueueItems, out string errorMessage)
        {
            lstDOMQTRRWorkQueueItems = new List <DOMQTRRWorkQueueItems>();
            DOMQTRRWorkQueueItems objDOMQTRRWorkQueueItems;

            try
            {
                DAHelper dah     = new DAHelper();
                DataSet  dsTable = new DataSet();
                errorMessage = string.Empty;

                long executionResult = 0;

                string query = string.Format(ConstantTexts.Query_Select_MQTRRRecords, savedMessagesBGPId);

                executionResult = dah.ExecuteSQL(query, new List <SqlParameter>().ToArray(), out DataSet MQTRRRecordDetailsDataSet, out string erorrMessage, true);

                if (executionResult == (long)ExceptionTypes.Success)
                {
                    if (!MQTRRRecordDetailsDataSet.IsNullOrEmpty())
                    {
                        if (MQTRRRecordDetailsDataSet.Tables.Count > 0 && MQTRRRecordDetailsDataSet.Tables[0].Rows.Count > 0)
                        {
                            foreach (DataRow row in MQTRRRecordDetailsDataSet.Tables[0].Rows)
                            {
                                objDOMQTRRWorkQueueItems = new DOMQTRRWorkQueueItems();
                                if (row.Table.Columns.Contains("MQTRRWorkQueueItemId"))
                                {
                                    if (!DBNull.Value.Equals(row["MQTRRWorkQueueItemId"]))
                                    {
                                        objDOMQTRRWorkQueueItems.MQTRRWorkQueueItemId = Convert.ToInt64(row["MQTRRWorkQueueItemId"]);
                                    }
                                }
                                if (row.Table.Columns.Contains("MQSourceTypeLkup"))
                                {
                                    if (!DBNull.Value.Equals(row["MQSourceTypeLkup"]))
                                    {
                                        objDOMQTRRWorkQueueItems.MQSourceTypeLkup = Convert.ToInt64(row["MQSourceTypeLkup"]);
                                    }
                                }
                                if (row.Table.Columns.Contains("ERSCaseNumber"))
                                {
                                    if (!DBNull.Value.Equals(row["ERSCaseNumber"]))
                                    {
                                        objDOMQTRRWorkQueueItems.ERSCaseNumber = Convert.ToInt64(row["ERSCaseNumber"]);
                                    }
                                }
                                lstDOMQTRRWorkQueueItems.Add(objDOMQTRRWorkQueueItems);
                            }
                            return(ExceptionTypes.Success);
                        }
                        return(ExceptionTypes.ZeroRecords);
                    }
                    return(ExceptionTypes.ZeroRecords);
                }
                else if (executionResult == 2)
                {
                    return(ExceptionTypes.ZeroRecords);
                }
                else
                {
                    return(ExceptionTypes.UnknownError);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error : " + ex.Message);
                errorMessage = ex.Message;
                return(ExceptionTypes.UnknownError);
            }
        }
Example #27
0
        public ExceptionTypes GetAllReports(long?lRptIdout, string sReportName, out List <DORPT_ReportsMaster> lstDORPT_ReportsMaster, out string errorMessage)
        {
            lstDORPT_ReportsMaster = new List <DORPT_ReportsMaster>();
            errorMessage           = string.Empty;
            try
            {
                DAHelper dah          = new DAHelper();
                long     lErrocode    = 0;
                long     lErrorNumber = 0;
                DataSet  dsTable      = new DataSet();

                List <SqlParameter> parameters = new List <SqlParameter>();
                SqlParameter        sqlParam;

                if (lRptIdout > 0)
                {
                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@RPT_ReportsMasterId";
                    sqlParam.SqlDbType     = SqlDbType.BigInt;
                    sqlParam.Value         = lRptIdout;
                    parameters.Add(sqlParam);
                }
                if (sReportName != string.Empty)
                {
                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@ReportName";
                    sqlParam.SqlDbType     = SqlDbType.VarChar;
                    sqlParam.Value         = sReportName;
                    parameters.Add(sqlParam);
                }

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@ErrorMessage";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = string.Empty;
                sqlParam.Direction     = ParameterDirection.Output;
                sqlParam.Size          = 2000;
                parameters.Add(sqlParam);

                long executionResult = dah.ExecuteSelectSP(ConstantTexts.SP_USP_APP_SEL_Reports, parameters.ToArray(), out dsTable, out lErrocode, out lErrorNumber, out errorMessage);
                if (executionResult == 0)
                {
                    if (dsTable.Tables.Count > 0 && dsTable.Tables[0].Rows.Count > 0)
                    {
                        MapObjectProperties(dsTable, out lstDORPT_ReportsMaster);
                        if (lstDORPT_ReportsMaster.Count > 0)
                        {
                            return(ExceptionTypes.Success);
                        }
                    }
                    return(ExceptionTypes.ZeroRecords);
                }
                else if (executionResult == 2)
                {
                    return(ExceptionTypes.ZeroRecords);
                }
                else
                {
                    return(ExceptionTypes.UnknownError);
                }
            }
            catch (Exception ex)
            {
                return(ExceptionTypes.UnknownError);
            }
        }
Example #28
0
        public ExceptionTypes UpdateRPRQueue(long QueueID, string CMSProcessDate, string DispositionCode, string DispositionCodeDescription, long TransactionTypeLkup, out string errorMessage)
        {
            errorMessage = string.Empty;
            try
            {
                DAHelper dah           = new DAHelper();
                long     lErrocode     = 0;
                long     lErrorNumber  = 0;
                long     lRowsEffected = 0;
                DataSet  dsTable       = new DataSet();
                errorMessage = string.Empty;

                List <SqlParameter> parameters = new List <SqlParameter>();
                SqlParameter        sqlParam;

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@GEN_QueueId";
                sqlParam.SqlDbType     = SqlDbType.BigInt;
                sqlParam.Value         = QueueID;
                parameters.Add(sqlParam);


                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@CMSProcessDate";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = CMSProcessDate;
                parameters.Add(sqlParam);

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@DispositionCode";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = DispositionCode;
                parameters.Add(sqlParam);

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@DispositionCodeDescription";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = DispositionCodeDescription;
                parameters.Add(sqlParam);

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@TransactionTypeLkup";
                sqlParam.SqlDbType     = SqlDbType.BigInt;
                sqlParam.Value         = TransactionTypeLkup;
                parameters.Add(sqlParam);

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@ErrorMessage";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = string.Empty;
                sqlParam.Direction     = ParameterDirection.Output;
                sqlParam.Size          = 2000;
                parameters.Add(sqlParam);

                long executionResult = 0;
                executionResult = executionResult = dah.ExecuteDMLSP(ConstantTexts.SP_USP_BGP_UPD_RPR_Queue, parameters.ToArray(), out lErrocode, out lErrorNumber, out lRowsEffected, out errorMessage);
                sqlParam        = parameters.FirstOrDefault(x => x.ParameterName == "@ErrorMessage");
                if (sqlParam != null && sqlParam.Value != null)
                {
                    errorMessage += sqlParam.Value.ToString();
                }
                if (executionResult == (long)ExceptionTypes.Success && string.IsNullOrEmpty(errorMessage))
                {
                    return(ExceptionTypes.Success);
                }
                else
                {
                    return(ExceptionTypes.UnknownError);
                }
            }
            catch (Exception ex)
            {
                errorMessage = ex.Message;
                return(ExceptionTypes.UnknownError);
            }
        }
Example #29
0
        //save Department Master
        public ExceptionTypes SaveDepartment(DOCMN_Department objDOCMN_Department, out string errorMessage)
        {
            try
            {
                DAHelper dah           = new DAHelper();
                long     lErrocode     = 0;
                long     lErrorNumber  = 0;
                long     lRowsEffected = 0;
                DataSet  dsTable       = new DataSet();
                errorMessage = string.Empty;

                List <SqlParameter> parameters = new List <SqlParameter>();
                SqlParameter        sqlParam;

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@CMN_DepartmentId";
                sqlParam.SqlDbType     = SqlDbType.BigInt;
                sqlParam.Value         = objDOCMN_Department.CMN_DepartmentId;
                parameters.Add(sqlParam);

                if (!string.IsNullOrEmpty(objDOCMN_Department.ERSDepartmentName))
                {
                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@ERSDepartmentName";
                    sqlParam.SqlDbType     = SqlDbType.VarChar;
                    sqlParam.Value         = objDOCMN_Department.ERSDepartmentName;
                    parameters.Add(sqlParam);
                }

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@BusinessSegmentLkup";
                sqlParam.SqlDbType     = SqlDbType.BigInt;
                sqlParam.Value         = objDOCMN_Department.BusinessSegmentLkup;
                parameters.Add(sqlParam);

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@DepartmentLkup";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = objDOCMN_Department.DepartmentLkup;
                parameters.Add(sqlParam);

                if (objDOCMN_Department.EffectiveDate != null)
                {
                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@EffectiveDate";
                    sqlParam.SqlDbType     = SqlDbType.DateTime;
                    sqlParam.Value         = objDOCMN_Department.EffectiveDate;
                    parameters.Add(sqlParam);
                }
                if (objDOCMN_Department.InactivationDate != null)
                {
                    sqlParam = new SqlParameter();
                    sqlParam.ParameterName = "@InactivationDate";
                    sqlParam.SqlDbType     = SqlDbType.DateTime;
                    sqlParam.Value         = objDOCMN_Department.InactivationDate;
                    parameters.Add(sqlParam);
                }

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@IsActive";
                sqlParam.SqlDbType     = SqlDbType.Bit;
                sqlParam.Value         = objDOCMN_Department.IsActive;
                parameters.Add(sqlParam);

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@LoginUserId";
                sqlParam.SqlDbType     = SqlDbType.BigInt;
                sqlParam.Value         = objDOCMN_Department.CreatedByRef;
                parameters.Add(sqlParam);

                //Extra parameter when adding or editing record for releasing lock
                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@ScreenLkup";
                sqlParam.SqlDbType     = SqlDbType.BigInt;
                sqlParam.Value         = (long)ScreenType.Department;
                parameters.Add(sqlParam);

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@ErrorMessage";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = string.Empty;
                sqlParam.Direction     = ParameterDirection.Output;
                sqlParam.Size          = 2000;
                parameters.Add(sqlParam);

                long executionResult = 0;
                //if (objDOADM_UserMaster.ADM_UserMasterId == 0)
                //{
                executionResult = executionResult = dah.ExecuteDMLSP(ConstantTexts.SP_USP_APP_INS_UPD_Department, parameters.ToArray(), out lErrocode, out lErrorNumber, out lRowsEffected, out errorMessage);
                //}
                //else
                //{
                //    executionResult = executionResult = dah.ExecuteDMLSP(ConstantTexts.SP_USP_APP_UPD_ADM_UserMaster, parameters.ToArray(), out lErrocode, out lErrorNumber, out lRowsEffected, out errorMessage);
                //}

                if (executionResult == 0)
                {
                    return(ExceptionTypes.Success);
                }
                else
                {
                    return(ExceptionTypes.UnknownError);
                }
            }
            catch (Exception ex)
            {
                errorMessage = ex.Message;
                return(ExceptionTypes.UnknownError);
            }
        }
Example #30
0
        public ExceptionTypes UpdateFDRPackageDate(List <long> caseIds, FDRSubmissionCategory submissionCategory, long LoginUserId, out string errorMessage)
        {
            string strCaseIds = String.Concat(caseIds.Select(x => x.ToString() + ","));

            errorMessage = string.Empty;
            try
            {
                DAHelper dah           = new DAHelper();
                long     lErrocode     = 0;
                long     lErrorNumber  = 0;
                long     lRowsEffected = 0;
                DataSet  dsTable       = new DataSet();
                errorMessage = string.Empty;

                List <SqlParameter> parameters = new List <SqlParameter>();
                SqlParameter        sqlParam;

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@CaseIds";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = strCaseIds;
                parameters.Add(sqlParam);

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@FDRSubmissionCategoryLkup";
                sqlParam.SqlDbType     = SqlDbType.BigInt;
                sqlParam.Value         = (long)submissionCategory;
                parameters.Add(sqlParam);

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@LoginUserId";
                sqlParam.SqlDbType     = SqlDbType.BigInt;
                sqlParam.Value         = LoginUserId;
                parameters.Add(sqlParam);

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@ErrorMessage";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = string.Empty;
                sqlParam.Direction     = ParameterDirection.Output;
                sqlParam.Size          = 2000;
                parameters.Add(sqlParam);

                long executionResult = 0;
                executionResult = executionResult = dah.ExecuteDMLSP(ConstantTexts.SP_USP_BGP_UPD_FDRPackageDates, parameters.ToArray(), out lErrocode, out lErrorNumber, out lRowsEffected, out errorMessage);
                sqlParam        = parameters.FirstOrDefault(x => x.ParameterName == "@ErrorMessage");
                if (sqlParam != null && sqlParam.Value != null)
                {
                    errorMessage += sqlParam.Value.ToString();
                }
                if (executionResult == (long)ExceptionTypes.Success && string.IsNullOrEmpty(errorMessage))
                {
                    return(ExceptionTypes.Success);
                }
                else
                {
                    return(ExceptionTypes.UnknownError);
                }
            }
            catch (Exception ex)
            {
                errorMessage = ex.Message;
                return(ExceptionTypes.UnknownError);
            }
        }