public DamagedItemController()
 {
     unitOfWork          = new UnitOfWork();
     damagedItemServices = new DamagedItemServices(unitOfWork);
     ItemServices        = new ItemServices(unitOfWork);
     storeServices       = new StoreServices(unitOfWork);
 }
 public SubSubStoreController()
 {
     unitOfWork         = new UnitOfWork();
     subSubStoreService = new SubSubStoreServices(unitOfWork);
     storeService       = new StoreServices(unitOfWork);
     subStoreService    = new SubStoreServices(unitOfWork);
 }
Esempio n. 3
0
 public DamagedProductController()
 {
     unitOfWork          = new UnitOfWork();
     damagedItemServices = new DamagedItemServices(unitOfWork);
     storeServices       = new StoreServices(unitOfWork);
     productServices     = new ProductServices(unitOfWork);
 }
        private async void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            MainDisplayFrame.Navigate(typeof(DashboardPage));

            try
            {
                await StoreServices.SetupStoreServices();

                LicenseInformation LicenseInformation = CurrentApp.LicenseInformation;
                StoreServices.CheckFreemiumStatus();
                StoreServices.CheckForPremiumStatus();

                AdVisibility = StoreServices.RemoveAds || StoreServices.IsPremium ? Visibility.Collapsed : Visibility.Visible;
                PremiumFeatures = StoreServices.IsPremium;
   
                _tutorialModels = ConfigurationServices.GetTutorialLinks();
            }
            catch
            {
                //if this fails we want to eat it silently. 
                //we have a backup for tutorials null and 
                //the user doesn't care about telemetry
            }

            this.DataContext = this;
        }
Esempio n. 5
0
 public AnaForm()
 {
     InitializeComponent();
     customerServices         = new CustomerServices();
     promotionalItemsServices = new PromotionalItemsServices();
     participantsServices     = new ParticipantsServices();
     storeServices            = new StoreServices();
 }
 public EmailController()
 {
     UnitOfWork                = new UnitOfWork();
     EmailServices             = new EmailServices(UnitOfWork);
     ItemServices              = new ItemServices(UnitOfWork);
     StoreServices             = new StoreServices(UnitOfWork);
     SubStoreServices          = new SubStoreServices(UnitOfWork);
     SubSubStoreServices       = new SubSubStoreServices(UnitOfWork);
     SubSubSubStoreServices    = new SubSubSubStoreServices(UnitOfWork);
     SubSubSubSubStoreServices = new SubSubSubSubStoreServices(UnitOfWork);
     TransferService           = new TransferService(UnitOfWork);
     UnitServices              = new UnitServices(UnitOfWork);
 }
 private async void ShowPayWall()
 {
     MessageDialog dialog = new MessageDialog(String.Empty);
     dialog.Commands.Add(new UICommand("Go Premium") { Id = 0 });
     dialog.Commands.Add(new UICommand("Stay Free but Weeeaaaakkk") { Id = 1 });
     dialog.Content = "In order to use this feature you must have the Premium Version.";
     dialog.Title = "Woah, hold on partner!";
     var result = await dialog.ShowAsync();
     if(result != null && (int)result.Id == 0 )
     {
         PremiumFeatures = await StoreServices.OpenStorePurchasePremium();
         AdVisibility = StoreServices.RemoveAds || StoreServices.IsPremium ? Visibility.Collapsed : Visibility.Visible;
     }
 }
Esempio n. 8
0
        public ActionResult GetStoreObjects(JQueryDataTableParamModel param)
        {
            try
            {
                IEnumerable <StoreObject> filteredStoreObjects;
                var countG = new StoreServices().GetObjectCount();

                var pagedStoreObjects = GetStores(param.iDisplayLength, param.iDisplayStart);

                if (!string.IsNullOrEmpty(param.sSearch))
                {
                    filteredStoreObjects = new StoreServices().Search(param.sSearch);
                }
                else
                {
                    filteredStoreObjects = pagedStoreObjects;
                }

                if (!filteredStoreObjects.Any())
                {
                    return(Json(new List <StoreObject>(), JsonRequestBehavior.AllowGet));
                }


                var sortColumnIndex = Convert.ToInt32(Request["iSortCol_0"]);
                Func <StoreObject, string> orderingFunction = (c => sortColumnIndex == 1 ? c.StoreName : sortColumnIndex == 2 ? c.CompanyName : sortColumnIndex == 3 ? c.TotalOutlets.ToString(CultureInfo.InvariantCulture) : sortColumnIndex == 1 ? c.BillingCycleCode : c.SubscriptionStatus.ToString());

                var sortDirection = Request["sSortDir_0"]; // asc or desc
                filteredStoreObjects = sortDirection == "asc" ? filteredStoreObjects.OrderBy(orderingFunction) : filteredStoreObjects.OrderByDescending(orderingFunction);

                var displayedUserProfilenels = filteredStoreObjects;
                //Product, SKU, Cost, Quantity In Stock,  Expiry Date
                var result = from c in displayedUserProfilenels
                             select new[] { Convert.ToString(c.StoreId), c.StoreName, c.CompanyName, c.TotalOutlets.ToString(CultureInfo.InvariantCulture), c.BillingCycleCode, c.SubscriptionStatus.ToString() };
                return(Json(new
                {
                    param.sEcho,
                    iTotalRecords = countG,
                    iTotalDisplayRecords = filteredStoreObjects.Count(),
                    aaData = result
                },
                            JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                ErrorLogger.LogError(ex.StackTrace, ex.Source, ex.Message);
                return(Json(new List <StoreObject>(), JsonRequestBehavior.AllowGet));
            }
        }
 public TransferController()
 {
     UnitOfWork                = new UnitOfWork();
     TransferService           = new TransferService(UnitOfWork);
     ItemServices              = new ItemServices(UnitOfWork);
     ProcurementServices       = new ProcurementServices(UnitOfWork);
     StoreServices             = new StoreServices(UnitOfWork);
     SubStoreServices          = new SubStoreServices(UnitOfWork);
     SubSubStoreServices       = new SubSubStoreServices(UnitOfWork);
     SubSubSubStoreServices    = new SubSubSubStoreServices(UnitOfWork);
     SubSubSubSubStoreServices = new SubSubSubSubStoreServices(UnitOfWork);
     TransferTypeServices      = new TransferTypeServices(UnitOfWork);
     UnitServices              = new UnitServices(UnitOfWork);
     ConditionOfItemServices   = new ConditionOfItemServices(UnitOfWork);
 }
Esempio n. 10
0
 public ProcurementController()
 {
     UnitOfWork                 = new UnitOfWork();
     ProcurementServices        = new ProcurementServices(UnitOfWork);
     ProcrurementTypeServices   = new ProcrurementTypeServices(UnitOfWork);
     SupplierCompanyServices    = new SupplierCompanyServices(UnitOfWork);
     StoreService               = new StoreServices(UnitOfWork);
     ItemServices               = new ItemServices(UnitOfWork);
     SubContractCompanyServices = new SubContractCompanyServices(UnitOfWork);
     SubStoreServices           = new SubStoreServices(UnitOfWork);
     SubSubStoreServices        = new SubSubStoreServices(UnitOfWork);
     SubSubSubStoreServices     = new SubSubSubStoreServices(UnitOfWork);
     SubSubSubSubStoreServices  = new SubSubSubSubStoreServices(UnitOfWork);
     conditionOfItemServices    = new ConditionOfItemServices(UnitOfWork);
     warrantyServices           = new WarrantyServices(UnitOfWork);
     countryServices            = new CountryServices(UnitOfWork);
     principleServices          = new PrincipleServices(UnitOfWork);
 }
Esempio n. 11
0
 public ItemController()
 {
     unitOfWork                   = new UnitOfWork();
     itemServices                 = new ItemServices(unitOfWork);
     categoryServices             = new CategoryServices(unitOfWork);
     subCategoryServices          = new SubCategoryServices(unitOfWork);
     subSubCategoryServices       = new SubSubCategoryServices(unitOfWork);
     subSubSubCategoryServices    = new SubSubSubCategoryServices(unitOfWork);
     subSubSubSubCategoryServices = new SubSubSubSubCategoryServices(unitOfWork);
     companyServices              = new CompanyServices(unitOfWork);
     unitServices                 = new UnitServices(unitOfWork);
     storeServices                = new StoreServices(unitOfWork);
     subStoreServices             = new SubStoreServices(unitOfWork);
     subSubStoreServices          = new SubSubStoreServices(unitOfWork);
     subSubSubStoreServices       = new SubSubSubStoreServices(unitOfWork);
     subSubSubSubStoreServices    = new SubSubSubSubStoreServices(unitOfWork);
     BrandServices                = new BrandServices(unitOfWork);
     ModelServices                = new ModelServices(unitOfWork);
 }
Esempio n. 12
0
        public ActionResult DeleteStore(long id)
        {
            var gVal = new GenericValidator();

            try
            {
                if (id < 1)
                {
                    gVal.Code  = -1;
                    gVal.Error = message_Feedback.Invalid_Selection;
                    return(Json(gVal, JsonRequestBehavior.AllowGet));
                }

                List <string> filePathList;
                var           z = new StockUploadServices().DeleteStockUploadByStorItemId(id, out filePathList);
                if (z)
                {
                    gVal.Code = 5;
                    if (filePathList.Count > 0)
                    {
                        filePathList.ForEach(m => DeleteFile(m));
                    }
                }
                var k = new StoreServices().DeleteStore(id);
                if (k)
                {
                    gVal.Code  = 5;
                    gVal.Error = message_Feedback.Delete_Success;
                    return(Json(gVal, JsonRequestBehavior.AllowGet));
                }
                gVal.Code  = -1;
                gVal.Error = message_Feedback.Delete_Failure;
                return(Json(gVal, JsonRequestBehavior.AllowGet));
            }
            catch
            {
                gVal.Code  = 5;
                gVal.Error = message_Feedback.Process_Failed;
                return(Json(gVal, JsonRequestBehavior.AllowGet));
            }
        }
Esempio n. 13
0
        public UserControllerTest()
        {
            _codeDataContext = TestHelpers.GetCodeDataContext();
            AutoMapperConfig.Initialize();
            var mapper        = AutoMapperConfig.GetMapper();
            var userServices  = new UserServices(_codeDataContext, mapper);
            var storeServices = new StoreServices(_codeDataContext, mapper);
            var options       = Options.Create(new LocalizationOptions()); // you should not need any params here if using a StringLocalizer<T>
            var factory       = new ResourceManagerStringLocalizerFactory(options, NullLoggerFactory.Instance);

            var localizer   = new ResourcesServices <CommonResources>(factory);
            var httpContext = new DefaultHttpContext();
            var tempData    = new TempDataDictionary(httpContext, Mock.Of <ITempDataProvider>())
            {
                ["Success"] = localizer.GetLocalizedHtmlString("msg_AddSuccess")
            };

            _userController = new UserController(userServices, storeServices, localizer)
            {
                TempData = tempData
            };
        }
Esempio n. 14
0
        public ActionResult GetStore(long id)
        {
            try
            {
                if (id < 1)
                {
                    return(Json(new StoreObject(), JsonRequestBehavior.AllowGet));
                }

                var store = new StoreServices().GetStore(id);
                if (id < 1)
                {
                    return(Json(new StoreObject(), JsonRequestBehavior.AllowGet));
                }

                Session["_Store"] = store;

                return(Json(store, JsonRequestBehavior.AllowGet));
            }
            catch (Exception)
            {
                return(Json(new StoreObject(), JsonRequestBehavior.AllowGet));
            }
        }
Esempio n. 15
0
 public SignIn()
 {
     InitializeComponent();
     storeServices = new StoreServices();
 }
 private async void NavigationPane_ItemInvoked(NavigationView sender, NavigationViewItemInvokedEventArgs args)
 {
     switch (args.InvokedItem)
     {
         case "Unlock Premium Version $1.99":
             PremiumFeatures = await StoreServices.OpenStorePurchasePremium();
             AdVisibility = StoreServices.RemoveAds || StoreServices.IsPremium ? Visibility.Collapsed : Visibility.Visible;
             break;
         case "Go into Hidden Mode":
             if (!PremiumFeatures)
             {
                 ShowPayWall();
             }
             else
             {
                 MainDisplayFrame.Navigate(typeof(HiddenModeDashboardPage));
             }
             break;
         case "Select Alert Sounds":
             if (!PremiumFeatures)
             {
                 ShowPayWall();
             }
             else
             {
                 MainDisplayFrame.Navigate(typeof(AlertSoundsPage));
             }
             break;
         case "Schedule Active Hours":
             if (!PremiumFeatures)
             {
                 ShowPayWall();
             }
             break;
         case "Define Custom Alert Area":
             if (!PremiumFeatures)
             {
                 ShowPayWall();
             }
             break;
         case "Dashboard":
             if (MainDisplayFrame.CurrentSourcePageType != typeof(DashboardPage) )
             {
                 MainDisplayFrame.Navigate(typeof(DashboardPage));
             }
             break;
         case "About":
             MainDisplayFrame.Navigate(typeof(AboutPage));
             break;
         case "Remove Ads $.99":
             AdVisibility = await StoreServices.OpenStoreRemoveAds() ? Visibility.Collapsed : Visibility.Visible;
             break;
         case "Tutorial":
             Uri youtubeTutorial;
             if (_tutorialModels != null)
             {
                 youtubeTutorial = new Uri(_tutorialModels.TutorialLinkOne);
             }
             else
             {
                 youtubeTutorial = new Uri(@"https://youtu.be/EpaH1thk4IA");
             }
             await Windows.System.Launcher.LaunchUriAsync(youtubeTutorial);
             break;
         default:
             if(args.InvokedItem is NavigationViewItem)
             {
                 if((args.InvokedItem as NavigationViewItem).Content as String == "Settings")
                 {
                     MainDisplayFrame.Navigate(typeof(SettingsPage));
                     break;
                 }
             }
             else if (MainDisplayFrame.CurrentSourcePageType != typeof(DashboardPage))
             {
                 MainDisplayFrame.Navigate(typeof(DashboardPage));
             }
             break;
     }
 }
Esempio n. 17
0
        public async Task <ActionResult> Subscribe(StoreObject store)
        {
            var gVal = new GenericValidator();

            try
            {
                if (store == null)
                {
                    gVal.Code  = -1;
                    gVal.Error = message_Feedback.Model_State_Error;
                    return(Json(gVal, JsonRequestBehavior.AllowGet));
                }

                if (store.IsTrial)
                {
                    var secondndResult = ValidateTrial(store);
                    if (secondndResult.Code < 1)
                    {
                        gVal.Code  = -1;
                        gVal.Error = secondndResult.Error;
                        return(Json(gVal, JsonRequestBehavior.AllowGet));
                    }
                }

                else
                {
                    var valStatus = ValidateSubscription(store);
                    if (valStatus.Code < 1)
                    {
                        gVal.Code  = -1;
                        gVal.Error = valStatus.Error;
                        return(Json(gVal, JsonRequestBehavior.AllowGet));
                    }
                }

                store.SecreteKey  = Guid.NewGuid().ToString().Replace("-", "");
                store.DateCreated = DateTime.Today;
                store.LastUpdated = DateTime.Today;
                store.StoreAlias  = store.StoreAlias.Trim().ToLower();
                var storeId = new StoreServices().AddStore(store);

                if (storeId < 1)
                {
                    gVal.Code  = -1;
                    gVal.Error = storeId == -2 ? message_Feedback.Subscription_Failure : storeId == -3 ? message_Feedback.Store_Name_Error_2 : message_Feedback.company_Name_Duplicate;
                    return(Json(gVal, JsonRequestBehavior.AllowGet));
                }

                store.StoreId = storeId;
                var dbName           = "SHPKPR" + store.StoreId;
                var dbCreationStatus = CreateDB(dbName, store);
                if (!dbCreationStatus)
                {
                    DeleteStore(store.StoreId);
                    gVal.Code  = -1;
                    gVal.Error = message_Feedback.Subscription_Failure;
                    return(Json(gVal, JsonRequestBehavior.AllowGet));
                }

                var subHistId = AddSubscriptionHistory(store);
                if (subHistId < 1)
                {
                    DeleteStore(store.StoreId);
                    DropDatabase(_dbConnection);
                    gVal.Code  = -1;
                    gVal.Error = message_Feedback.Subscription_Failure;
                    return(Json(gVal, JsonRequestBehavior.AllowGet));
                }

                gVal.Code         = 5;
                gVal.StoreAddress = store.StoreAlias + _domainExtension;
                gVal.StoreAlias   = store.StoreAlias;
                gVal.CompanyName  = store.CompanyName;
                gVal.StoreName    = store.StoreName;
                gVal.IsTrial      = store.IsTrial;
                gVal.CurrencyCode = store.DefaultCurrency;
                //gVal.ReferenceCode = store.SecreteKey;
                gVal.PackageName   = store.PackageName;
                gVal.Magnitude     = store.Amount;
                gVal.Duration      = store.Duration;
                gVal.PaymentOption = store.PaymentOption;
                gVal.Gx            = store.StoreId;

                if (store.IsBankOption)
                {
                    gVal.Error = message_Feedback.Subscription_Success_2;
                }
                if (!store.IsBankOption && !store.IsTrial)
                {
                    gVal.Error = message_Feedback.Subscription_Success_3;
                }
                return(Json(gVal, JsonRequestBehavior.AllowGet));
            }
            catch
            {
                gVal.Code  = -1;
                gVal.Error = message_Feedback.Process_Failed;
                return(Json(gVal, JsonRequestBehavior.AllowGet));
            }
        }
 public StoresController(StoreServices storeService)
 {
     _storeService = storeService;
 }