//дополнительная инициализация контролов private void InitControls() { try { InitFocusHandlers(); this.CenterToScreen(); this.MdiParent = MainClass.mainform; _bdc = MainClass.Bdc; _drh = new DataRefreshHandler(UpdateDataGrid); MainClass.AddHandler(_drh); Dgv = dgvAbitList; lblCount.Text = dgvAbitList.RowCount.ToString(); if (!MainClass.IsOwner()) { btnRemove.Visible = false; } using (PriemEntities context = new PriemEntities()) { ComboServ.FillCombo(cbFaculty, HelpClass.GetComboListByTable("ed.qFaculty", "ORDER BY Acronym"), false, true); } } catch (Exception exc) { WinFormsServ.Error("Ошибка при инициализации формы " + exc.Message); } }
//дополнительная инициализация protected virtual void InitControls() { this.MdiParent = MainClass.mainform; this.CenterToParent(); InitFocusHandlers(); _drh = new DataRefreshHandler(UpdateRightGrid); MainClass.AddHandler(_drh); btnDelete.Visible = false; this.Text = "Протокол"; Dgv = this.dgvRight; //заполнение контролов для нового или существующего протокола if (isNew) { //строим номер протокола string sProtNum = _studyLevelGroupId.ToString(); sProtNum += (_facultyId > 9 ? "" : "0") + _facultyId.ToString(); //номер факультета sProtNum += DateTime.Now.Year.ToString().Substring(2); //год try { string sNum = MainClass.Bdc.GetStringValue(string.Format("SELECT ProtocolNum FROM ed.ProtocolNumbers WHERE FacultyId = {0} AND StudyLevelGroupId = {1}", _facultyId, _studyLevelGroupId)); sNum = "0000" + sNum; sProtNum += sNum.Substring(sNum.Length - 4); } catch (Exception ex) { WinFormsServ.Error("Ошибка при присвоении номера протокола: ", ex); } ProtocolName = sProtNum; } else { try { using (PriemEntities context = new PriemEntities()) { var protocolInfo = context.qProtocol.Where(x => x.Id == _id.Value).Select(x => new { x.Number, x.Date }).FirstOrDefault(); ProtocolName = protocolInfo.Number; dtpDate.Value = protocolInfo.Date; } } catch (Exception ex) { WinFormsServ.Error("Ошибка взятия данных протокола: ", ex); } } // //заполнение гридов // InitAndFillGrids(); }
//дополнительная инициализация контролов protected virtual void InitControls() { InitFocusHandlers(); drh = new DataRefreshHandler(UpdateDataGrid); prh = new ProtocolRefreshHandler(UpdateProtocolList); prh += new ProtocolRefreshHandler(SelectLastProtocol); MainClass.AddHandler(drh); MainClass.AddProtocolHandler(prh); Dgv = dgvProtocols; cbPrint.Items.Clear(); InitGrid(); try { using (PriemEntities context = new PriemEntities()) { ComboServ.FillCombo(cbFaculty, HelpClass.GetComboListByTable("ed.qFaculty", "ORDER BY Acronym"), false, false); ComboServ.FillCombo(cbStudyBasis, HelpClass.GetComboListByTable("ed.StudyBasis", "ORDER BY Name"), false, false); FillComboStudyForm(); UpdateProtocolList(); cbFaculty.SelectedIndexChanged += new EventHandler(cbFaculty_SelectedIndexChanged); cbStudyBasis.SelectedIndexChanged += new EventHandler(cbStudyBasis_SelectedIndexChanged); cbStudyForm.SelectedIndexChanged += new EventHandler(cbStudyForm_SelectedIndexChanged); cbProtocolNum.SelectedIndexChanged += new EventHandler(cbProtocolNum_SelectedIndexChanged); } if (MainClass.RightsSov_SovMain_FacMain()) { btnCreate.Visible = true; } // закрываем для создания новых кроме огр набора //if (MainClass.HasAddRightsForPriem(FacultyId.Value, null, null, null, StudyFormId.Value, StudyBasisId.Value)) // btnCreate.Enabled = true; if (MainClass.IsOwner()) { btnMake.Visible = true; } } catch (Exception ex) { WinFormsServ.Error("Ошибка при инициализации формы протоколов: " + ex.Message); } }
private void InitControls() { this.CenterToParent(); this.MdiParent = MainClass.mainform; _bdc = MainClass.Bdc; _drh = new DataRefreshHandler(UpdateDataGrid); MainClass.AddHandler(_drh); Dgv = dgvChanges; UpdateDataGrid(); InitHandlers(); }
//дополнительная инициализация контролов private void InitControls() { InitFocusHandlers(); this.CenterToScreen(); this.MdiParent = MainClass.mainform; _bdc = MainClass.Bdc; _drh = new DataRefreshHandler(UpdateDataGrid); MainClass.AddHandler(_drh); Dgv = dgvAbitList; lblCount.Text = dgvAbitList.RowCount.ToString(); using (PriemEntities context = new PriemEntities()) { ComboServ.FillCombo(cbFaculty, HelpClass.GetComboListByTable("ed.qFaculty", "ORDER BY Acronym"), false, true); } }
protected override void ExtraInit() { this.CenterToParent(); this.MdiParent = MainClass.mainform; _bdc = MainClass.Bdc; _drh = new DataRefreshHandler(UpdateDataGrid); MainClass.AddHandler(_drh); Dgv.ReadOnly = true; Dgv.AllowUserToAddRows = Dgv.AllowUserToDeleteRows = false; Dgv.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(Dgv_CellDoubleClick); Dgv.ColumnHeaderMouseClick += new DataGridViewCellMouseEventHandler(Dgv_ColumnHeaderMouseClick); if (MainClass.IsOwner()) { btnRemove.Visible = true; } else { btnRemove.Visible = false; } }