public DTO.SupportData GetSupportData(out Library.DTO.Notification notification)
 {
     notification = new Library.DTO.Notification()
     {
         Type = Library.DTO.NotificationType.Success
     };
     DTO.SupportData supportData = new DTO.SupportData();
     try
     {
         Module.Support.DAL.DataFactory support_factory = new Support.DAL.DataFactory();
         supportData.FactoryAreas = support_factory.GetFactoryArea();
         return(supportData);
     }
     catch (Exception ex)
     {
         notification.Type    = Library.DTO.NotificationType.Error;
         notification.Message = ex.Message;
         notification.DetailMessage.Add(ex.Message);
         if (ex.GetBaseException() != null)
         {
             notification.DetailMessage.Add(ex.GetBaseException().Message);
         }
         return(supportData);
     }
 }
Exemple #2
0
        public DTO.SupportData GetSupportData(string formName, out Library.DTO.Notification notification)
        {
            DTO.SupportData data = new DTO.SupportData();
            notification = new Library.DTO.Notification()
            {
                Type = Library.DTO.NotificationType.Success
            };
            data.Factories                       = new List <Support.DTO.Factory>();
            data.MeetingLocations                = new List <DTO.MeetingLocation>();
            data.Users                           = new List <Support.DTO.User2>();
            data.Sales                           = new List <DTO.Sale>();
            data.employeeDepartmentDTOs          = new List <Support.DTO.EmployeeDepartmentDTO>();
            data.TimeRange                       = new List <string>();
            data.SCMAppointmentAttachedFileTypes = new List <Support.DTO.AppointmentAttachedFileType>();

            try
            {
                switch (formName)
                {
                case "calendar":
                    foreach (Support.DTO.MeetingLocation location in supportFactory.GetMeetingLocation())
                    {
                        if (location.MeetingLocationID == 1 || location.MeetingLocationID == 4)     //request Mr Luc AVT VIETNAM SHOWROOM AND AT FACTORY
                        {
                            data.MeetingLocations.Add(new DTO.MeetingLocation()
                            {
                                MeetingLocationID = location.MeetingLocationID, MeetingLocationNM = location.MeetingLocationNM, IsSelected = false
                            });
                        }
                    }
                    data.Factories = supportFactory.GetFactory();
                    break;

                case "editEvent":
                    data.Users = supportFactory.GetUsers2();
                    data.employeeDepartmentDTOs = supportFactory.GetDepartmentDTOs();
                    data.TimeRange = supportFactory.GetTimeRange();
                    data.SCMAppointmentAttachedFileTypes = supportFactory.GetAppointmentAttachedFileType();
                    using (SCMAgendaMngEntities context = CreateContext())
                    {
                        data.Sales = converter.DB2DTO_SaleList(context.SupportMng_Sale_View.Where(o => o.CompanyID.Value != 3).ToList());     // company different than AVT
                    }
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                notification = new Library.DTO.Notification()
                {
                    Message = ex.Message, Type = Library.DTO.NotificationType.Error
                };
            }
            return(data);
        }
Exemple #3
0
        public DTO.SupportData GetOrderSearchFilter(out Library.DTO.Notification notification)
        {
            notification = new Library.DTO.Notification()
            {
                Type = Library.DTO.NotificationType.Success
            };
            DTO.SupportData result = new DTO.SupportData();
            result.SampleOrderStatuses  = new List <Support.DTO.SampleOrderStatus>();
            result.SamplePurposes       = new List <Support.DTO.SamplePurpose>();
            result.SampleTransportTypes = new List <Support.DTO.SampleTransportType>();

            try
            {
                result.SampleOrderStatuses  = supportFactory.GetSampleOrderStatus().ToList();
                result.SamplePurposes       = supportFactory.GetSamplePurpose().ToList();
                result.SampleTransportTypes = supportFactory.GetSampleTransportType().ToList();
            }
            catch (Exception ex)
            {
                notification.Type    = Library.DTO.NotificationType.Error;
                notification.Message = ex.Message;
            }
            return(result);
        }