public ActionResult OzellikVer(int ID, UrunOzellik oz)
 {
     using (eTicaretEntities db = new eTicaretEntities())
     {
         var result = db.UrunOzelliks.Where(x => x.OzellikDegerID == oz.OzellikDegerID && x.OzellikTipID == oz.OzellikTipID && x.UrunID == ID).FirstOrDefault();
         if (result == null)
         {
             ViewBag.Hata = "Daha önceden bu ürüne bu özellik yüklenmiş tekrar yüklenemez.";
         }
         var urun = db.Urunlers.Where(x => x.ID == ID).SingleOrDefault();
         if (urun == null)
         {
             return(HttpNotFound());
         }
         else
         {
             InfoVM info = new InfoVM();
             db.UrunOzelliks.Add(oz);
             oz.UrunID    = ID;
             info.Message = "Özellik başarıyla eklendi";
             db.SaveChanges();
             info.Statu    = true;
             info.LinkText = "Geri dönmek için tıklayınız";
             info.Url      = "/Admin/OzellikTip/UrunListesi";
             return(View("_info", info));
         }
     }
 }
예제 #2
0
 public InfoPage()
 {
     InitializeComponent();
     HistoryIconConverter.Converter = new HistoryToIconConverter();
     ViewModel = new InfoVM();
     refreshAll();
 }
        public IActionResult Index(bool?r)
        {
            InfoVM model = new InfoVM();

            if (r == null)
            {
                r = true;
            }

            int Id = Autentification.GetLoggedUser(HttpContext).Id;

            model.ActiveTickets      = ticketRepository.GetTickets(Id).Where(x => x.Active).Count();
            model.DayActiveTickets   = ticketRepository.GetTickets(Id).Where(x => x.Active && x.Date.Day == DateTime.Now.Day).Count();
            model.AverageRating      = reviewRepository.AverageRating(Id);
            model.LatestReviews      = reviewRepository.GetReviews(Id).Take(4);
            model.LatestTickets      = ticketRepository.GetTickets(Id).Take(10);
            model.MonthAverageRating = reviewRepository.MonthAverageRating(Id);
            model.MonthTicketsSold   = ticketRepository.GetMonthSum(Id);
            model.MonthTotal         = ticketRepository.GetMonthTotal(Id);
            model.result             = Convert.ToBoolean(r);
            model.TicketsSold        = ticketRepository.GetSum(Id);
            model.Total = ticketRepository.GetTotal(Id);

            return(View("Index", model));
        }
예제 #4
0
        public override IEnumerable <HealthCheckStatus> GetStatus()
        {
            var info = new InfoVM();


            FixAllContent(ref info, fix: false);

            var descripcion = string.Format("Found {0} of {1} vorto properties in {2} content items. {3} errors.",
                                            info.vortoPropiedades, info.total, info.totalContent, info.errores.Count);

            foreach (var item in info.errores)
            {
                descripcion += "<br/>" + item;
            }

            return(new HealthCheckStatus("Vorto Properties")
            {
                ResultType = StatusResultType.Info,
                Description = descripcion,
                Actions = new HealthCheckAction("Fix", this.Id)
                {
                    Name = "Fix"
                }.AsEnumerableOfOne <HealthCheckAction>()
            }.AsEnumerableOfOne <HealthCheckStatus>());
        }
        public IActionResult Info(int id)
        {
            InfoVM model = new InfoVM()
            {
                CharacterId = id,
            };

            return(PartialView("_Info", model));
        }
예제 #6
0
        public MenuVM()
        {
            tableVM    = new TableVM();
            accountVM  = new AccountVM();
            settingsVM = new SettingsVM();
            infoVM     = new InfoVM();

            CurrentActionVM = tableVM;

            // Повесить команды на MenuButtonClick
            MenuButtonClick = new RelayCommand(ClickExecute);
        }
        public ActionResult Info()
        {
            var currentUser = db.Users.Find(User.Identity.GetUserId());
            var model       = new InfoVM()
            {
                DOB       = currentUser.DateOfBirth.ToShortDateString(),
                Email     = currentUser.Email,
                FirstName = currentUser.FirstName,
                LastName  = currentUser.LastName
            };

            return(View(model));
        }
예제 #8
0
        public void FixAllContent(ref InfoVM info, bool fix = true)
        {
            var rootContent = _contentService.GetRootContent().ToList();

            //pruebas
            //var rootContent = new List<IContent>();
            //rootContent.Add(_contentService.GetById(1379));

            foreach (var item in rootContent)
            {
                FixContent(item, ref info, fix: fix);
            }
        }
 public ActionResult Create(UrunOzellikTipVM model)
 {
     using (eTicaretEntities db = new eTicaretEntities())
     {
         InfoVM info = new InfoVM();
         db.UrunOzellikTips.Add(model.Tip);
         info.Message = model.Tip.Adi + " başarıyla eklendi.";
         db.SaveChanges();
         info.Statu    = true;
         info.LinkText = "Geri dön";
         info.Url      = "/UrunOzellikTip/List";
         return(View("_info", info));
     }
 }
        public IActionResult Index()
        {
            InfoVM model = new InfoVM();

            model.MuseumsRegistrated  = museumRepository.MuseumsRegistrated();
            model.MuseumsRegMonth     = museumRepository.MuseumsRegMonth();
            model.TicketsRevenue      = 0;
            model.TicketsRevenueMonth = 0;
            model.TicketsSale         = 0;
            model.TicketsSaleMonth    = 0;
            model.UsersRegistrated    = clientRepository.GetRegClients();
            model.UsersRegMonth       = clientRepository.GetRegClientsMonth();
            model.ActiveMuseums       = 0;
            model.InactiveMuseums     = 0;

            model.museumTicketSales = new List <MuseumTicketSale>();

            IEnumerable <Museums> museums = museumRepository.GetMuseums();

            museums = museums.Where(x => x.OnlineTickets).ToList();

            foreach (Museums x in museums)
            {
                int total = ticketRepository.GetSum(x.UserId);
                model.museumTicketSales.Add(new MuseumTicketSale
                {
                    Museum   = x.Name,
                    Quantity = total
                });

                if (x.User.Active)
                {
                    model.ActiveMuseums++;
                }
                else
                {
                    model.InactiveMuseums++;
                }

                model.TicketsSale         += total;
                model.TicketsSaleMonth    += ticketRepository.GetMonthSum(x.UserId);
                model.TicketsRevenue      += ticketRepository.GetTotal(x.UserId);
                model.TicketsRevenueMonth += ticketRepository.GetMonthTotal(x.UserId);
            }
            model.TotalMuseumTicketSales = model.museumTicketSales.Select(x => x.Quantity).Sum();

            return(View(model));
        }
        public ActionResult CreateOrUpdateInfo(InfoVM info)
        {
            MVCLogin_dbEntities infodb = new MVCLogin_dbEntities();
            var personDetails          = infodb.People.Where(b => b.ID == info.PersonId).SingleOrDefault();
            var infoDetails            = infodb.Infoes.Where(b => b.PersonId == personDetails.ID).SingleOrDefault();

            if (personDetails != null && infoDetails != null)
            {
                string oldpass = "";
                oldpass                      = personDetails.Password;
                infoDetails.TelNo            = info.TelNo;
                currentInfoVM.TelNo          = info.TelNo;
                infoDetails.CellNo           = info.CellNo;
                currentInfoVM.CellNo         = info.CellNo;
                infoDetails.AddressLine1     = info.AddressLine1;
                currentInfoVM.AddressLine1   = info.AddressLine1;
                infoDetails.AddressLine2     = info.AddressLine2;
                currentInfoVM.AddressLine2   = info.AddressLine2;
                infoDetails.AddressLine3     = info.AddressLine3;
                currentInfoVM.AddressLine3   = info.AddressLine3;
                infoDetails.AddressCode      = info.AddressCode;
                currentInfoVM.AddressCode    = info.AddressCode;
                infoDetails.PostalAddress1   = info.PostalAddress1;
                currentInfoVM.PostalAddress1 = info.PostalAddress1;
                infoDetails.PostalAddress2   = info.PostalAddress2;
                currentInfoVM.PostalAddress2 = info.PostalAddress2;
                infoDetails.PostalCode       = info.PostalCode;
                currentInfoVM.PostalCode     = info.PostalCode;

                if (info.Password != null)
                {
                    personDetails.Password = info.Password;
                }
                else
                {
                    personDetails.Password = oldpass;
                }

                if (ModelState.IsValid)
                {
                    infodb.SaveChanges();
                    return(Json(true, JsonRequestBehavior.AllowGet));
                }
            }

            return(Json(false, JsonRequestBehavior.AllowGet));
        }
예제 #12
0
 public ActionResult Authorize(Person personModel, LoginVM loginModel, InfoVM infoModel)
 {
     using (MVCLogin_dbEntities infodb = new MVCLogin_dbEntities())
     {
         personModel.UserName = loginModel.UserName;
         personModel.Password = loginModel.Password;
         int    usernameLength  = personModel.UserName.Length;
         string initial         = personModel.UserName[0].ToString();
         string surname         = personModel.UserName.Substring(1, usernameLength - 1);
         MVCLogin_dbEntities db = new MVCLogin_dbEntities(); // Person Table
         var personDetails      = db.People.Where(x => x.Name.Substring(0, 1) == initial.ToString() && x.Surname == surname && x.Password == personModel.Password).FirstOrDefault();
         if (personDetails == null)
         {
             loginModel.LoginErrorMessage = "Wrong username or password.";
             return(View("Index", loginModel));
         }
         else
         {
             var infoDetails = infodb.Infoes.Where(x => x.PersonId == personDetails.ID).FirstOrDefault();
             Session["userID"]        = personDetails.ID;
             infoModel.Name           = personDetails.Name;
             infoModel.Surname        = personDetails.Surname;
             infoModel.Password       = personDetails.Password;
             infoModel.PersonId       = personDetails.ID;
             infoModel.TelNo          = infoDetails.TelNo;
             infoModel.CellNo         = infoDetails.CellNo;
             infoModel.AddressLine1   = infoDetails.AddressLine1;
             infoModel.AddressLine2   = infoDetails.AddressLine2;
             infoModel.AddressLine3   = infoDetails.AddressLine3;
             infoModel.AddressCode    = infoDetails.AddressCode;
             infoModel.PostalAddress1 = infoDetails.PostalAddress1;
             infoModel.PostalAddress2 = infoDetails.PostalAddress2;
             infoModel.PostalCode     = infoDetails.PostalCode;
             // get prev login date
             if (personDetails.LastLogin != null)
             {
                 var prevLogin = personDetails.LastLogin;
             }
             // update with current login time
             personDetails.LastLogin = DateTime.Now;
             db.SaveChanges();
             infodb.SaveChanges();
             return(RedirectToAction("GetInfo", "Info", infoModel));
         }
     }
 }
예제 #13
0
        // fix
        public override HealthCheckStatus ExecuteAction(HealthCheckAction action)
        {
            var info = new InfoVM();

            FixAllContent(ref info, fix: true);

            var descripcion = string.Format("Fixed {0} of {1} vorto properties in {2} content items. {3} errors.",
                                            info.vortoPropiedades, info.total, info.totalContent, info.errores.Count);

            foreach (var item in info.errores)
            {
                descripcion += "<br/>" + item;
            }

            return(new HealthCheckStatus("Done")
            {
                Description = descripcion
            });
        }
예제 #14
0
        public ActionResult InfoDetails(int id, int placeId)
        {
            var info = getInfoEntity(id, placeId);
            var vm   = new InfoVM
            {
                Id         = id,
                Category   = info.category.Name,
                Content    = info.content,
                FromUser   = info.user.FullName,
                EndTime    = info.endTime,
                Time       = info.time,
                Lat        = info.place.Location.Latitude,
                Lng        = info.place.Location.Longitude,
                PlaceId    = info.placeId,
                PlaceName  = info.place.Name,
                Reputation = info.GetReputation(),
                Comments   = getInfoComments(info),
            };

            return(View(vm));
        }
예제 #15
0
        public ActionResult ResimEkle(int ID, HttpPostedFileBase txtFoto, string name)
        {
            using (eTicaretEntities db = new eTicaretEntities())
            {
                var model = db.Urunlers.Where(x => x.ID == ID).SingleOrDefault();
                if (model == null)
                {
                    return(HttpNotFound());
                }
                if (txtFoto != null)
                {
                    InfoVM   bilgi   = new InfoVM();
                    WebImage img     = new WebImage(txtFoto.InputStream);
                    FileInfo info    = new FileInfo(txtFoto.FileName);
                    string   newFoto = Guid.NewGuid().ToString() + info.Extension;
                    img.Resize(600, 300);
                    img.Save("~/Upload/UrunFoto/" + newFoto);
                    Resimler r = new Resimler()
                    {
                        OrtaYol    = "/Upload/UrunFoto/" + newFoto,
                        Varsayilan = true,
                        UrunID     = model.ID
                    };
                    //bilgi.Message = "Fotoğraf ekleme başarılı";
                    db.Resimlers.Add(r);
                    db.SaveChanges();
                    //bilgi.Statu = true;
                    //bilgi.Url = "/Urunler/List";
                    //bilgi.LinkText = "Geri dönmek için tıklayınız.";

                    return(View(model));
                }
                else
                {
                    ViewBag.Hata = "Resim ekleme başarısız";
                    return(View());
                }
            }
        }
        public ActionResult GetInfo(InfoVM infoModel)
        {
            MVCLogin_dbEntities infodb = new MVCLogin_dbEntities();

            // query for getting data from database from joining two tables and storing data in infolist
            var infolist = (from Pers in infodb.People
                            join Inf in infodb.Infoes on Pers.ID equals Inf.PersonId
                            select new
                            { Pers.Name, Pers.Surname, Pers.Password, Inf.TelNo, Inf.CellNo, Inf.AddressLine1, Inf.AddressLine2, Inf.AddressLine3, Inf.AddressCode, Inf.PostalAddress1, Inf.PostalAddress2, Inf.PostalCode, Inf.PersonId });

            //Using foreach loop to fill data from infolist to List<InfoVM>
            foreach (var item in infolist)
            {
                if (item.Name == infoModel.Name && item.Surname == infoModel.Surname && infoModel.Password == item.Password)
                {
                    currentInfoVM.Name           = item.Name;
                    currentInfoVM.Surname        = item.Surname;
                    currentInfoVM.TelNo          = item.TelNo;
                    currentInfoVM.CellNo         = item.CellNo;
                    currentInfoVM.AddressLine1   = item.AddressLine1;
                    currentInfoVM.AddressLine2   = item.AddressLine2;
                    currentInfoVM.AddressLine3   = item.AddressLine3;
                    currentInfoVM.AddressCode    = item.AddressCode;
                    currentInfoVM.PostalAddress1 = item.PostalAddress1;
                    currentInfoVM.PostalAddress2 = item.PostalAddress2;
                    currentInfoVM.PostalCode     = item.PostalCode;
                    currentInfoVM.PersonId       = item.PersonId;
                }
            }
            // Send List of InfoVM (ViewModel) to view
            if (infoModel.Name != null)
            {
                return(RedirectToAction("Index"));
            }
            else
            {
                return(RedirectToAction("Index", "Login"));
            }
        }
        // GET: Reporte
        public ActionResult Index()
        {
            InfoVM resultado = new InfoVM();

            return(View(resultado));
        }
예제 #18
0
 public DATArefreshi(InfoVM IVM)
 {
     _iVM = IVM;
 }
예제 #19
0
        public void FixContent(IContent content, ref InfoVM info, bool fix = true)
        {
            var properties = content
                             .Properties
                             //.Where(x => x.PropertyType.PropertyEditorAlias == "Umbraco.Label")
                             .ToList();

            if (properties.Any())
            {
                info.totalContent++;
            }

            var tipoContenido = content.ContentType.Alias;

            foreach (var property in properties)
            {
                var propertyAlias = property.Alias;
                info.total++;
                var stringValue = property.GetValue().TryConvertTo <string>();
                if (string.IsNullOrWhiteSpace(stringValue.Result) && property.Values.Any())
                {
                    //stringValue = property.Values.First().PublishedValue.TryConvertTo<string>();
                    stringValue = property.Values.First().EditedValue.TryConvertTo <string>();
                }

                if (stringValue.Success)
                {
                    if (!string.IsNullOrWhiteSpace(stringValue.Result))
                    {
                        if (stringValue.Result.DetectIsJson() && stringValue.Result.ToLower().Contains("dtdGuid".ToLower()))
                        {
                            var valor = JsonConvert.DeserializeObject <VortoValue>(stringValue.Result);
                            if (valor == null)
                            {
                                var mensajeError = "Its not possible to convert to VortoValue this property: " + propertyAlias + " of " + tipoContenido;
                                if (!info.errores.Contains(mensajeError))
                                {
                                    info.errores.Add(mensajeError);
                                }
                            }
                            else
                            {
                                info.vortoPropiedades++;
                                if (!content.ContentType.VariesByCulture())
                                {
                                    var mensajeError = "This content type " + tipoContenido + " is not allowed to change variant by culture and it has Vorto properties.";
                                    if (!info.errores.Contains(mensajeError))
                                    {
                                        info.errores.Add(mensajeError);
                                    }
                                }
                                if (fix)
                                {
                                    foreach (var valorIdioma in valor.Values)
                                    {
                                        try
                                        {
                                            content.SetValue(propertyAlias, valorIdioma.Value, culture: valorIdioma.Key);
                                        }
                                        catch (Exception ex)
                                        {
                                            var ex2 = new Exception("Error saving content " + content.Id + ", property: " + propertyAlias + ". " + ex.Message, ex);
                                            throw ex2;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }

            if (fix && content.IsDirty())
            {
                if (content.Published)
                {
                    _contentService.SaveAndPublish(content);
                }
                else
                {
                    _contentService.Save(content);
                }
            }

            long totalChildren;
            IEnumerable <IContent> children = _contentService.GetPagedChildren(content.Id, 0, 10000, out totalChildren);

            foreach (var child in children)
            {
                FixContent(child, ref info, fix: fix);
            }
        }