public DayTemplateForm() { this.dayTypeTemplateLogic = SWKM.Setup.IoC.Resolve<DayTypeTemplateLogic>(); InitializeComponent(); this.RefreshGrid(); }
/// <summary> /// Initializes a new instance of the <see cref="EditSchedulePeriodForm"/> class. /// </summary> /// <param name="form">The form.</param> public EditSchedulePeriodForm(SchedulePeriodsForm form) { this.schedulePeriodLogic = SWKM.Setup.IoC.Resolve<SchedulePeriodLogic>(); this.dayTypeTemplateLogic = SWKM.Setup.IoC.Resolve<DayTypeTemplateLogic>(); this.schedulePeriodsForm = form; InitializeComponent(); this.Text = this.footerLbl.Text = "Dodaj nowy okres rozkładu jazdy"; this.validFromDtp.Value = DateTime.Now; this.validToDtp.Value = this.validFromDtp.Value.AddDays(validToDayInterval); this.validToDtp.Enabled = this.isValidTo.Checked; var response = this.dayTypeTemplateLogic.GetDayTypeTemplates(); if (response.Successful == true) { this.dayTypeTemplateCbx.DataSource = response.Objects; this.dayTypeTemplateCbx.DisplayMember = "NAME"; this.dayTypeTemplateCbx.ValueMember = "ID"; } else { MessageBox.Show(this, response.ErrorMessage, "Błąd", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
/// <summary> /// Initializes a new instance of the <see cref="EditDayTemplateForm"/> class. /// </summary> /// <param name="form">The form.</param> public EditDayTemplateForm(DayTemplateForm form) { this.dayTypeTemplateLogic = SWKM.Setup.IoC.Resolve<DayTypeTemplateLogic>(); this.dayTypeLogic = SWKM.Setup.IoC.Resolve<DayTypeLogic>(); this.dayTemplateForm = form; InitializeComponent(); this.Text = this.footerLbl.Text = "Dodaj nowy szablon typu dnia"; var response = dayTypeLogic.GetDayTypes(); if (response.Successful == true) { this.dayTypesGrid.DataSource = dayTypesList = response.Objects; this.choosedList = new List<SWKM.BLL.Dto.DayTypeTemplateListDto>(); } else { MessageBox.Show(this, response.ErrorMessage, "Błąd", MessageBoxButtons.OK, MessageBoxIcon.Error); } }