Exemplo n.º 1
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);
            }
        }
Exemplo n.º 2
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);
            }
        }