示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EditLineForm"/> class.
        /// </summary>
        /// <param name="form">The form.</param>
        /// <param name="lineId">The line id.</param>
        public EditLineForm(LinesForm form, int lineId)
            : this(form)
        {
            var response = this.lineLogic.GetLine(lineId);

            if (response.Successful == true)
            {
                this.lineId = lineId;
                this.Text = String.Format("Edytujesz {0} linię", response.Object.NAME);
                this.footerLbl.Text = this.Text;
                this.lineName.Text = response.Object.NAME;
                this.selectedStationsList = response.Object.SelectedStationsList;
                this.selectedExceptionList = response.Object.SelectedExceptionList;
                this.ReloadData();

                if (response.Object.ReadOnly)
                {
                    this.lineName.Enabled = false;
                }
            }
            else
            {
                MessageBox.Show(this, response.ErrorMessage, "Błąd", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#2
0
        /// <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();
        }