Ejemplo n.º 1
0
        public void DeleteHoliday(int Id)
        {
            var deletediz = new OPTHolidayModel();

            deletediz.Id = Id;
            this.context.Remove(deletediz);
            this.context.SaveChanges();
        }
Ejemplo n.º 2
0
        public async Task <List <HolidayModel> > UpdateRefHolidayTable()
        {
            var holidays3party = await this.holidayService.GetHolidaysList();

            var index = 1;

            this.context.Database.ExecuteSqlCommand("TRUNCATE TABLE holiday");
            foreach (var holiday in holidays3party)
            {
                OPTHolidayModel model = new OPTHolidayModel();
                model.Id            = index;
                model.Date          = holiday.Date;
                model.Title         = holiday.Title;
                model.Description   = holiday.Description;
                model.Legislation   = holiday.Legislation;
                model.Type          = holiday.Type;
                model.VariableDates = holiday.VariableDates;
                this.context.Add(model);
                index++;
            }
            this.context.SaveChanges();
            return(holidays3party);
        }
Ejemplo n.º 3
0
 public void UpdateHoliday(int Id, [FromBody] OPTHolidayModel model)
 {
     this.context.Update(model);
     this.context.SaveChanges();
 }