コード例 #1
0
ファイル: StationsForm.cs プロジェクト: kkrzaczkowski/SWKM
        /// <summary>
        /// Initializes a new instance of the <see cref="StationsForm"/> class.
        /// </summary>
        public StationsForm()
        {
            this.stationLogic = SWKM.Setup.IoC.Resolve<StationLogic>();

            InitializeComponent();
            this.RefreshGrid();
        }
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="StationScheduleForm"/> class.
        /// </summary>
        public StationScheduleForm()
        {
            this.reportLogic = SWKM.Setup.IoC.Resolve<ReportLogic>();
            this.schedulePeriodLogic = SWKM.Setup.IoC.Resolve<SchedulePeriodLogic>();
            this.stationLogic = SWKM.Setup.IoC.Resolve<StationLogic>();

            InitializeComponent();

            var scheduleperiodsResponse = this.schedulePeriodLogic.GetSchedulePeriods();

            if (scheduleperiodsResponse.Successful == true)
            {
                if (scheduleperiodsResponse.Objects.Any() && scheduleperiodsResponse.Objects.Any(s => s.ROUTE.Any(r => r.DELETEDDATE == null)))
                {
                    this.schedulePeriodCbx.DisplayMember = "NAME";
                    this.schedulePeriodCbx.ValueMember = "ID";
                    this.scheduleperiods = scheduleperiodsResponse.Objects.ToList();
                    this.schedulePeriodCbx.DataSource = AutoMapper.Mapper.Map<IList<SWKM.DAL.SCHEDULEPERIOD>, IList<SWKM.BLL.Dto.BaseIdNameDto>>(this.scheduleperiods);
                    this.ReloadData();
                    this.RefreshGrids();
                    this.IsValidForm = true;
                }
                else
                {
                    MessageBox.Show(this, "Nie można wygenerowac rozkładu ponieważ w systemie nie ma zdefiniowanych okresów rozkładu jazdy zawierających trasy!", "Błąd", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    this.IsValidForm = false;
                }
            }
            else
            {
                MessageBox.Show(this, scheduleperiodsResponse.ErrorMessage, "Błąd", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.IsValidForm = false;
            }
        }
コード例 #3
0
ファイル: EditStationForm.cs プロジェクト: kkrzaczkowski/SWKM
        /// <summary>
        /// Initializes a new instance of the <see cref="EditStationForm"/> class.
        /// </summary>
        public EditStationForm(StationsForm form)
        {
            this.stationLogic = SWKM.Setup.IoC.Resolve<StationLogic>();
            this.stationForm = form;

            InitializeComponent();
            this.Text = this.footerLbl.Text = "Dodaj nową stację";
        }
コード例 #4
0
ファイル: EditLineForm.cs プロジェクト: kkrzaczkowski/SWKM
        /// <summary>
        /// Initializes a new instance of the <see cref="EditLineForm"/> class.
        /// </summary>
        /// <param name="form">The form.</param>
        public EditLineForm(LinesForm form)
        {
            this.lineLogic = SWKM.Setup.IoC.Resolve<LineLogic>();
            this.stationLogic = SWKM.Setup.IoC.Resolve<StationLogic>();
            this.schedulePeriodLogic = SWKM.Setup.IoC.Resolve<SchedulePeriodLogic>();
            this.linesForm = form;

            InitializeComponent();
            this.Text = this.footerLbl.Text = "Dodaj nową linię";
            this.selectedExceptionList = new List<BaseIdNameDto>();
            this.selectedStationsList = new List<RouteStationDto>();

            this.ReloadData();
        }