Ejemplo n.º 1
0
        private void btnSaveAndClose_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            OnOkButton();
            if (scheduleId.Text.Trim() == "0")
            {
                ScheduleServices scheduleServices = new ScheduleServices();
                String[]         listDepartment   = checkedComboBoxEditDepartments.EditValue.ToString().Split(',');
                for (int i = 0; i < listDepartment.Length; i++)
                {
                    if (listDepartment[i].Trim() != "")
                    {
                        ScheduleDepartment schedule = new ScheduleDepartment();
                        schedule.idSchedule   = scheduleServices.getLastScheduleId();
                        schedule.idDepartment = Int32.Parse(listDepartment[i]);
                        scheduleServices.createScheduleForDepartment(schedule);
                    }
                }

                String[] listPosition = checkedComboBoxEditPosition.EditValue.ToString().Split(',');
                for (int i = 0; i < listPosition.Length; i++)
                {
                    if (listPosition[i].Trim() != "")
                    {
                        SchedulePosition schedule = new SchedulePosition();
                        schedule.idPosition = Int32.Parse(listPosition[i]);
                        schedule.idSchedule = scheduleServices.getLastScheduleId();
                        scheduleServices.createSchedulePosition(schedule);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void schedulerDataStorage_AppointmentsChanged(object sender, PersistentObjectsEventArgs e)
        {
            try
            {
                //ScheduleServices scheduleServices = new ScheduleServices();
                //scheduleServices.getLastScheduleId();
                // int ids =  Int32.Parse(giaDinhUniversityDataSet.Schedule.Count.ToString());
                //Console.WriteLine("----------------------------------------------------->" + giaDinhUniversityDataSet.Tables[0].Rows[ids]["UniqueID"].ToString());
                //MessageBox.Show("2");
                //if (justSync == false)
                //{
                //justSync = true;
                scheduleTableAdapter.Update(giaDinhUniversityDataSet);
                giaDinhUniversityDataSet.AcceptChanges();

                ScheduleServices scheduleServices = new ScheduleServices();
                NodeJSServices   nodeJSServices   = new NodeJSServices();
                Schedule         schedule         = scheduleServices.getLastSchedule(this._account);
                if (schedule != null)
                {
                    nodeJSServices.addScheduleToNodejs(schedule, _account.UserName);
                }
                //}
            }
            catch
            {
            }
        }
        public void Test_ScheduleServices_Post_A_Task()
        {
            try
            {
                /* Creates new user */
                UserServices us      = new UserServices();
                UserModel    NewUser = new UserModel()
                {
                    UserName  = "******",
                    firstname = "Kajsa",
                    lastname  = "Anka"
                };
                us.Post(NewUser);

                /* Creates new ScheduleModel */
                ScheduleServices ss       = new ScheduleServices();
                ScheduleModel    Schedule = new ScheduleModel()
                {
                    fromDateAndTime = "2016-05-21 08:00:00",
                    toDateAndTime   = "2016-05-21 12:00:00",
                    available       = false
                };
                ss.Post(Schedule, NewUser.UserName);
            }
            catch (Exception e)
            {
                Assert.Fail("Expected no exception, but got " + e.Message);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="apiBaseUrl"></param>
        /// <param name="primarySubscriptionKey"></param>
        /// <param name="secondarySubscriptionKey"></param>
        public FantasySoccerClient(string primarySubscriptionKey, string secondarySubscriptionKey)
        {
            Uri statApiBaseUrl       = SoccerConfig.StateApiBaseUrl;
            Uri scoreApiBaseUrl      = SoccerConfig.ScoreApiBaseUrl;
            Uri ProjectionApiBaseUrl = SoccerConfig.ProjectionApiBaseUrl;

            AreaServices        = new AreaServices(statApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
            CompetitionServices = new CompetitionServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
            SeasonServices      = new SeasonServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
            BoxScoreServices    = new BoxScoreService(statApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
            GameServices        = new GameServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
            MembershipServices  = new MembershipServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);

            PlayerGameStatServices   = new PlayerGameStatServices(statApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
            PlayerSeasonStatServices = new PlayerSeasonStatServices(statApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
            PlayerServices           = new PlayerServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
            ScheduleServices         = new ScheduleServices(statApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
            SeasonServices           = new SeasonServices(statApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
            StandingServices         = new StandingServices(statApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
            TeamGameServices         = new TeamGameServices(statApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
            TeamSeasonService        = new TeamSeasonService(statApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
            TeamServices             = new TeamServices(statApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
            VenueServices            = new VenueServices(statApiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);

            ProjectionServices = new ProjectionServices(ProjectionApiBaseUrl.AbsoluteUri, SoccerConfig.ProjectionPrimarySubscriptionKey, SoccerConfig.ProjectionSecondarySubscriptionKey);
        }
        public void Test_ScheduleServices_Post_A_Invalid_Task_With_Wrong_Format()
        {
            try
            {
                /* Creates new user */
                UserServices us      = new UserServices();
                UserModel    NewUser = new UserModel()
                {
                    UserName  = "******",
                    firstname = "Kicki",
                    lastname  = "Anka"
                };
                us.Post(NewUser);

                /* Creates new ScheduleModel */
                ScheduleServices ss       = new ScheduleServices();
                ScheduleModel    Schedule = new ScheduleModel()
                {
                    fromDateAndTime = "2016-05-21 08:00",
                    toDateAndTime   = "2016-05-21 12:00",
                    available       = false
                };
                string Return = ss.Post(Schedule, NewUser.UserName);

                Assert.IsNotNull(Return);
            }
            catch (Exception e)
            {
                Assert.Fail("Expected no exception, but got " + e.Message);
            }
        }
        public void Test_ScheduleServices_Post()
        {
            try
            {
                /* Creates new user */
                UserServices us      = new UserServices();
                UserModel    NewUser = new UserModel()
                {
                    UserName  = "******",
                    firstname = "Oppfinnar-Jocke",
                    lastname  = "Johansson"
                };
                us.Post(NewUser);

                /* Creates new ScheduleModel */
                ScheduleServices ss = new ScheduleServices();

                ScheduleModel NewSchedule = new ScheduleModel()
                {
                    fromDateAndTime = "2016-05-21 07:00:00",
                    toDateAndTime   = "2016-05-21 19:00:00",
                    roomNr          = "A1234",
                    available       = false
                };
                //ss.Post(NewSchedule, NewUser.UserName);
            }
            catch (Exception e)
            {
                Assert.Fail("Expected no exception, but got " + e.Message);
            }
        }
Ejemplo n.º 7
0
        public List <Schedule> Get()
        {
            //Schedule schedule = new Schedule();
            //schedule.Inum = 2;
            //schedule.Hours = 23;
            //schedule.Type = "2";
            //ScheduleServices.del(schedule.Inum);

            return(ScheduleServices.sel());
        }
Ejemplo n.º 8
0
        protected void ItemCommand(object o, GridCommandEventArgs e)
        {
            switch (e.CommandName)
            {
            case RadGrid.EditCommandName:
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "SetEditMode", "isEditMode = true;", true);
                break;

            case RadGrid.InitInsertCommandName:
                e.Canceled = true;
                var i = new IdeaSeedCMS.Core.Domain.Schedule();
                i.Name            = "";
                i.Description     = "";
                i.ScheduleEventID = 0;
                i.ID        = 0;
                i.StartTime = DateTime.Now;
                i.EndTime   = DateTime.Now;
                e.Item.OwnerTableView.InsertItem(new IdeaSeedCMS.Core.Domain.Schedule());
                break;

            case RadGrid.UpdateCommandName:
                var img = new ScheduleServices().GetByID(Convert.ToInt32(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["ID"].ToString()));
                GridEditFormItem insertItem = e.Item as GridEditFormItem;
                img.Name            = (insertItem["Name"].FindControl("ddlDayOfWeek") as IdeaSeedCMSAdmin.Web.Controls.DayOfWeekDDL).SelectedValue;
                img.ScheduleEventID = ((ScheduleEvent)SecurityContextManager.Current.CurrentItem.ItemReference).ID;
                img.StartTime       = (DateTime)(insertItem["StartTime"].FindControl("rtpStartTime") as RadTimePicker).DbSelectedDate;
                img.EndTime         = (DateTime)(insertItem["EndTime"].FindControl("rtpEndTime") as RadTimePicker).DbSelectedDate;
                new ScheduleServices().Save(img);
                break;

            case RadGrid.PerformInsertCommandName:
                insertItem          = e.Item as GridEditFormInsertItem;
                img                 = new IdeaSeedCMS.Core.Domain.Schedule();
                img.Name            = (insertItem["Name"].FindControl("ddlDayOfWeek") as IdeaSeedCMSAdmin.Web.Controls.DayOfWeekDDL).SelectedValue;
                img.ScheduleEventID = ((ScheduleEvent)SecurityContextManager.Current.CurrentItem.ItemReference).ID;
                img.StartTime       = (DateTime)(insertItem["StartTime"].FindControl("rtpStartTime") as RadTimePicker).DbSelectedDate;
                img.EndTime         = (DateTime)(insertItem["EndTime"].FindControl("rtpEndTime") as RadTimePicker).DbSelectedDate;
                new ScheduleServices().Save(img);

                LoadSchedule(true);

                break;

            case RadGrid.DeleteCommandName:
                img = new ScheduleServices().GetByID(Convert.ToInt32(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["ID"].ToString()));
                new ScheduleServices().Delete(img);
                LoadSchedule(true);
                break;
            }
        }
Ejemplo n.º 9
0
        public void S4_Schedule_del()
        {
            SalaryController controller = new SalaryController();
            Schedule         schedule   = new Schedule();

            schedule.ID = 999;

            List <Schedule> result = ScheduleServices.sel(schedule);

            foreach (Schedule vr in result)
            {
                controller.Delete(vr.Inum);
            }

            result   = controller.Get();
            schedule = result.Find(x => x.ID == 999);
            Assert.IsNull(schedule);
        }
        public void Test_ScheduleServices_Check_If_Available()
        {
            try
            {
                /* Creates new user */
                UserServices us      = new UserServices();
                UserModel    NewUser = new UserModel()
                {
                    UserName  = "******",
                    firstname = "Pippi",
                    lastname  = "Anka"
                };
                us.Post(NewUser);

                /* Creates new ScheduleModel */
                ScheduleServices ss       = new ScheduleServices();
                ScheduleModel    Schedule = new ScheduleModel()
                {
                    fromDateAndTime = "2016-05-21 08:00:00",
                    toDateAndTime   = "2016-05-21 12:00:00",
                    available       = false
                };
                ss.Post(Schedule, NewUser.UserName);

                /* Check if Staff if Avaliable */
                string CheckTime1 = "2016-05-21 10:00:00";
                string CheckTime2 = "2016-05-21 07:59:59";
                string CheckTime3 = "2016-05-21 12:00:01";
                bool   ok1        = false;
                bool   ok2        = true;
                bool   ok3        = true;
                ok1 = ss.Get(CheckTime1, NewUser.UserName);
                ok2 = ss.Get(CheckTime2, NewUser.UserName);
                ok3 = ss.Get(CheckTime3, NewUser.UserName);

                Assert.AreEqual(true, ok1);
                Assert.AreEqual(false, ok2);
                Assert.AreEqual(false, ok3);
            }
            catch (Exception e)
            {
                Assert.Fail("Expected no exception, but got " + e.Message);
            }
        }
Ejemplo n.º 11
0
        public void S3_Schedule_upd()
        {
            SalaryController controller = new SalaryController();
            Schedule         schedule   = new Schedule();

            schedule.ID = 999;

            List <Schedule> result = ScheduleServices.sel(schedule);

            foreach (Schedule vr in result)
            {
                vr.Hours = 777;
                controller.Put(vr);
            }

            result   = controller.Get();
            schedule = result.Find(x => x.ID == 999);

            Assert.AreEqual(777, schedule.Hours);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="apiBaseUrl"></param>
        /// <param name="primarySubscriptionKey"></param>
        /// <param name="secondarySubscriptionKey"></param>

        public SportDataCSGOClient(string primarySubscriptionKey, string ProjectionPrimarySubscriptionKey)
        {
            Uri scoreApiBaseUrl      = CSGOConfig.ScoreApiBaseUrl;
            Uri statApiBaseUrl       = CSGOConfig.StateApiBaseUrl;
            Uri ProjectionApiBaseUrl = CSGOConfig.ProjectionApiBaseUrl;

            AreasServices       = new AreaServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey);
            CompetitionServices = new CompetitionServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey);
            GameServices        = new GameServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey);
            MembershipServices  = new MembershipServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey);
            PlayerServices      = new PlayerServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey);
            SeasonServices      = new SeasonServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey);
            ScheduleServices    = new ScheduleServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey);
            TeamServices        = new TeamServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey);
            VenueServices       = new VenueServices(scoreApiBaseUrl.AbsoluteUri, primarySubscriptionKey);

            BoxScoreServices = new BoxScoreServices(statApiBaseUrl.AbsoluteUri, primarySubscriptionKey);

            ProjectionServices = new ProjectionServices(ProjectionApiBaseUrl.AbsoluteUri, ProjectionPrimarySubscriptionKey);
        }
Ejemplo n.º 13
0
        getJadwalKlinik()
        {
            ScheduleServices      scheduleServices   = new ScheduleServices();
            List <KlinikSchedule> listKlinikSchedule = new List <KlinikSchedule>();

            listKlinikSchedule = await scheduleServices.GetKlinikSchedule(App.KodeKlinikSchedule);

            if (listKlinikSchedule.Count == 0)
            {
                await PopupNavigation.Instance.PushAsync(new DialogAlertCustom("Warning", "Jadwal Dokter Klinik Tidak Ditemukan"));

                return;
            }
            foreach (KlinikSchedule klinik in listKlinikSchedule)
            {
                //   klinik.NamaDokter = "Dokter :" + klinik.NamaDokter;
                //  klinik.hari = "Hari : " + klinik.hari;
                klinik.jam_full = klinik.jam_dari + " s/d " + klinik.jam_selesai;
            }
            listJadwalKlnik.ItemsSource = listKlinikSchedule;
        }
Ejemplo n.º 14
0
        private void schedulerDataStorage_AppointmentsDeleted(object sender, PersistentObjectsEventArgs e)
        {
            ScheduleServices scheduleServices = new ScheduleServices();

            for (int i = 0; i < schedulerControl1.SelectedAppointments.Count; i++)
            {
                Appointment apt = schedulerControl1.SelectedAppointments[i];
                if (apt.CustomFields["UniqueID"] != null && apt.CustomFields["DepartmentsList"] != null)
                {
                    int      idSchedule     = Int32.Parse(apt.CustomFields["UniqueID"].ToString());
                    String[] listDepartment = apt.CustomFields["DepartmentsList"].ToString().Split(',');
                    for (int j = 0; j < listDepartment.Length; j++)
                    {
                        if (listDepartment[j].Trim() != "")
                        {
                            ScheduleDepartment scheduleDepartment = new ScheduleDepartment();
                            scheduleDepartment.idSchedule   = idSchedule;
                            scheduleDepartment.idDepartment = Int32.Parse(listDepartment[j]);
                            //MessageBox.Show(scheduleDepartment.idSchedule + "--" + scheduleDepartment.idDepartment);
                            scheduleServices.deleteScheduleDepartment(scheduleDepartment);
                        }
                    }

                    String[] listPosition = apt.CustomFields["PositionList"].ToString().Split(',');
                    for (int k = 0; k < listPosition.Length; k++)
                    {
                        if (listPosition[i].Trim() != "")
                        {
                            SchedulePosition schedule = new SchedulePosition();
                            schedule.idPosition = Int32.Parse(listPosition[k]);
                            //MessageBox.Show(scheduleServices.getLastScheduleId().ToString());
                            schedule.idSchedule = idSchedule;
                            scheduleServices.deleteSchedulePosition(schedule);
                        }
                    }
                }
            }
            scheduleTableAdapter.Update(giaDinhUniversityDataSet);
            giaDinhUniversityDataSet.AcceptChanges();
        }
Ejemplo n.º 15
0
        private async void getJadwaDokter()
        {
            ScheduleServices      scheduleServices   = new ScheduleServices();
            List <DokterSchedule> listDokterSchedule = new List <DokterSchedule>();

            listDokterSchedule = await scheduleServices.GetDokterkSchedule(App.KodeDokterSchedule);

            if (listDokterSchedule.Count == 0)
            {
                await PopupNavigation.Instance.PushAsync(new DialogAlertCustom("Warning", "Jadwal Dokter Tidak Ditemukan"));

                return;
            }
            foreach (DokterSchedule dokter in listDokterSchedule)
            {
                //   klinik.NamaDokter = "Dokter :" + klinik.NamaDokter;
                //  klinik.hari = "Hari : " + klinik.hari;
                dokter.jam_full = dokter.jam_dari + " s/d " + dokter.jam_selesai;
            }

            listJadwalDokter.ItemsSource = listDokterSchedule;
        }
        public void Test_ScheduleServices_List_Schedule()
        {
            try
            {
                /* Creates new user */
                UserServices us      = new UserServices();
                UserModel    NewUser = new UserModel()
                {
                    UserName  = "******",
                    firstname = "Titti",
                    lastname  = "Anka"
                };
                us.Post(NewUser);

                /* Creates new ScheduleModel */
                ScheduleServices ss          = new ScheduleServices();
                ScheduleModel    NewSchedule = new ScheduleModel()
                {
                    fromDateAndTime = "2016-05-21 08:00:00",
                    toDateAndTime   = "2016-05-21 12:00:00",
                    roomNr          = "E1234",
                    available       = false
                };
                ss.Post(NewSchedule, NewUser.UserName);

                /* Retreives a List of task for a room */
                List <Schedule> ScheduleList = new List <Common.Models.Schedule>();
                ScheduleList = ss.List(NewSchedule.roomNr);
                Schedule Schedule = ScheduleList.Find(x => x.from == NewSchedule.fromDateAndTime && x.to == NewSchedule.toDateAndTime);

                Assert.AreEqual(NewSchedule.roomNr, Schedule.room);
            }
            catch (Exception e)
            {
                Assert.Fail("Expected no exception, but got " + e.Message);
            }
        }
Ejemplo n.º 17
0
        public virtual bool SaveFormData(Appointment appointment)
        {
            ScheduleServices scheduleServices = new ScheduleServices();

            appointment.CustomFields["ApprovalStatus"]  = comboBoxEditApprovalStatus.SelectedItem.ToString();
            appointment.CustomFields["DepartmentsList"] = checkedComboBoxEditDepartments.EditValue.ToString();
            //MessageBox.Show("--->"+ checkedComboBoxEditDepartments.EditValue.ToString());
            appointment.CustomFields["PositionList"] = checkedComboBoxEditPosition.EditValue.ToString();

            if (scheduleId.Text.Trim() == "0")
            {
                //MessageBox.Show("Them moi");

                //MessageBox.Show(scheduleServices.getLastScheduleId().ToString());

                /*
                 * String[] listDepartment = checkedComboBoxEditDepartments.EditValue.ToString().Split(',');
                 * for (int i = 0; i < listDepartment.Length; i++)
                 * {
                 *  MessageBox.Show(listDepartment[i]);
                 *  ScheduleDepartment schedule = new ScheduleDepartment();
                 *  schedule.idSchedule = scheduleServices.getLastScheduleId();
                 *  schedule.idDepartment = Int32.Parse(listDepartment[i]);
                 *  scheduleServices.createScheduleForDepartment(schedule);
                 * }*/
            }
            else
            {
                if (schedulePositionTemp.Text.Trim() == "nothing")
                {
                    String[] listPosition = checkedComboBoxEditPosition.EditValue.ToString().Split(',');
                    for (int i = 0; i < listPosition.Length; i++)
                    {
                        if (listPosition[i].Trim() != "")
                        {
                            //MessageBox.Show("--->+"+ listPosition[i]);
                            SchedulePosition schedule = new SchedulePosition();
                            schedule.idPosition = Int32.Parse(listPosition[i]);
                            schedule.idSchedule = Int32.Parse(scheduleId.Text);
                            scheduleServices.createSchedulePosition(schedule);
                        }
                    }
                }
                else
                {
                    String[]      listPosition     = checkedComboBoxEditPosition.EditValue.ToString().Split(',');
                    String[]      listpositionTemp = schedulePositionTemp.Text.Split(',');
                    List <string> listChoose       = new List <string>(listPosition);
                    List <string> listTemp         = new List <string>(listpositionTemp);

                    List <string> listDelete = new List <string>(listpositionTemp);
                    List <string> listInsert = new List <string>(listPosition);

                    listChoose.ForEach(y =>
                    {
                        listTemp.ForEach(x =>
                        {
                            if (y.Trim() == x.Trim())
                            {
                                listInsert.Remove(y);
                                listDelete.Remove(x);
                            }
                        });
                    });

                    listDelete.ForEach(x =>
                    {
                        if (x.Trim() != "")
                        {
                            SchedulePosition schedule = new SchedulePosition();
                            schedule.idSchedule       = Int32.Parse(scheduleId.Text);
                            schedule.idPosition       = Int32.Parse(x);
                            scheduleServices.deleteSchedulePosition(schedule);
                        }
                    });

                    listInsert.ForEach(x =>
                    {
                        SchedulePosition schedule = new SchedulePosition();
                        schedule.idSchedule       = Int32.Parse(scheduleId.Text);
                        schedule.idPosition       = Int32.Parse(x);
                        scheduleServices.createSchedulePosition(schedule);
                    });
                }


                if (scheduleDepartmentTemp.Text.Trim() == "nothing")
                {
                    String[] listDepartment = checkedComboBoxEditDepartments.EditValue.ToString().Split(',');
                    for (int i = 0; i < listDepartment.Length; i++)
                    {
                        if (listDepartment[i].Trim() != "")
                        {
                            ScheduleDepartment schedule = new ScheduleDepartment();
                            schedule.idSchedule   = Int32.Parse(scheduleId.Text);
                            schedule.idDepartment = Int32.Parse(listDepartment[i]);
                            scheduleServices.createScheduleForDepartment(schedule);
                        }
                    }
                }
                else
                {
                    String[]      listDepartment     = checkedComboBoxEditDepartments.EditValue.ToString().Split(',');
                    String[]      listDepartmentTemp = scheduleDepartmentTemp.Text.Split(',');
                    List <string> listChoose         = new List <string>(listDepartment);
                    List <string> listTemp           = new List <string>(listDepartmentTemp);

                    List <string> listDelete = new List <string>(listDepartmentTemp);
                    List <string> listInsert = new List <string>(listDepartment);

                    listChoose.ForEach(y =>
                    {
                        listTemp.ForEach(x =>
                        {
                            if (y.Trim() == x.Trim())
                            {
                                listInsert.Remove(y);
                                listDelete.Remove(x);
                            }
                        });
                    });

                    listDelete.ForEach(x =>
                    {
                        if (x.Trim() != "")
                        {
                            ScheduleDepartment schedule = new ScheduleDepartment();
                            schedule.idSchedule         = Int32.Parse(scheduleId.Text);
                            schedule.idDepartment       = Int32.Parse(x);
                            scheduleServices.deleteScheduleDepartment(schedule);
                        }
                    });

                    listInsert.ForEach(x =>
                    {
                        if (x.Trim() != "")
                        {
                            ScheduleDepartment schedule = new ScheduleDepartment();
                            schedule.idSchedule         = Int32.Parse(scheduleId.Text);
                            schedule.idDepartment       = Int32.Parse(x);
                            scheduleServices.createScheduleForDepartment(schedule);
                        }
                    });
                }
            }
            return(true);
        }
Ejemplo n.º 18
0
 public List <SalaryViewModels> GetSalary(short id)
 {
     return(ScheduleServices.getSalary(id));
 }
Ejemplo n.º 19
0
 public void Post(Schedule schedule)
 {
     ScheduleServices.ins(schedule);
 }
Ejemplo n.º 20
0
 public void Put(Schedule schedule)
 {
     ScheduleServices.upd(schedule);
 }
 public ScheduleController(ILogger <ScheduleController> logger, ScheduleServices scheduleservices)
 {
     this._logger           = logger;
     this._scheduleservices = scheduleservices;
 }
Ejemplo n.º 22
0
 public void Delete(int id)
 {
     ScheduleServices.del(id);
 }