/// <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); }
private void FormRepointAppoint_Load(object sender, EventArgs e) { Permit permit = Appoint.GetPermit(database); if (permit == null) { MessageBox.Show(DispatcherService.Resources.Error.PermitNotFound); Close(); } currentComment = permit.GetComment(database); tboxComment.Text = currentComment; Points points = new DispatcherService.Points(database, Appoint.Unit); cboxPoint.DataSource = points; }
public string GetComment(Database database) { return(Permit.GetComment(database, PermitId)); }
internal string GetComment(Database database) { return(Permit.GetComment(database, PermitId)); }
private void ShowLabelTexts() { lblPermitNumber.Text = Permit.ShortNumber; lblPeriod.Text = Permit.ActivePeriod; //lblEntryPoint.Text = "Допустимые пункты пропуска: " + Permit.EntryPoint.ToString(); lblVehicle.Text = Permit.Vehicle.ToString(); lblDriver.Text = Permit.DriverName; lblCargo.Text = Permit.Cargo.ToString(); lblDriverContact.Text = Permit.Contact; tboxComment.Text = Permit.GetComment(Database); //if (Permit.EntryPoint.Equals(EntryControl.Classes.EntryPoint.Empty) // || Permit.EntryPoint.Equals(EntryPoint)) if (Permit.CheckEntryPoint(Database, EntryPoint)) { lblEntryPoint.ForeColor = SystemColors.ControlText; btnEntry.Enabled = true; } else { lblEntryPoint.ForeColor = Color.Red; btnEntry.Enabled = false; } btnEntry.Enabled = (btnEntry.Enabled && DateTime.Now >= Permit.DateFrom && DateTime.Today <= Permit.DateTo); if (DateTime.Today >= Permit.DateFrom && DateTime.Today <= Permit.DateTo) { lblPeriod.ForeColor = SystemColors.WindowText; } else { lblPeriod.ForeColor = Color.Red; } if (btnEntry.Enabled) { btnEntry.BackColor = Color.LightGreen; } else { btnEntry.BackColor = SystemColors.Control; } //dgvMoving.DataSource = PermitMoving.LoadList(Database, Permit); //materialPermit = Permit.GetMaterialPermit(Database); //if (materialPermit != null) //{ // lblMaterialPermit.Text = materialPermit.ToString(); // ShowMaterialPermit(); //} //else //{ // lblMaterialPermit.Text = "Не прикреплен"; // materialPermitPanel.Visible = false; //} //if (materialPermit != null && !materialPermit.CanExit) //{ // labelCannotExit.Visible = true; // btnExit.Enabled = false; //} //else //{ // labelCannotExit.Visible = false; //} lboxPointList.DataSource = Permit.GetAllowedPointList(Database); if (btnExit.Enabled) { btnExit.BackColor = Color.LightSalmon; } else { btnExit.BackColor = SystemColors.Control; } }