public NewPhone(PhoneModel phone) { _isNew = (phone == null); AppFuncs.openEditForm(this.GetType().Name, _isNew); InitializeComponent(); FormsHelper.SetDepartmentsComboBox(cbxFormPhoneDepartment); FormsHelper.SetFocusEventHandlers(this, Color.Yellow, Color.White); if (_isNew) { this.Text = "Створення нового комнтакта"; } else { this.Text = "Редагування контакта"; _phone = phone; tbxFio.Text = _phone.FIO; tbxPosition.Text = _phone.Positions; cbxFormPhoneDepartment.SelectedValue = _phone.Department; tbxDect.Text = _phone.Dect; tbxMobile.Text = _phone.Mobile; tbxPhone.Text = _phone.Phone; tbxFormPhoneMail.Text = _phone.Mail; } // }
public NoteTemplateForm(NoteTemplate pTemplate) { _isNew = (pTemplate == null); AppFuncs.openEditForm(this.GetType().Name, _isNew); InitializeComponent(); // подписаться на события фокуса //FormsHelper.SetFocusEventHandlers(this, Color.Yellow, Color.White); if (_isNew) { this.Text = "Створення нового шаблону службової записки"; } else { this.Text = "Редагування існуючого шаблону"; _currentTemplate = pTemplate; #region заполнение полей tbxTplName.Text = _currentTemplate.Name; tbxHelp.Text = _currentTemplate.Help; tbxHeadDir.Text = _currentTemplate.HeadDir; tbxBodyUp.Text = _currentTemplate.BodyUp; tbxHeadNach.Text = _currentTemplate.HeadNach; tbxTableColums.Text = _currentTemplate.TableColums.ToString(); tbxColumnName1.Text = _currentTemplate.ColumName1; tbxColumnName2.Text = _currentTemplate.ColumName2; tbxColumnName3.Text = _currentTemplate.ColumName3; tbxColumnName4.Text = _currentTemplate.ColumName4; tbxColumnName5.Text = _currentTemplate.ColumName5; tbxColumnName6.Text = _currentTemplate.ColumName6; tbxColumnName7.Text = _currentTemplate.ColumName7; tbxColumnName8.Text = _currentTemplate.ColumName8; tbxColumnName9.Text = _currentTemplate.ColumName9; tbxColumnName10.Text = _currentTemplate.ColumName10; tbxBodyDown.Text = _currentTemplate.BodyDown; cbxApprASU.Checked = _currentTemplate.ApprASU; cbxApprBuh.Checked = _currentTemplate.ApprBuh; cbxApprComdir.Checked = _currentTemplate.ApprComdir; cbxApprDir.Checked = _currentTemplate.ApprDir; cbxApprDostavka.Checked = _currentTemplate.ApprDostavka; cbxApprEnerg.Checked = _currentTemplate.ApprEnerg; cbxApprFin.Checked = _currentTemplate.ApprFin; cbxApprKasa.Checked = _currentTemplate.ApprKasa; cbxApprNach.Checked = _currentTemplate.ApprNach; cbxApprSB.Checked = _currentTemplate.ApprSB; cbxApprSBNach.Checked = _currentTemplate.ApprSBNach; cbxApprSklad.Checked = _currentTemplate.ApprSklad; #endregion } }
public UserForm(User pUser) { _isNew = (pUser == null); AppFuncs.openEditForm(this.GetType().Name, _isNew); InitializeComponent(); // получить данные и настроить комбобокс отделов FormsHelper.SetDepartmentsComboBox(cbxDepartment); // подписаться на события фокуса FormsHelper.SetFocusEventHandlers(this, Color.Yellow, Color.White); if (_isNew) { this.Text = "Створення нового користувача"; } else { this.Text = "Редагування користувача"; _currentUser = pUser; tbxPC.Text = _currentUser.PC; tbxUserName.Text = _currentUser.UserName; cbxDepartment.SelectedValue = _currentUser.Department; checkBoxNote.Checked = _currentUser.Notes; checkBoxSchedule.Checked = _currentUser.Schedule; checkBoxPhonebook.Checked = _currentUser.Phone; checkBoxConfig.Checked = _currentUser.Config; checkBoxApprovedN.Checked = _currentUser.ApprNach; checkBoxApprovedSB.Checked = _currentUser.ApprSB; checkBoxApprovedDir.Checked = _currentUser.ApprDir; checkBoxApprAvtor.Checked = _currentUser.ApprAvtor; checkBoxApprComdir.Checked = _currentUser.ApprComdir; checkBoxApprSBN.Checked = _currentUser.ApprSBNach; checkBoxApprKasa.Checked = _currentUser.ApprKasa; checkBoxApprFin.Checked = _currentUser.ApprFin; checkBoxApprDastavka.Checked = _currentUser.ApprDostavka; checkBoxApprEnerg.Checked = _currentUser.ApprEnerg; checkBoxApprSklad.Checked = _currentUser.ApprSklad; checkBoxApprBun.Checked = _currentUser.ApprBuh; checkBoxApprASU.Checked = _currentUser.ApprASU; tbxName.Text = _currentUser.Name; tbxHeadNach.Text = _currentUser.HeadNach; tbxMail.Text = _currentUser.Mail; } }
public Schedule(ScheduleModel sched) { _isNew = (sched == null); AppFuncs.openEditForm(this.GetType().Name, _isNew); InitializeComponent(); _schedule = sched; if (_schedule == null) { _schedule = new ScheduleModel() { Date = dateTimePicker.MinDate } } ; this.FormClosing += Schedule_FormClosing; }
public NewNote(Note note) { InitializeComponent(); _isNew = (note == null); if (_isNew) { _note = new Note(); } else { _note = note; } AppFuncs.openEditForm(this.GetType().Name, _isNew); // держать в поле PropertyInfo[] для быстрого доступа к значениям через рефлексию _propInfoNote = typeof(Note).GetProperties(BindingFlags.Instance | BindingFlags.Public); _propInfoUser = typeof(User).GetProperties(BindingFlags.Instance | BindingFlags.Public); }
public DepartmentForm(Department dep = null) { _isNew = (dep == null); AppFuncs.openEditForm(this.GetType().Name, _isNew); InitializeComponent(); _backColor = getBackColor(); lblErrMsg.Visible = false; // подписаться на события фокуса FormsHelper.SetFocusEventHandlers(this, Color.Yellow, _backColor); if (_isNew) { this.Text = "Створення нового відділу"; } else { this.Text = "Редагування відділу"; _currentDep = dep; tbxId.Text = dep.Id.ToString(); tbxName.Text = dep.Name; } }