Exemple #1
0
        /// <summary>
        /// 获取作业报告信息
        /// </summary>
        /// <param name="dr">The dr.</param>
        public DispatchReportInfo(DataRow dr)
            : this()
        {
            this.ID                        = SQLUtil.ConvertInt(dr["ID"]);
            this.Dispatch.ID               = SQLUtil.ConvertInt(dr["DispatchID"]);
            this.Type.ID                   = SQLUtil.ConvertInt(dr["TypeID"]);
            this.Type                      = LookupManager.GetDispatchReportType(this.Type.ID);
            this.FaultCode                 = SQLUtil.TrimNull(dr["FaultCode"]);
            this.FaultDesc                 = SQLUtil.TrimNull(dr["FaultDesc"]);
            this.SolutionCauseAnalysis     = SQLUtil.TrimNull(dr["SolutionCauseAnalysis"]);
            this.SolutionWay               = SQLUtil.TrimNull(dr["SolutionWay"]);
            this.IsPrivate                 = SQLUtil.ConvertBoolean(dr["IsPrivate"]);
            this.ServiceProvider.ID        = SQLUtil.ConvertInt(dr["ServiceProvider"]);
            this.ServiceProvider.Name      = ServiceProviders.GetDescByID(this.ServiceProvider.ID);
            this.SolutionResultStatus.ID   = SQLUtil.ConvertInt(dr["SolutionResultStatusID"]);
            this.SolutionResultStatus.Name = LookupManager.GetSolutionResultStatusDesc(this.SolutionResultStatus.ID);
            this.SolutionUnsolvedComments  = SQLUtil.TrimNull(dr["SolutionUnsolvedComments"]);
            this.DelayReason               = SQLUtil.TrimNull(dr["DelayReason"]);
            this.Comments                  = SQLUtil.TrimNull(dr["Comments"]);
            this.FujiComments              = SQLUtil.TrimNull(dr["FujiComments"]);
            this.Status.ID                 = SQLUtil.ConvertInt(dr["StatusID"]);
            this.Status.Name               = LookupManager.GetDispatchDocStatusDesc(this.Status.ID);

            this.PurchaseAmount       = SQLUtil.ConvertDouble(dr["PurchaseAmount"]); this.ServiceScope = SQLUtil.ConvertBoolean(dr["ServiceScope"]);
            this.ServiceScope         = SQLUtil.ConvertBoolean(dr["ServiceScope"]);
            this.Result               = SQLUtil.TrimNull(dr["Result"]);
            this.IsRecall             = SQLUtil.ConvertBoolean(dr["IsRecall"]);
            this.AcceptanceDate       = SQLUtil.ConvertDateTime(dr["AcceptanceDate"]);
            this.EquipmentStatus.ID   = SQLUtil.ConvertInt(dr["EquipmentStatus"]);
            this.EquipmentStatus.Name = MachineStatuses.GetMachineStatusesDesc(this.EquipmentStatus.ID);
        }
Exemple #2
0
        public void BookAppointment(Appointment appointment)
        {
            List <Appointment> appointments = this.Appointments;

            var isInvalidAppointment = appointments.Any(a => ((a.CustomerFullName == appointment.CustomerFullName ||
                                                               a.ServiceProviderFullName == appointment.ServiceProviderFullName) &&
                                                              a.Time == appointment.Time && a.Day == appointment.Day));

            if (isInvalidAppointment)
            {
                throw new InvalidAppointmentException("Invalid Appointment");
            }

            var isValidCustomer = Customers.Any(c => c.FullName == appointment.CustomerFullName);

            if (!isValidCustomer)
            {
                throw new InvalidCustomerException("Invalid Customer");
            }

            var isValidServiceProvider = ServiceProviders.Any(c => c.FullName == appointment.ServiceProviderFullName);

            if (!isValidServiceProvider)
            {
                throw new InvalidServiceProviderException("Invalid Service Provider");
            }
            this.AddAppointment(appointment);
        }
        /// <summary>
        /// Returns the appropriate authenticated provider based on the parameters
        /// </summary>
        /// <param name="providerType">Service provider</param>
        /// <param name="acc">User account</param>
        /// <returns></returns>
        private static async Task <IFileTransferProvider> getProvider(ServiceProviders providerType, Account acc)
        {
            IFileTransferProvider retval = null;

            switch (providerType)
            {
            case ServiceProviders.Local:
                retval = LocalStorageProvider.Instance();
                break;

            case ServiceProviders.Google:
                retval = await GoogleDriveProvider.Instance(acc as GoogleDriveAccount);

                break;

            case ServiceProviders.DropBox:
                retval = await DropBoxProvider.Instance(acc as DropBoxAccount);

                break;

            case ServiceProviders.OneDrive:
                retval = await OneDriveProvider.Instance(acc as OneDriveAccount);

                break;

            case ServiceProviders.SSH:
                retval = await SSHProvider.Instance(acc as SSHAccount);

                break;
            }
            return(retval);
        }
        public ActionResult Edit(AirlineCappingModel model, Int64 id)
        {
            model.cappingId = id;

            var gdsList = ent.ServiceProviders.ToList();
            ServiceProviders gdsSelect = new ServiceProviders()
            {
                ServiceProviderId = -1, ServiceProviderName = "--Select--"
            };

            gdsList.Insert(0, gdsSelect);

            var      airLineList   = ent.Airlines.ToList();
            Airlines airlineSelect = new Airlines()
            {
                AirlineId = -1, AirlineName = "--Select--"
            };

            airLineList.Insert(0, airlineSelect);

            var   bankList   = ent.Banks.ToList();
            Banks bankSelect = new Banks()
            {
                BankId = -1, BankName = "--Select--"
            };

            bankList.Insert(0, bankSelect);

            var          paymentList   = ent.PaymentModes.ToList();
            PaymentModes paymentSelect = new PaymentModes()
            {
                PaymentModeId = -1, ModeName = "--Select--"
            };

            paymentList.Insert(0, paymentSelect);

            ViewData["GDSList"]         = gdsList;     //defaultProvider.GetGDSInformationList();
            ViewData["AirlineList"]     = airLineList; //defaultProvider.GetAirlineList();
            ViewData["BankList"]        = bankList;    //defaultProvider.GetBankList();
            ViewData["PaymentModeList"] = paymentList; //defaultProvider.GetPaymentModeList();

            //ViewData["GDSList"] = defaultProvider.GetGDSInformationList();
            //ViewData["AirlineList"] = defaultProvider.GetAirlineList();
            //ViewData["BankList"] = defaultProvider.GetBankList();
            //ViewData["PaymentModeList"] = defaultProvider.GetPaymentModeList();

            if (ModelState.IsValid)
            {
                airlineCappingProvider.Edit(model);
                return(View(model));
            }
            else
            {
                return(View());
            }
        }
Exemple #5
0
        public ActionResult AddProviders(long ServiceProviderSysId)
        {
            ServiceProviders task = new ServiceProviders();

            if (task == null)
            {
                return(View(new ServiceProviders()));
            }
            return(View(task));
        }
Exemple #6
0
        public ActionResult Delete(long ServiceProviderSysId)
        {
            ServiceProviders pro = db.ServiceProviderss.Find(ServiceProviderSysId);

            if (pro == null)
            {
                return(NotFound());
            }
            db.Remove(pro);
            db.SaveChanges();
            return(RedirectToAction("Providers"));
        }
        public ActionResult Index()
        {
            var gdsList = ent.ServiceProviders.OrderBy(x => x.ServiceProviderName).ToList();
            ServiceProviders gdsSelect = new ServiceProviders()
            {
                ServiceProviderId = -1, ServiceProviderName = "--Select--"
            };

            gdsList.Insert(0, gdsSelect);
            ViewData["GDSList"] = gdsList;//defaultProvider.GetGDSInformationList();
            // ViewData["AirlineList"] = defaultProvider.GetAirlineList();
            return(View());
        }
Exemple #8
0
        private void ProviderChanged(object sender, SelectionChangedEventArgs e)
        {
            var viewModel = (MainWindowViewModel)DataContext;
            var a         = VisualTreeHelper.GetParent(sender as ComboBox);
            var b         = (a as DockPanel).Children[1];
            var c         = (b as Border).Child;
            var d         = (c as StackPanel).Children[0];

            if ((d as Image).Tag != null)
            {
                ServiceProviders provider = (ServiceProviders)(d as Image).Tag;
                ChangeProviderIconUri(d as Image, (ServiceProviders)(d as Image).Tag);
            }
        }
Exemple #9
0
        protected override async Task SynchronizedStartAsync(CancellationToken cancellationToken)
        {
            if (ActivationGroups == null ||
                ActivationGroups.Count == 0)
            {
                throw new InvalidOperationException($"There's no defined activation group names. Please add at least one it into '{nameof(ActivationGroups)}' property.");
            }

            _logger.Debug("Loading types for activation...");

            foreach (var serviceType in GetServiceTypes())
            {
                var activatable = GetActivatable(serviceType);
                if (!ActivationGroups.Contains(activatable.Group))
                {
                    continue;
                }

                _logger.Write(LogEventLevel.Debug, nameof(ServiceActivator), null,
                              "Setting up service '{ServiceType}' for activation...", serviceType.Name);

                try
                {
                    var container = CreateServiceContainer(serviceType, activatable);
                    var service   = container.GetInstance <IService>();

                    _serviceContainer.Add(service, activatable.Tier);
                    ServiceProviders.Add(serviceType, container);
                }
                catch (Exception ex)
                {
                    _logger.Error(ex, "An error occurred while activating service '{ServiceType}'", serviceType.Name);

                    throw;
                }
            }

            _logger.Debug("Starting service container...");

            await _serviceContainer.StartAsync(cancellationToken);

            _logger.Debug("Service container started");

            await base.SynchronizedStartAsync(cancellationToken);
        }
Exemple #10
0
        private void ChangeProviderIconUri(Image img, ServiceProviders provider)
        {
            var         viewModel = (MainWindowViewModel)DataContext;
            BitmapImage source    = new BitmapImage();

            source.BeginInit();
            source.CacheOption   = BitmapCacheOption.OnLoad;
            source.CreateOptions = BitmapCreateOptions.IgnoreImageCache;

            string providerIconPath = "";

            switch (provider)
            {
            case ServiceProviders.Local:
                providerIconPath = viewModel.LocalIcon;
                break;

            case ServiceProviders.Google:
                providerIconPath = viewModel.GoogleIcon;
                break;

            case ServiceProviders.OneDrive:
                providerIconPath = viewModel.OneDriveIcon;
                break;

            case ServiceProviders.DropBox:
                providerIconPath = viewModel.DropBoxIcon;
                break;

            case ServiceProviders.SSH:
                providerIconPath = viewModel.SSHIcon;
                break;

            default:
                throw new Exception("Invalid provider specified in selected backups source");
            }

            source.UriSource = new Uri(providerIconPath);
            source.EndInit();
            img.Source = source;
        }
        public ActionResult Index(AirlineCappingModel objmodel)
        {
            var gdsList = ent.ServiceProviders.ToList();
            ServiceProviders gdsSelect = new ServiceProviders()
            {
                ServiceProviderId = -1, ServiceProviderName = "--Select--"
            };

            gdsList.Insert(0, gdsSelect);


            ViewData["GDSList"] = gdsList;//defaultProvider.GetGDSInformationList();
            // ViewData["AirlineList"] = defaultProvider.GetAirlineList();

            var model = new AirlineCappingModel
            {
                airlineCappingList = airlineCappingProvider.List(objmodel.ServiceProviderId)
            };

            return(View(model));
        }
Exemple #12
0
        public ActionResult SavePro(ServiceProviders task)
        {
            if (ModelState.IsValid)
            {
                ServiceProviders newTask = new ServiceProviders();
                newTask.ServiceProviderSysId = task.ServiceProviderSysId;
                newTask.Name      = task.Name;
                newTask.CreatedOn = DateTime.Now;
                newTask.UpdatedOn = DateTime.Now;
                newTask.Activated = true;
                newTask.Deleted   = false;
                newTask.ContNo    = "123";
                newTask.Dob       = DateTime.Now;
                newTask.AltContNo = "1234";
                newTask.Email     = task.Email;
                db.ServiceProviderss.Add(newTask);
                db.SaveChanges();
            }

            return(RedirectToAction("Providers"));
        }
        public ActionResult Create()
        {
            var gdsList = ent.ServiceProviders.OrderBy(x => x.ServiceProviderName).ToList();
            ServiceProviders gdsSelect = new  ServiceProviders()
            {
                ServiceProviderId = -1, ServiceProviderName = "--Select--"
            };

            gdsList.Insert(0, gdsSelect);

            var      airLineList   = ent.Airlines.ToList();
            Airlines airlineSelect = new Airlines()
            {
                AirlineId = -1, AirlineName = "--Select--"
            };

            airLineList.Insert(0, airlineSelect);

            var   bankList   = ent.Banks.ToList();
            Banks bankSelect = new Banks()
            {
                BankId = -1, BankName = "--Select--"
            };

            bankList.Insert(0, bankSelect);

            var          paymentList   = ent.PaymentModes.ToList();
            PaymentModes paymentSelect = new PaymentModes()
            {
                PaymentModeId = -1, ModeName = "--Select--"
            };

            paymentList.Insert(0, paymentSelect);

            ViewData["GDSList"]         = gdsList;     //defaultProvider.GetGDSInformationList();
            ViewData["AirlineList"]     = airLineList; //defaultProvider.GetAirlineList();
            ViewData["BankList"]        = bankList;    //defaultProvider.GetBankList();
            ViewData["PaymentModeList"] = paymentList; //defaultProvider.GetPaymentModeList();
            return(View());
        }
Exemple #14
0
 public void AddServiceProvider(ServiceProvider serviceProvider)
 {
     ServiceProviders.Add(serviceProvider);
 }
Exemple #15
0
 public string TodaysEvents()
 {
     var events = new ServiceProviders().GetTodaysEvents();
     int no = 1;
     StringBuilder builder = new StringBuilder(DateTime.Now.Date.ToShortDateString()+ " Events©");
     foreach (var eevent in events)
     {
         builder.Append(no.ToString()+":"+eevent.Title+" At "+eevent.ServiceProvider.OrganizationName+"©");
         no++;
     }
     return builder.ToString();
 }
Exemple #16
0
 public string TodaysEventsAt(int serviceProviderId)
 {
     var events = new ServiceProviders().GetUpcomingEventsAt(serviceProviderId);
     var serviceProviderName =
         context.ServiceProvider.FirstOrDefault(s => s.Id == serviceProviderId).OrganizationName;
     var builder = new StringBuilder("Upcoming events at " + serviceProviderName + "©");
     int no = 1;
     foreach (var @event in events)
     {
         builder.Append(no.ToString(CultureInfo.InvariantCulture) + ":" + @event.Title + "-" + @event.Details + "©");
         no++;
     }
     return builder.ToString();
 }
Exemple #17
0
 public async Task <IActionResult> UpdateProvider([FromBody] ServiceProviders provider)
 {
     return(this.Ok(await _Repo.Update(provider)));
 }