예제 #1
0
        private DataTable GetFaxNumbers()
        {
            DataTable dt = null;
            try
            {
                var inbFaxNosDal = new InboundFaxNosDal(sqlConnectionString);
                var inbFaxNoList = new List<InboundFaxNosDto>();
                inbFaxNoList = inbFaxNosDal.GetAll();

                dt = new DataTable();
                dt.Columns.Add("FAXNO");
                                
                foreach (var data in inbFaxNoList)
                {
                    var dr = dt.NewRow();
                    dr[0] = data.Faxno;
                    dt.Rows.Add(dr);
                }                
            }
            catch (Exception err)
            {
                LogAndDisplayException("An error occurred while retrieving the transmission address from the database." + Environment.NewLine +
                     "Error CNF-462 in " + FORM_NAME + ".GetFaxNumbers().", err);
            }
            return dt;
        }
예제 #2
0
        private DataTable getFaxNumbers()
        {
            DataTable dt = null;
            try
            {
                //getInboundFaxNumbers request = new getInboundFaxNumbers();
                //getInboundFaxNumbersResponse res = new getInboundFaxNumbersResponse();
                //res = inboundWebServices.getInboundFaxNumbers(request);

                InboundFaxNosDal inboundFaxNoDal = new InboundFaxNosDal(sqlConnectionString);
                List<InboundFaxNosDto> faxNoList = new List<InboundFaxNosDto>();
                faxNoList = inboundFaxNoDal.GetAll();

                //if ([email protected]("OK"))
                if (faxNoList.Count > 0)
                {
                    dt = new DataTable();
                    //string[] faxNumbers = [email protected];
                    dt.Columns.Add("FAXNO");

                    //foreach (string faxNumber in faxNumbers)
                    foreach (InboundFaxNosDto data in faxNoList)
                    {
                        DataRow dr = dt.NewRow();
                        dr[0] = data.Faxno;
                        dt.Rows.Add(dr);
                    }
                }
                else
                {
                    //throw new Exception("Error getting Inbound Fax Number list: " + [email protected]);
                    throw new Exception("An error occurred while retrieving the Transmission Address list." + Environment.NewLine +
                            "Error CNF-521 in " + FORM_NAME + ".getFaxNumbers().");
                }
            }
            catch (Exception err)
            {
                XtraMessageBox.Show("An error occurred while retrieving the Transmission Address list." + Environment.NewLine +
                       "Error CNF-522 in " + FORM_NAME + ".getFaxNumbers(): " + err.Message,
                     FORM_ERROR_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            return dt;
        }