Example #1
0
        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);
        }
Example #2
0
        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);
            }
        }
Example #3
0
        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);
            }
        }
Example #4
0
        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);
        }
Example #5
0
        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);
        }
Example #6
0
        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);
        }
Example #7
0
        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);
        }
Example #8
0
        private void StopTheService(EventsClass obj)
        {
            var intent = new Intent(this, typeof(VirtualNetworkService));

            StopService(intent);
        }
Example #9
0
 private void FetchRequest(EventsClass obj)
 {
     _vm.FetchFiles();
 }
 public static void Main()
 {
     EventsClass.someDelegateEvent += func;
     EventsClass.Raise();
 }