public void cargarDatos(int?eventid) { EventOnEntities context = new EventOnEntities(); this.ListBusiness = context.Businesses.ToList(); this.ListCategory = context.Categories.ToList(); tieneValor = false; if (eventid.HasValue) { Event objEvent = context.Events .Include("Business") .Include("Category") .FirstOrDefault(x => x.idEvent == eventid); this.eventID = eventid; objectEvent.idEvent = objEvent.idEvent; objectEvent.name = objEvent.name; objectEvent.place = objEvent.place; objectEvent.date = objEvent.date; objectEvent.Business = objEvent.Business; objectEvent.Category = objEvent.Category; tieneValor = true; } }
public ActionResult Login(LoginViewModel objViewModel) { try { EventOnEntities context = new EventOnEntities(); User objUsuario = context.Users .FirstOrDefault(x => x.userName == objViewModel.userName && x.password == objViewModel.password); if (objUsuario == null) { Console.WriteLine("ZAVAMON"); TempData["MensajeLogin"] = "******"; return(View(objViewModel)); } FormsAuthentication.SetAuthCookie(objUsuario.userName, false); Session["objUsuario"] = objUsuario; return(RedirectToAction("Index", "Home")); } catch (Exception ex) { //Console.WriteLine("ZAVAMON"); TempData["MensajeLoginError"] = "Error! " + ex.Message.ToString(); return(View(objViewModel)); } }
public void RegistrarSector(Sector _objSector) { EventOnEntities context = new EventOnEntities(); _objSector.estado = "A"; context.Sectors.Add(_objSector); context.SaveChanges(); }
public void EliminarEvent(int EventId) { EventOnEntities context = new EventOnEntities(); Event objEvent = context.Events.FirstOrDefault(x => x.idEvent == EventId); objEvent.estado = "I"; context.SaveChanges(); }
public void RegistrarBusiness(Business _objBusiness) { EventOnEntities context = new EventOnEntities(); _objBusiness.estado = "A"; context.Businesses.Add(_objBusiness); context.SaveChanges(); }
public void RegistrarEvento(Event _objEvent) { EventOnEntities context = new EventOnEntities(); _objEvent.estado = "A"; context.Events.Add(_objEvent); context.SaveChanges(); }
public IndexValueViewModel() { EventOnEntities context = new EventOnEntities(); nroBusiness = context.Businesses.Count(); nroEvent = context.Events.Count(); nroSector = context.Sectors.Count(); }
public void EliminarBusiness(int BusinessId) { EventOnEntities context = new EventOnEntities(); Business objBusiness = context.Businesses.FirstOrDefault(x => x.idBusiness == BusinessId); objBusiness.estado = "I"; context.SaveChanges(); }
public void EliminarSector(int sectorId) { EventOnEntities context = new EventOnEntities(); Sector objSector = context.Sectors.FirstOrDefault(x => x.idSector == sectorId); objSector.estado = "I"; context.SaveChanges(); }
public void ModificarSector(Sector _objSector) { EventOnEntities context = new EventOnEntities(); Sector objSector = context.Sectors.FirstOrDefault(x => x.idSector == _objSector.idSector); objSector.sectorName = _objSector.sectorName; objSector.estado = "A"; context.SaveChanges(); }
public bool SectorExiste(string _nombresector) { EventOnEntities context = new EventOnEntities(); Sector objSector = context.Sectors.FirstOrDefault(x => x.sectorName == _nombresector); if (objSector != null) { return(true); } return(false); }
public void fill() { EventOnEntities context = new EventOnEntities(); if (!string.IsNullOrEmpty(Filtro)) { ListSector = context.Sectors .Where(x => x.estado == "A" && x.sectorName.ToUpper().Contains(Filtro.ToUpper())) .ToList(); } }
public bool EventExiste(string _nombreevento) { EventOnEntities context = new EventOnEntities(); Event objEvent = context.Events.FirstOrDefault(x => x.name == _nombreevento); if (objEvent != null) { return(true); } return(false); }
public bool BusinessExiste(string _nombrebusiness) { EventOnEntities context = new EventOnEntities(); Business objBusiness = context.Businesses.FirstOrDefault(x => x.businessName == _nombrebusiness); if (objBusiness != null) { return(true); } return(false); }
public void fill() { EventOnEntities context = new EventOnEntities(); if (!string.IsNullOrEmpty(Filtro)) { ListBusiness = context.Businesses .Where(x => x.estado == "A" && x.businessName.ToUpper().Contains(Filtro.ToUpper())) .ToList(); } }
public void cargarDatos(int?sectorid) { EventOnEntities context = new EventOnEntities(); tieneValor = false; if (sectorid.HasValue) { Sector objSector = context.Sectors.FirstOrDefault(x => x.idSector == sectorid); this.sectorID = sectorid; objectSector.idSector = objSector.idSector; objectSector.sectorName = objSector.sectorName; tieneValor = true; } }
public void ModificarEvent(Event _objEvent) { EventOnEntities context = new EventOnEntities(); Event objEvent = context.Events.FirstOrDefault(x => x.idEvent == _objEvent.idEvent); objEvent.name = _objEvent.name; objEvent.place = _objEvent.place; objEvent.date = _objEvent.date; objEvent.Business = _objEvent.Business; objEvent.Category = _objEvent.Category; objEvent.estado = "A"; context.SaveChanges(); }
public void ModificarBusiness(Business _objBusiness) { EventOnEntities context = new EventOnEntities(); Business objBusiness = context.Businesses.FirstOrDefault(x => x.idBusiness == _objBusiness.idBusiness); objBusiness.businessName = _objBusiness.businessName; objBusiness.RUCNumber = _objBusiness.RUCNumber; objBusiness.businessPhone = _objBusiness.businessPhone; objBusiness.contactName = _objBusiness.contactName; objBusiness.contactPhone = _objBusiness.contactPhone; objBusiness.User = _objBusiness.User; objBusiness.Sector = _objBusiness.Sector; objBusiness.estado = "A"; context.SaveChanges(); }
public void cargarDatos(int?businessid) { EventOnEntities context = new EventOnEntities(); this.ListSectors = context.Sectors.ToList(); this.ListUsers = context.Users.ToList(); tieneValor = false; if (businessid.HasValue) { Business objBusiness = context.Businesses.FirstOrDefault(x => x.idBusiness == businessid); this.businessID = businessid; objectBusiness.idBusiness = objBusiness.idBusiness; objectBusiness.businessName = objBusiness.businessName; objectBusiness.RUCNumber = objBusiness.RUCNumber; objectBusiness.businessPhone = objBusiness.businessPhone; objectBusiness.contactName = objBusiness.contactName; objectBusiness.contactPhone = objBusiness.contactPhone; objectBusiness.User = objBusiness.User; objectBusiness.Sector = objBusiness.Sector; tieneValor = true; } }
public ListEventsViewModel() { EventOnEntities context = new EventOnEntities(); ListEvents = context.Events.Where(x => x.estado == "A").ToList(); }
public ListBusinessViewModel() { EventOnEntities context = new EventOnEntities(); ListBusiness = context.Businesses.Where(x => x.estado == "A").ToList(); }
public ListSectorsViewModel() { EventOnEntities context = new EventOnEntities(); ListSector = context.Sectors.Where(x => x.estado == "A").ToList(); }