コード例 #1
0
ファイル: frmTimeSlotList.cs プロジェクト: RazenRyne/DCFIv4
        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (timeslotSelected != null)
            {
                TimeslotServiceClient tService = new TimeslotServiceClient();
                string message = String.Empty;

                if (!tService.DeleteTimeslot(timeslotSelected.TimeSlotCode, ref message))
                {
                    message = "Deletion of Timeslot Failed";
                }
                else
                {
                    MessageBox.Show("Deleted succesfully!");
                }
            }
        }
コード例 #2
0
ファイル: frmTimeSlotList.cs プロジェクト: dansalan/DCFIv3
        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (timeslotSelected != null)
            {
                TimeslotServiceClient tService = new TimeslotServiceClient();
                string message = String.Empty;

                if (!tService.DeleteTimeslot(timeslotSelected.TimeSlotCode, ref message))
                {
                    message = "Deletion of Timeslot Failed";
                }
                else
                {
                    MessageBox.Show("Deleted succesfully!");
                }
            }
        }
コード例 #3
0
ファイル: frmTimeSlotList.cs プロジェクト: dansalan/DCFIv3
        public void LoadTimeslots()
        {
            TimeslotServiceClient tService = new TimeslotServiceClient();
            string message = String.Empty;
            try
            {
                var timeslot = tService.GetAllTimeslots();
                timeslotList = new List<Timeslot>(timeslot);
                gvTimeSlot.DataSource = timeslotList;
                gvTimeSlot.Refresh();

                if (gvTimeSlot.RowCount != 0)
                    gvTimeSlot.Rows[0].IsSelected = true;
            }
            catch (Exception ex)
            {
                message = "Error Loading List of Timeslots";
                MessageBox.Show(ex.ToString());
            }
        }
コード例 #4
0
ファイル: frmTimeSlotList.cs プロジェクト: RazenRyne/DCFIv4
        public void LoadTimeslots()
        {
            TimeslotServiceClient tService = new TimeslotServiceClient();
            string message = String.Empty;

            try
            {
                var timeslot = tService.GetAllTimeslots();
                timeslotList          = new List <Timeslot>(timeslot);
                gvTimeSlot.DataSource = timeslotList;
                gvTimeSlot.Refresh();

                if (gvTimeSlot.RowCount != 0)
                {
                    gvTimeSlot.Rows[0].IsSelected = true;
                }
            }
            catch (Exception ex)
            {
                message = "Error Loading List of Timeslots";
                MessageBox.Show(ex.ToString());
            }
        }
コード例 #5
0
        private void SaveUser()
        {
            try
            {
                Boolean ret     = false;
                string  message = String.Empty;

                List <String> list = new List <String>();
                if (chkSunday.Checked == true)
                {
                    list.Add("Su");
                }
                if (chkMonday.Checked == true)
                {
                    list.Add("M");
                }
                if (chkTuesday.Checked == true)
                {
                    list.Add("Tu");
                }
                if (chkWednesday.Checked == true)
                {
                    list.Add("W");
                }
                if (chkThursday.Checked == true)
                {
                    list.Add("Th");
                }
                if (chkFriday.Checked == true)
                {
                    list.Add("F");
                }
                if (chkSaturday.Checked == true)
                {
                    list.Add("S");
                }

                string szDays = string.Empty;
                szDays = string.Join(",", list.ToArray());

                DateTime?dtTimeStart = DateTime.Now;
                DateTime?dtTimeEnd   = DateTime.Now;

                dtTimeStart = tPStart.Value;
                dtTimeEnd   = tpEnd.Value;

                TimeslotServiceClient tService = new TimeslotServiceClient();
                Timeslot timeslot = new Timeslot()
                {
                    TimeSlotCode = txtTimeslotCode.Text,
                    TimeStart    = dtTimeStart.Value.ToString("hh:mm tt"),
                    TimeEnd      = dtTimeEnd.Value.ToString("hh:mm tt"),
                    Days         = szDays
                };

                if (Op.Equals("edit"))
                {
                    timeslot.TimeSlotCode = SelectedTimeslot.TimeSlotCode;
                    ret = tService.UpdateTimeslot(ref timeslot, ref message);
                }
                else
                {
                    ret = tService.CreateTimeslot(ref timeslot, ref message);
                }


                MessageBox.Show("Saved Successfully!");

                Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.ToString());
            }
        }
コード例 #6
0
        private void SaveUser()
        {
            try
            {
                Boolean ret = false;
                string message = String.Empty;

                List<String> list = new List<String>();
                if (chkSunday.Checked == true) list.Add("Su");
                if (chkMonday.Checked == true) list.Add("M");
                if (chkTuesday.Checked == true) list.Add("Tu");
                if (chkWednesday.Checked == true) list.Add("W");
                if (chkThursday.Checked == true) list.Add("Th");
                if (chkFriday.Checked == true) list.Add("F");
                if (chkSaturday.Checked == true) list.Add("S");

                string szDays = string.Empty;
                szDays = string.Join(",", list.ToArray());

                DateTime? dtTimeStart = DateTime.Now;
                DateTime? dtTimeEnd = DateTime.Now;

                dtTimeStart = tPStart.Value;
                dtTimeEnd = tpEnd.Value;

                TimeslotServiceClient tService = new TimeslotServiceClient();
                Timeslot timeslot = new Timeslot()
                {
                    TimeSlotCode = txtTimeslotCode.Text,
                    TimeStart = dtTimeStart.Value.ToString("hh:mm tt"),
                    TimeEnd = dtTimeEnd.Value.ToString("hh:mm tt"),
                    Days = szDays
                };

                if (Op.Equals("edit"))
                {
                    timeslot.TimeSlotCode = SelectedTimeslot.TimeSlotCode;
                    ret = tService.UpdateTimeslot(ref timeslot, ref message);
                }
                else
                    ret = tService.CreateTimeslot(ref timeslot, ref message);


                MessageBox.Show("Saved Successfully!");

                Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.ToString());
            }
        }