Example #1
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 #2
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 #3
0
        public ExceptionTypes GetNationalEmployerGroups(out List <DOMQTRRWorkQueueItems> lstEmployerNationalGroup, out string errorMessage)
        {
            lstEmployerNationalGroup = 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_NationalEmployerGroups);

                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("Contract_Number"))
                                {
                                    if (!DBNull.Value.Equals(row["Contract_Number"]))
                                    {
                                        objDOMQTRRWorkQueueItems.Contract = row["Contract_Number"].NullToString();
                                    }
                                }
                                if (row.Table.Columns.Contains("PBP"))
                                {
                                    if (!DBNull.Value.Equals(row["PBP"]))
                                    {
                                        objDOMQTRRWorkQueueItems.PBP = row["PBP"].NullToString();
                                    }
                                }
                                if (row.Table.Columns.Contains("GPSEmployerID"))
                                {
                                    if (!DBNull.Value.Equals(row["GPSEmployerID"]))
                                    {
                                        objDOMQTRRWorkQueueItems.EmployerId = row["GPSEmployerID"].NullToString();
                                    }
                                }
                                if (row.Table.Columns.Contains("StateAbbreviation"))
                                {
                                    if (!DBNull.Value.Equals(row["StateAbbreviation"]))
                                    {
                                        objDOMQTRRWorkQueueItems.StateAbbreviation = row["StateAbbreviation"].NullToString();
                                    }
                                }
                                lstEmployerNationalGroup.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);
            }
        }