Exemple #1
0
        public ActionResult ForgotActivate(Guid id)
        {
            MarketUser mrktUser = mrktUserManager.Find(x => x.ActivateGuid == id);

            if (mrktUser != null)
            {
                return(View(mrktUser));
            }

            return(View());
        }
Exemple #2
0
        public string GetCurrentUsername()
        {
            MarketUser user = CurrentSession.User;

            if (user != null)
            {
                return(user.Username);
            }
            else
            {
                return("system");
            }
        }
        public JsonResult Delete(int id)
        {
            OperationResult operation = new OperationResult();

            MarketUser mrktUser = mrktUserManager.Find(x => x.Id == id);

            if (mrktUser != null)
            {
                mrktUserManager.Delete(mrktUser);
                CacheHelper.RemoveCategoriesFromCache();
                operation.Result = true;
                return(Json(operation, JsonRequestBehavior.AllowGet));
            }
            operation.Response += "Kullanıcı Bulunamadı.";
            return(Json(operation, JsonRequestBehavior.AllowGet));
        }
    public void FillUserData(MarketUser mu)
    {
        userName.text              = mu.name;
        userPrice.text             = mu.price.ToString();
        userProfilePic.mainTexture = mu.profilePic;
        if (mu.onlineNow == 0)
        {
            userOn_offSprite.spriteName = "offline";
            HiringManager.Instance.ChangeHiringButton(false);
        }
        else
        {
            userOn_offSprite.spriteName = "online";
            HiringManager.Instance.ChangeHiringButton(true);
        }

        fbID = mu.fbID;
        user = mu;
        HiringManager.Instance.userOnline = mu.onlineNow == 1 ? true : false;
        HiringManager.Instance.UpdateHiringData(mu.kiiID, false);
        //userKiiID = mu.kiiID;
        //HiringManager.Instance.UpdateHiringData (mu.kiiID, true);
    }
Exemple #5
0
        public ActionResult EditProfile(MarketUser model, HttpPostedFileBase ProfileImage)
        {
            ModelState.Remove("ModifiedUsername");
            ModelState.Remove("ModifiedOn");
            if (ModelState.IsValid)
            {
                if (ProfileImage != null &&
                    (ProfileImage.ContentType == "image/jpeg" ||
                     ProfileImage.ContentType == "image/jpg" ||
                     ProfileImage.ContentType == "image/png"))
                {
                    string filename = $"user_{model.Id}.{ProfileImage.ContentType.Split('/')[1]}";

                    ProfileImage.SaveAs(Server.MapPath($"~/Images/MarketUser/{filename}"));
                    model.ProfileImageFilename = filename;
                }

                BusinessLayerResult <MarketUser> res = mrktUserManager.UpdateProfile(model);

                if (res.Errors.Count > 0)
                {
                    ErrorViewModel errorNotifyObj = new ErrorViewModel()
                    {
                        Items          = res.Errors,
                        Title          = "Profil Güncellenemedi.",
                        RedirectingUrl = "/Profile/EditProfile"
                    };

                    return(View("Error", errorNotifyObj));
                }
                CurrentSession.Set <MarketUser>("login", res.Result);

                return(RedirectToAction("ShowProfile"));
            }

            return(View(model));
        }
        public MapControlFrame(MapFrame Map, OutputFrame Output)
        {
            this.Map      = Map;
            this.Output   = Output;
            MapGrid       = Map.MapSpaceGrid;
            MapButtonGrid = Map.ButtonGrid;

            Markets      = new List <Market>();
            MarketFrames = new List <MarketUI>();

            // Setting columns and rows in the grid.

            this.ColumnDefinitions.Add(new ColumnDefinition());
            this.ColumnDefinitions.Add(new ColumnDefinition());
            this.ColumnDefinitions.Add(new ColumnDefinition());
            this.ColumnDefinitions.Add(new ColumnDefinition());
            this.RowDefinitions.Add(new RowDefinition());
            this.RowDefinitions.Add(new RowDefinition());
            this.RowDefinitions.Add(new RowDefinition());
            //this.RowDefinitions.Add(new RowDefinition());
            //this.RowDefinitions.Add(new RowDefinition());
            this.ColumnDefinitions.Add(new ColumnDefinition());
            this.RowDefinitions.Add(new RowDefinition());

            // Creating the map zoom scroll bar.

            MapZoom             = new ScrollBar();
            MapZoom.Minimum     = 0.1;
            MapZoom.Maximum     = 1;
            MapZoom.Scroll     += ScrollEvent;
            MapZoom.Orientation = Orientation.Horizontal;
            MapZoom.Value       = 1;


            // Creating the buttons.

            ShowInfrastructure        = new Button();
            ShowInfrastructure.Click += InfraClick;

            ShowAgencies        = new Button();
            ShowAgencies.Click += AgencyClick;

            ShowCoords         = new Button();
            ShowCoords.Click  += CoordClick;
            ShowCoords.Content = "Coords";

            ShowGov          = new Button();
            ShowGov.Click   += GovClick;
            GovernmentScreen = new GovtScreen();

            // Creating the Markets.

            MarketSelector = new ComboBox();

            for (int i = 0; i < Enum.GetNames(typeof(ItemTypes)).Length; i++)
            {
                MarketSelector.Items.Add(((ItemTypes)i).ToString());
                Debug.WriteLine(((ItemTypes)i).ToString());
                Market    market = new Market((ItemTypes)i, CurrencyTypes.USD, ((ItemTypes)i).ToString() + " USA");
                ItemTypes type   = (ItemTypes)i;
                MarketFrames.Add(new MarketUI(market, (ItemTypes)i));
                Markets.Add(market);
                MarketFrames[i].Hide();
            }

            MarketSelector.SelectionChanged += ItemMarketEvent;

            // Adding items for testing

            MarketUser user = new MarketUser("Campbell Soup");

            Classes.MarketItems.CannedFood cannedFood = new Classes.MarketItems.CannedFood();
            cannedFood.User = user;

            GetProperMarket(ItemTypes.Consumable).ListItem(user, cannedFood);

            // Setting the positions of the UI elements.

            Grid.SetRow(MapZoom, 0);
            Grid.SetColumn(MapZoom, 0);

            Grid.SetRow(ShowInfrastructure, 1);
            Grid.SetColumn(ShowInfrastructure, 0);

            Grid.SetRow(ShowAgencies, 1);
            Grid.SetColumn(ShowAgencies, 1);

            Grid.SetRow(ShowGov, 1);
            Grid.SetColumn(ShowGov, 2);

            Grid.SetRow(ShowCoords, 1);
            Grid.SetColumn(ShowCoords, 3);

            Grid.SetRow(MarketSelector, 1);
            Grid.SetColumn(MarketSelector, 4);

            // Adding the UI elements to the grid.

            this.Children.Add(MapZoom);
            this.Children.Add(ShowInfrastructure);
            this.Children.Add(ShowAgencies);
            this.Children.Add(ShowGov);
            this.Children.Add(MarketSelector);
            this.Children.Add(ShowCoords);

            Button button = (Button)VisualTreeHelper.GetChild(this, 1);

            SetButtonImage(1, TextureFolderLocation + "\\InfrastructureIcon.png");

            button = (Button)VisualTreeHelper.GetChild(this, 2);
            SetButtonImage(2, TextureFolderLocation + "\\EmptyClipboard.png");

            button = (Button)VisualTreeHelper.GetChild(this, 3);
            SetButtonImage(3, TextureFolderLocation + "\\govt.png");
        }
        protected override void Seed(DatabaseContext context)
        {
            MarketUser admin = new MarketUser()
            {
                Name                 = "Yasin",
                Surname              = "Çoban",
                Email                = "*****@*****.**",
                Username             = "******",
                Password             = "******",
                ActivateGuid         = Guid.NewGuid(),
                ProfileImageFilename = "user_boy.png",
                IsActive             = true,
                Role                 = MarketUserRole.Admin,
                Job              = "Admin",
                Facebook         = "https://www.facebook.com/yasiincobaan",
                Instagram        = "https://www.instagram.com/yasiincoban/",
                Twitter          = "null",
                Phone            = "+905425314977",
                RewardScore      = 30,
                CreatedOn        = DateTime.Now,
                CreatedUsername  = "******",
                ModifiedOn       = DateTime.Now.AddMinutes(5),
                ModifiedUsername = "******"
            };

            context.MarketUsers.Add(admin);
            context.SaveChanges();
            for (int i = 0; i < 8; i++)
            {
                MarketUser user = new MarketUser()
                {
                    Name    = FakeData.NameData.GetFirstName(),
                    Surname = FakeData.NameData.GetSurname(),
                    Email   = FakeData.NetworkData.GetEmail(),
                    ProfileImageFilename = "user_boy.png",
                    ActivateGuid         = Guid.NewGuid(),
                    IsActive             = true,
                    Role             = MarketUserRole.Customer,
                    Job              = "User",
                    Username         = $"user{i}",
                    Password         = "******",
                    Facebook         = "https://www.facebook.com/yasiincobaan",
                    Instagram        = "https://www.instagram.com/yasiincoban/",
                    Twitter          = "null",
                    Phone            = "+905425314977",
                    RewardScore      = 30,
                    CreatedOn        = DateTime.Now,
                    CreatedUsername  = "******",
                    ModifiedOn       = DateTime.Now.AddMinutes(5),
                    ModifiedUsername = "******"
                };
                context.MarketUsers.Add(user);
            }
            context.SaveChanges();
            Category catMain = new Category()
            {
                Title            = "Main Category",
                Description      = FakeData.PlaceData.GetAddress(),
                Image            = "cat_1",
                CreatedOn        = DateTime.Now,
                CreatedUsername  = "******",
                ModifiedOn       = DateTime.Now.AddMinutes(5),
                ModifiedUsername = "******"
            };

            context.Categories.Add(catMain);
            context.SaveChanges();
            for (int i = 0; i < 10; i++)
            {
                Category cat = new Category()
                {
                    Title            = FakeData.PlaceData.GetStreetName(),
                    Description      = FakeData.PlaceData.GetAddress(),
                    Image            = "cat_{i}",
                    ParentCategoryId = 1,
                    CreatedOn        = DateTime.Now,
                    CreatedUsername  = "******",
                    ModifiedOn       = DateTime.Now.AddMinutes(5),
                    ModifiedUsername = "******"
                };
                context.Categories.Add(cat);
            }
            context.SaveChanges();
            for (int i = 0; i < 10; i++)
            {
                Product prd = new Product()
                {
                    ProductName       = FakeData.NameData.GetCompanyName(),
                    ProductBrand      = FakeData.NameData.GetCompanyName(),
                    ExchangeRate      = PriceExchangeRate.Dollar,
                    Price             = 1000,
                    DiscountedPrice   = 10,
                    TaxPercent        = 18,
                    Image1            = "prd_1_{i}",
                    Image2            = "prd_2_{i}",
                    Image3            = "prd_3_{i}",
                    Image4            = "prd_4_{i}",
                    Description       = FakeData.PlaceData.GetAddress(),
                    LittleDescription = FakeData.PlaceData.GetAddress(),
                    IsSale            = true,
                    SerialNumber      = FakeData.TextData.GetNumeric(20),
                    StockCode         = FakeData.TextData.GetNumeric(20),
                    StockNumber       = FakeData.NumberData.GetNumber(),
                    CategoryId        = 2,
                    CreatedOn         = DateTime.Now,
                    CreatedUsername   = "******",
                    ModifiedOn        = DateTime.Now.AddMinutes(5),
                    ModifiedUsername  = "******"
                };
                context.Products.Add(prd);
            }
            context.SaveChanges();
        }
Exemple #8
0
        public ActionResult ShowCustomer(string username)
        {
            MarketUser mrktUser = mrktUserManager.Find(x => x.Username == username);

            return(View(mrktUser));
        }