Ejemplo n.º 1
0
        /// <summary>
        ///     отражает данные пропуска в панели информации
        /// </summary>
        /// <param name="permit"></param>
        private void ShowPermitInfo(Permit permit)
        {
            tboxPermitComment.Text = permit.GetComment(Database);
            tboxPermitCreator.Text = Permit.GetPlanAppointCreator(Database, permit.Id);

            dgvMoving.DataSource    = permit.GetMovingList(Database);
            dgvPointList.DataSource = permit.GetAllowedPointList(Database);
        }
Ejemplo n.º 2
0
        private void AddBindings()
        {
            if (PlanAppoint.IsUpdated)
            {
                timer.Start();
            }

            lblCargo.Text       = PlanAppoint.Cargo.ToString();
            lblVehicleMark.Text = PlanAppoint.Vehicle.ToString();
            lblDriver.Text      = PlanAppoint.DriverName + " (" + PlanAppoint.Contact + ")";
            lblCreation.Text    = PlanAppoint.CreationInfo;

            PlanAppoint.GetComment(Database);
            tboxComment.DataBindings.Add("Text", bsItem, "Comment");

            if (PlanAppoint.HasPermit)
            {
                Permit permit = PlanAppoint.LoadPermit(Database);
                lblPermit.Text = permit.ToString();

                switch (permit.PermitState.Id)
                {
                case 4:
                    lblPermit.Text += " (закрыт)";
                    break;

                case 3:
                    lblPermit.Text += " (заблокирован)";
                    break;

                case 2:
                    lblPermit.Text += " (постоянный)";
                    break;
                }

                lboxPermitMoving.DataSource = permit.GetMovingList(Database);
                lboxPointList.DataSource    = permit.GetAllowedPointList(Database);
            }
            else
            {
                lblPermit.Text = "не выдан";
            }
        }