Пример #1
0
        private int fillSchedule()
        {
            int mycount = 0;

            scheduleTbl = StaticScheduleMdl.scheduleTbl;
            try
            {
                mycount = 1;
                //scheduleTbl = SchedulePCL.GetScheduleTbl().Result;
                if (scheduleTbl == null)
                {
                    mycount     = 3;
                    scheduleTbl = new ScheduleTbl();
                }
                mycount     = 4;
                scheduleMdl = ScheduleMdl.PrepareList(scheduleTbl);
                mycount     = 5;
                scheduleMdl.MoveFreq_Int = scheduleMdl.GetFrequency();
                mycount = 6;
            }
            catch (System.Exception e)
            {
                ExceptioHandler(e.Message, "fillSchedule " + mycount);
            }
            return(1);
        }
Пример #2
0
 public ActionResult Edit([Bind(Include = "Schedule_ID,Sailing_Route,Sailing_Destination,Sailing_DepartureDate,Sailing_ArrivalDate,Space_Available,Space_Size,Sailing_Captain")] ScheduleTbl scheduleTbl)
 {
     if (ModelState.IsValid)
     {
         db.Entry(scheduleTbl).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(scheduleTbl));
 }
Пример #3
0
 public Task <int> SaveItemAsync1(ScheduleTbl item)
 {
     if (item.Id > 0)
     {
         return(database.UpdateAsync(item));
     }
     else
     {
         return(database.InsertAsync(item));
     }
 }
Пример #4
0
        // GET: ScheduleTbls/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ScheduleTbl scheduleTbl = db.ScheduleTbls.Find(id);

            if (scheduleTbl == null)
            {
                return(HttpNotFound());
            }
            return(View(scheduleTbl));
        }
Пример #5
0
 public ActionResult DeleteConfirmed(int id)
 {
     try
     {
         ScheduleTbl scheduleTbl = db.ScheduleTbls.Find(id);
         db.ScheduleTbls.Remove(scheduleTbl);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     catch
     {
         TempData["notice"] = "This schedule has linked to a vessel id, cannot be deleted.";
         return(RedirectToAction("Index"));
     }
 }
Пример #6
0
        protected override async void OnAppearing()
        {
            base.OnAppearing();
            try
            {
                // Reset the 'resume' id, since we just want to re-start here
                ((App)App.Current).ResumeAtScheId = -1;
                // ScheduleMdl sch = await App.scDatabase.GetItemsAsync();
                obj = await App.scDatabase.GetItemsAsync();

                if (obj == null)
                {
                    obj = new ScheduleTbl();
                }
                ScheduleMdl scheduleMdl = ScheduleMdl.PrepareList(obj);
                MyStatsTimePicker.Time = new TimeSpan(scheduleMdl.DayStarts.Ticks);
                MyEndsTimePicker.Time  = new TimeSpan(scheduleMdl.DayEnds.Ticks);
                Spanhour.Text          = scheduleMdl.MoveFreq;

                LblSu.BackgroundColor = scheduleMdl.sunBgColor;
                LblSu.TextColor       = scheduleMdl.sunTxtColor;

                LblMn.BackgroundColor = scheduleMdl.monBgColor;
                LblMn.TextColor       = scheduleMdl.monTxtColor;

                LblTu.BackgroundColor = scheduleMdl.tueBgColor;
                LblTu.TextColor       = scheduleMdl.tueTxtColor;

                LblWe.BackgroundColor = scheduleMdl.wedBgColor;
                LblWe.TextColor       = scheduleMdl.wedTxtColor;

                LblTh.BackgroundColor = scheduleMdl.thuBgColor;
                LblTh.TextColor       = scheduleMdl.thuTxtColor;

                LblFr.BackgroundColor = scheduleMdl.friBgColor;
                LblFr.TextColor       = scheduleMdl.friTxtColor;

                LblSa.BackgroundColor = scheduleMdl.satBgColor;
                LblSa.TextColor       = scheduleMdl.satTxtColor;

                MySliderhour.Value = scheduleMdl.GetFrequency();
            }
            catch (Exception ex)
            {
                StaticMethods.ShowToast(ex.Message);
            }
        }
Пример #7
0
        private async Task <int> fillSchedule()
        {
            try
            {
                scheduleTbl = await App.scDatabase.GetItemsAsync().ConfigureAwait(false);

                if (scheduleTbl == null)
                {
                    scheduleTbl = new ScheduleTbl();
                }
                scheduleMdl = ScheduleMdl.PrepareList(scheduleTbl);
                scheduleMdl.MoveFreq_Int = scheduleMdl.GetFrequency();
            }
            catch (System.Exception e)
            {
                ExceptioHandler();
            }
            return(1);
        }
Пример #8
0
        public ActionResult Create([Bind(Include = "Schedule_ID,Sailing_Route,Sailing_Destination,Sailing_DepartureDate,Sailing_ArrivalDate,Space_Available,Space_Size,Sailing_Captain")] ScheduleTbl scheduleTbl)
        {
            if (ModelState.IsValid)
            {
                if (scheduleTbl.Sailing_ArrivalDate > scheduleTbl.Sailing_DepartureDate)
                {
                    db.ScheduleTbls.Add(scheduleTbl);
                    db.SaveChanges();
                    TempData["notice"] = "You have created a Sailing Schedule successfully";
                    return(RedirectToAction("Index"));
                }
                else
                {
                    TempData["notice"] = "Sailing Arrival Date must be greater than Departure Date";
                    return(View(scheduleTbl));
                }
            }

            return(View(scheduleTbl));
        }
Пример #9
0
        protected override async void OnAppearing()
        {
            base.OnAppearing();
            try
            {
                ((App)App.Current).ResumeAtScheId = -1;
                obj = await App.scDatabase.GetItemsAsync();

                ScheduleMdl scheduleMdl = ScheduleMdl.PrepareList(obj);
                selectnotification = scheduleMdl.AlertTone;
                if (selectnotification == "Default Ringtone")
                {
                    lblRingtone.FontSize       = 17;
                    lblRingtone.FontAttributes = FontAttributes.Bold;
                    lblRingtone.TextColor      = Color.FromHex("#4292f4");
                    lblNotification.FontSize   = lblAlarm.FontSize = 15;
                }
                else if (selectnotification == "Default Alarm")
                {
                    lblAlarm.FontSize        = 17;
                    lblAlarm.FontAttributes  = FontAttributes.Bold;
                    lblAlarm.TextColor       = Color.FromHex("#4292f4");
                    lblNotification.FontSize = lblRingtone.FontSize = 15;
                }
                else
                {
                    lblNotification.FontSize       = 17;
                    lblNotification.FontAttributes = FontAttributes.Bold;
                    lblNotification.TextColor      = Color.FromHex("#4292f4");
                    lblAlarm.FontSize = lblRingtone.FontSize = 15;
                }
            }
            catch (Exception ex)
            {
                StaticMethods.ShowToast(ex.Message);
            }
        }
Пример #10
0
 public Task <int> DeleteItemAsync(ScheduleTbl item)
 {
     return(database.DeleteAsync(item));
 }
Пример #11
0
 public MyActionSheet(ScheduleTbl scobj)
 {
     InitializeComponent();
     obj = scobj;
 }