private void AppsListStackPanel_Tap(object sender, System.Windows.Input.GestureEventArgs e)
        {
            var                   click                 = sender as StackPanel;
            AppDetail             mAppDetail            = click.DataContext as AppDetail;
            MarketplaceDetailTask marketplaceDetailTask = new MarketplaceDetailTask();

            marketplaceDetailTask.ContentIdentifier = mAppDetail.MarketplaceID;
            marketplaceDetailTask.Show();
        }
예제 #2
0
        private async void GoToAppSpecificationPage()
        {
            AppDetail param = AppDetail;

            if (AppDetail.AppSpecification != null)
            {
                param = await _developerService.GetDeveloperAppDetailAsync(AppDetail.AppSpecification.AppId);
            }

            _navigationService.Navigate(ViewNames.AppSpecification, param);
        }
        public string AddAppDetails(AppDetail model)
        {
            string returnMessage = string.Empty;

            try
            {
                using (var db = new DBContext())
                {
                    if (ModelState.IsValid)
                    {
                        MachineDetail machineDetail = db.MachineDetails.Find(model.MachineDetailId);
                        if (machineDetail == null)
                        {
                            return("Invalid Machine Id");
                        }

                        var subCategory = db.SubCategory.Where(a => a.SubCategoryName == model.AppName && a.SubCategoryTypeId == 2).FirstOrDefault();
                        if (subCategory == null)
                        {
                            var uncaregorizedId = db.Category.Where(a => a.CategoryName.Trim() == "UnCategorized".Trim()).Select(a => a.CategoryId).FirstOrDefault();
                            subCategory                   = new SubCategory();
                            subCategory.CategoryId        = Convert.ToInt32(uncaregorizedId);
                            subCategory.SubCategoryTypeId = 2;
                            subCategory.SubCategoryName   = model.AppName;
                            subCategory.IsProductive      = false;
                            subCategory.IsBlocked         = false;
                            subCategory.IsActive          = true;
                            subCategory.CreatedDate       = DateTime.Now;
                            subCategory.CreatedBy         = 1;
                            db.SubCategory.Add(subCategory);
                            db.SaveChanges();
                        }

                        db.AppDetails.Add(model);
                        db.SaveChanges();
                        returnMessage = "OK";
                    }
                }
            }
            catch (Exception e)
            {
                returnMessage = e.Message;
                ExceptionHandler handler = new ExceptionHandler();
                handler.HandleException(e);
            }

            return(returnMessage);
        }
        public override void OnNavigatedTo(NavigatedToEventArgs e, Dictionary <string, object> viewModelState)
        {
            if (viewModelState != null)
            {
                base.OnNavigatedTo(e, viewModelState);
            }

            if (e.NavigationMode == NavigationMode.New)
            {
                var param = e.Parameter as AppDetail;

                if (param != null)
                {
                    AppDetail = param;

                    AppPackageSpecification = AppDetail.AppPackageSpecification ?? new AppPackageSpecification();
                }
            }
        }
예제 #5
0
        public override async void OnNavigatedTo(NavigatedToEventArgs e, Dictionary <string, object> viewModelState)
        {
            if (viewModelState != null)
            {
                base.OnNavigatedTo(e, viewModelState);
            }

            if (e.NavigationMode == NavigationMode.New)
            {
                var param = e.Parameter as AppDetail;

                if (param != null)
                {
                    AppDetail = param;
                    AppDetail.AppPlatformSpecification.CpuArchitectureFlags =
                        AppDetail.AppPlatformSpecification.CpuArchitectureFlags ?? DeveloperService.CpuArchitecture.None;
                }
            }
        }
예제 #6
0
        public AppInfo DowloadAppInfoAndResources(string appId = "96138")
        {
            AppInfo   app      = new AppInfo();
            AppDetail appProxy = new AppDetail();
            var       request  = new UrlRequest();
            Dictionary <string, string> parameters = new Dictionary <string, string>();

            parameters["appid"] = appId;

            var appDetailJson = appProxy.GetLiveData(parameters);
            var appInfoModel  = JsonConvert.DeserializeObject <TencentModelBase>(appDetailJson.MakeSureNotNull());

            if (appInfoModel.status == 0)
            {
                appInfoModel.info = appInfoModel.info == null ? string.Empty : appInfoModel.info;
                appInfoModel.info = JsonConvert.DeserializeObject <List <AppInfo> >(appInfoModel.info.ToString());
            }

            var appInfos = appInfoModel.info as List <AppInfo>;

            if (appInfos != null && appInfos.Count > 0)
            {
                MakeSureDIRExist(APK_Folder_Base);
                MakeSureDIRExist(Screenshots_Folder_Base);
                MakeSureDIRExist(Logo_Folder_Base);

                app = appInfos[0];
                foreach (var img in app.images)
                {
                    request.DownloadFile(img, Path.Combine(Screenshots_Folder_Base, GetFileNameFromUri(img)));
                }

                request.DownloadFile(app.logo, Path.Combine(Logo_Folder_Base, GetFileNameFromUri(app.logo)));
                request.DownloadFile(app.apkurl, Path.Combine(APK_Folder_Base, GetFileNameFromUri(app.apkurl)));
            }

            return(app);
        }
예제 #7
0
        public override void OnNavigatedTo(NavigatedToEventArgs e, Dictionary <string, object> viewModelState)
        {
            if (viewModelState != null)
            {
                base.OnNavigatedTo(e, viewModelState);

                if (e.NavigationMode == NavigationMode.Refresh)
                {
                    //// Restores the error collection manually
                    //var errorsCollection = RetrieveEntityStateValue<IDictionary<string, ReadOnlyCollection<string>>>("errorsCollection", viewModelState);

                    //if (errorsCollection != null)
                    //{
                    //    _naturalPerson.SetAllErrors(errorsCollection);
                    //}
                    // elase set defaults
                }
            }

            if (e.NavigationMode == NavigationMode.New)
            {
                AppDetail = e.Parameter as AppDetail ?? new AppDetail();
            }
        }
예제 #8
0
 public static AppDetailDataContract ToAppDetailDataContract(this AppDetail appDetail)
 {
     return(new AppDetailDataContract()
     {
     });
 }
예제 #9
0
 public ContactViewModel(AppDetail appDetail, Contact contact)
     : this(appDetail)
 {
     //this.AppDetail = appDetail;
     this.Contact = contact;
 }
예제 #10
0
 public ContactViewModel(AppDetail appDetail)
 {
     this.AppDetail = appDetail;
 }