public XtraDictionaryEditEduForm(XtraDictionaryEduControl parentEduControl, List<municipality> municipalityList, List<edu_kind> kindList, edu edu)
            : base()
        {
            InitializeComponent();

            this.xtraDictionaryEditEduControl1.ParentEduControl = parentEduControl;

            this.xtraDictionaryEditEduControl1.MunicipalityDataSource = municipalityList;
            this.xtraDictionaryEditEduControl1.EduKindDataSource = kindList;
            this.xtraDictionaryEditEduControl1.Edu = edu;
            this.xtraDictionaryEditEduControl1.ControlType = XtraBaseControl.Type.Form;
        }
 public QueryReportEduData(edu edu, query query, object data)
     : base(query, data)
 {
     this.Edu = edu;
 }
 public static String GetFormContainerTag(edu edu, form_type type, bool isArchive)
 {
     return String.Format("{2}-container-edu-{0}-form_type-{1}", edu.edu_id, type.form_type_id, isArchive ? "archive" : "");
 }
        private void SaveData(edu edu)
        {
            if (edu == null)
            {
                throw new ArgumentNullException("edu", "Edu passed to passport control is null");
            }
            edu.municipality = (municipality) this.comboBoxMunit.SelectedItem;
            edu.edu_kind = (edu_kind) this.comboBoxEduKind.SelectedItem;
            edu.edu_status = (edu_status) this.comboBoxEduStatus.SelectedItem;
            edu.edu_type = (edu_type) this.comboBoxEduType.SelectedItem;
            edu.ownership_type = (ownership_type) this.comboBoxOwnershipType.SelectedItem;

            edu.accreditation_date = this.dateEditAccreditation.DateTime;
            edu.accreditation_end_date = this.dateEditEndAccreditation.DateTime;
            edu.accreditation_from = this.textBoxAccreditationFrom.Text;
            edu.accreditation_num = textBoxAccreditationNum.Text;
            edu.code = this.textBoxCode.Text;
            edu.director = this.textBoxDirectorName.Text;
            edu.fullname = this.textBoxEduName.Text;
            edu.name = this.textBoxEduShortname.Text;
            edu.sys_name = this.textEditSysname.Text;
            if (string.IsNullOrEmpty(this.textEditEduNumber.Text.Trim()))
                edu.edu_number = null;
            else
                edu.edu_number = Convert.ToInt32(this.textEditEduNumber.Text.Trim());
            edu.email = this.textBoxEmail.Text;

            edu.license_date = this.dateEditLicense.DateTime;
            edu.license_end_date = DateTime.Now;
            edu.license_from = this.textBoxLicenseFrom.Text;
            edu.license_num = textBoxLicenseNum.Text;
            edu.link = this.textBoxLink.Text;
            edu.okpo_code = this.textBoxOKPOCode.Text;
            edu.phone = this.textBoxPhone.Text;
            edu.post = this.textBoxPost.Text;

            edu.is_ungraded = this.checkBoxIsUngraded.Checked;
            edu.management_agency_has_authority = this.checkBox1.Checked;

            edu.branch_num = decimal.ToInt32(this.numericUpDownBranchCount.Value);
            string operatorName = this.textBoxOperator.Text.Trim();
            if (!string.IsNullOrEmpty(operatorName))
                edu.@operator = operatorName;

            if (!string.IsNullOrEmpty(Convert.ToString(textEditInn.EditValue)))
                edu.inn = textEditInn.EditValue.ToString();
            if (!string.IsNullOrEmpty(Convert.ToString(textEditKpp.EditValue)))
                edu.kpp = textEditKpp.EditValue.ToString();
            if (!string.IsNullOrEmpty(Convert.ToString(textEditOgrn.EditValue)))
                edu.ogrn = textEditOgrn.EditValue.ToString();
        }
        private void FillData(edu edu)
        {
            if (edu == null)
            {
                throw new ArgumentNullException("edu", "EduOrg passed to pasport control is null");
            }
            this.comboBoxMunit.SelectedItem = edu.municipality;

            _isManualSelect = false;
            this.checkedComboBoxActivityType.SetEditValue(null);
            foreach (var at in edu.activity_type) 
            {
                this.checkedComboBoxActivityType.Properties.Items[(object)at.activity_type_id].CheckState = CheckState.Checked;
            }
            this.checkedComboBoxManagementAgency.SetEditValue(null);
            foreach (var ma in edu.management_agency)
            {
                this.checkedComboBoxManagementAgency.Properties.Items[(object)ma.management_agency_id].CheckState = CheckState.Checked;
            }
            this.checkedComboBoxManagementAgencyActivity.SetEditValue(null);
            foreach (var maa in edu.management_agency_activity)
            {
                this.checkedComboBoxManagementAgencyActivity.Properties.Items[(object)maa.management_agency_activity_id].CheckState = CheckState.Checked;
            }
            _isManualSelect = true;

            this.comboBoxEduKind.SelectedItem = edu.edu_kind;
            this.comboBoxEduStatus.SelectedItem = edu.edu_status;
            this.comboBoxEduType.SelectedItem = edu.edu_type;
            this.comboBoxOwnershipType.SelectedItem = edu.ownership_type;

            this.dateEditAccreditation.DateTime = edu.accreditation_date;
            this.dateEditEndAccreditation.DateTime = edu.accreditation_end_date;
            this.textBoxAccreditationFrom.Text = edu.accreditation_from;
            this.textBoxAccreditationNum.Text = edu.accreditation_num;
            this.textBoxCode.Text = edu.code;
            this.textBoxDirectorName.Text = edu.director;
            this.textBoxEduName.Text = edu.fullname;
            this.textBoxEduShortname.Text = edu.name;
            this.textEditSysname.Text = edu.sys_name;
            this.textEditEduNumber.Text = Convert.ToString(edu.edu_number);
            this.textBoxEmail.Text = edu.email;

            this.dateEditLicense.DateTime = edu.license_date;
            this.textBoxLicenseFrom.Text = edu.license_from;
            this.textBoxLicenseNum.Text = edu.license_num;
            this.textBoxLink.Text = edu.link;
            this.textBoxOKPOCode.Text = edu.okpo_code;
            this.textBoxPhone.Text = edu.phone;
            this.textBoxPost.Text = edu.post;

            this.checkBoxIsUngraded.Checked = edu.is_ungraded;
            this.checkBox1.Checked = edu.management_agency_has_authority;

            this.numericUpDownBranchCount.Value = edu.branch_num;

            this.textBoxOperator.Text = edu.@operator;

            this.textEditKpp.EditValue = edu.kpp;
            this.textEditInn.EditValue = edu.inn;
            this.textEditOgrn.EditValue = edu.ogrn;
        }
 private void gridViewEdu_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
 {
     if (e.FocusedRowHandle < 0)
         return;
     var edu = (edu)this.gridViewEdu.GetRow(e.FocusedRowHandle);
     if (edu != null)
     {
         _selectedEdu = edu;
         int idx = this.eduBindingSource.CurrencyManager.List.IndexOf(_selectedEdu);
         this.eduBindingSource.CurrencyManager.Position = idx;
         this.editEduControl.Edu = _selectedEdu;
         this.editEduControl.Enabled = true;
     }
     else
     {
         this.eduBindingSource.CurrencyManager.Position = -1;
         this.editEduControl.Enabled = false;
     }
 }
 public void SelectRow(edu edu)
 {
     var idx = eduBindingSource.List.IndexOf(edu);
     var handle = gridViewEdu.GetRowHandle(idx);
     gridViewEdu.SelectRow(handle);
 }
        public static Tile CreateAnimatedEduTile(edu eo, bool isArchive = false)
        {
            var eoTile = CreateTile(TileItemSize.Wide, 0);
            eoTile.Tag = TagHelper.GetTag(TagHelper.TagType.Tile, eo, isArchive ? "archive" : "");
            
            var frame1 = new TileItemFrame();
            frame1.Elements.Add(new TileItemElement()
            {
                Text = eo.number_sysname,
                TextAlignment = TileItemContentAlignment.BottomLeft
            });
            frame1.Elements[0].Appearance.Assign(AppearanceMid);

            var frame2 = new TileItemFrame();
            frame2.Elements.Add(new TileItemElement()
            {
                TextAlignment = TileItemContentAlignment.BottomLeft
            });
            frame2.Elements[0].Appearance.Assign(AppearanceText);

            eoTile.Frames.Add(frame1);
            eoTile.Frames.Add(frame2);
            eoTile.Properties.ContentAnimation = TileItemContentAnimationType.ScrollLeft;
            eoTile.Properties.FrameAnimationInterval = 3500;
            return eoTile;
        }
 public static Tile CreateEduTile(edu eo, bool isArchive = false)
 {
     var eoTile = CreateTile(TileItemSize.Wide, 1);
     eoTile.Tag = TagHelper.GetTag(TagHelper.TagType.Tile, eo, isArchive ? "archive" : "");
     eoTile.Elements[0].Text = eo.number_sysname;
     eoTile.Elements[0].TextAlignment = TileItemContentAlignment.BottomLeft;
     eoTile.Elements[0].Appearance.Assign(AppearanceMid);
     return eoTile;
 }