public List <EventsClass> GetAllEventsById(int id) { List <EventsClass> li = new List <EventsClass>(); var AllEvents = obj.Events.Where(x => x.Status != 0 && x.Id.Equals(id)).ToList(); var count = AllEvents.Count(); foreach (var details in AllEvents) { EventsClass temp = new EventsClass(); temp.Id = details.Id; temp.Name = details.Name; temp.Place = details.Plcae; temp.Date = details.Date; temp.Time = details.Time; try { temp.TicketPrice = details.TicketPrice.Value; } catch (Exception e) { temp.TicketPrice = 0; } try { temp.Discount = details.Discount.Value; } catch (Exception e) { temp.Discount = 0; } temp.Count = count; li.Add(temp); } return(li); }
private void StartTheService(EventsClass events) { var intent = new Intent(this, typeof(VirtualNetworkService)); if (Android.OS.Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.O) { StartForegroundService(intent); } else { StartService(intent); } }
private void StartUploadService(EventsClass obj) { var intent = new Intent(this, typeof(UploadService)); UploadService.UploadServiceModel = obj.UploadModel; if (Android.OS.Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.O) { StartForegroundService(intent); } else { StartService(intent); } }
public List <EventsClass> GetAllEventsImageById(int id) { List <EventsClass> li = new List <EventsClass>(); var AllEvents = obj.EventImages.Where(x => x.Status != 0 && x.EventId.Equals(id)).ToList(); var count = AllEvents.Count(); foreach (var details in AllEvents) { EventsClass temp = new EventsClass(); temp.Id = details.Id; temp.Image = details.Images; temp.Count = count; li.Add(temp); } return(li); }
public List <EventsClass> GetAllEvents(int id) { int ShowRecords = 20; int skip = id * ShowRecords; var DesiMasala = ""; var AllRecords = obj.Events.Count(); int max = (skip + ShowRecords); if (max > AllRecords) { max = AllRecords; } DesiMasala = (skip + 1).ToString() + "-" + max.ToString() + "/" + AllRecords.ToString(); List <EventsClass> li = new List <EventsClass>(); var AllEvents = obj.Events.Skip(skip).Take(ShowRecords).Where(x => x.Status != 0).ToList(); var count = AllEvents.Count(); foreach (var details in AllEvents) { EventsClass temp = new EventsClass(); temp.Id = details.Id; temp.Name = details.Name; temp.Place = details.Plcae; temp.Date = details.Date; temp.Time = details.Time; try { temp.TicketPrice = details.TicketPrice.Value; } catch (Exception e) { temp.TicketPrice = 0; } try { temp.Discount = details.Discount.Value; } catch (Exception e) { temp.Discount = 0; } temp.Count = count; temp.NumberOfShowing = DesiMasala; li.Add(temp); } return(li); }
public int PostEvent(EventsClass EC) { int check = 0; try { Event events = new Event(); events.Name = EC.Name; events.Plcae = EC.Place; events.Date = EC.Date; events.Time = EC.Time; events.AddDate = DateTime.Now.ToShortDateString(); events.TicketPrice = EC.TicketPrice; events.Discount = EC.Discount; events.Status = 1; obj.Events.InsertOnSubmit(events); obj.SubmitChanges(); check = events.Id; } catch (Exception e) { check = 0; } return(check); }
public int UpdateEvent(EventsClass EC) { int check = 0; try { Event events = obj.Events.First(x => x.Id.Equals(EC.Id)); events.Name = EC.Name; events.Plcae = EC.Place; if (EC.Date != "") { events.Date = EC.Date; } events.Time = EC.Time; events.TicketPrice = EC.TicketPrice; events.Discount = EC.Discount; events.Status = 1; obj.SubmitChanges(); check = events.Id; } catch (Exception e) { check = 0; } return(check); }
private void StopTheService(EventsClass obj) { var intent = new Intent(this, typeof(VirtualNetworkService)); StopService(intent); }
private void FetchRequest(EventsClass obj) { _vm.FetchFiles(); }
public static void Main() { EventsClass.someDelegateEvent += func; EventsClass.Raise(); }