Exemple #1
0
        private void LoadComboBox()
        {
            JPersonel           objAutoDefine = new JPersonel(_Code);
            JSpecificationTypes types         = new JSpecificationTypes();

            types.SetComboBox(cmbSpecific, objAutoDefine.Specification);
            JEmploymentTypes empTypes = new JEmploymentTypes();

            empTypes.SetComboBox(cmbEmpType, objAutoDefine.EmployeeType);
            JCertificateTypes cerTypes = new JCertificateTypes();

            cerTypes.SetComboBox(cmbCertType, objAutoDefine.CertificateType);
        }
Exemple #2
0
        public JPersonelForm(int pCode)
        {
            InitializeComponent();
            State = ClassLibrary.JFormState.Update;
            accountControl.Location = new Point(10, 70);
            JPersonel objAutoDefine = new JPersonel(pCode);

            _PCode = objAutoDefine.PersonCode;
            _Code  = pCode;
            tabPage1.Controls.Add(accountControl);
            accountControl.BringToFront();
            LoadDefault();
            LoadComboBox();
            LoadData();
            LoadProperties();
        }
Exemple #3
0
        public void LoadData()
        {
            accountControl.PersonCode = _PCode;
            accountControl.LoadData();
            personControl.SelectedCode = _PCode;
            JPersonel objAutoDefine = new JPersonel(_Code);

            personControl.SelectedCode = objAutoDefine.PersonCode;
            txtPersonelCode.Text       = objAutoDefine.PersonelCode.ToString();
            txtCertNumber.Text         = objAutoDefine.CertificateNumber;
            txtCertExpDate.Date        = objAutoDefine.CertificateExpirationDate;
            txtCertDate.Date           = objAutoDefine.CertificateDate;
            cmbFleet.SelectedValue     = objAutoDefine.FleetCode;
            jArchiveList1.ObjectCode   = _Code;

            personControl.Enabled = false;
            LoadContracts();
        }
Exemple #4
0
        private bool Save()
        {
            bool result = false;

            if (!Validate())
            {
                return(false);
            }
            JPersonel objAutoDefine = new JPersonel(_Code);

            objAutoDefine.PersonCode                = personControl.SelectedCode;
            objAutoDefine.PersonelCode              = txtPersonelCode.Text;
            objAutoDefine.CertificateDate           = txtCertDate.Date;
            objAutoDefine.CertificateExpirationDate = txtCertExpDate.Date;
            objAutoDefine.CertificateNumber         = txtCertNumber.Text;
            if (cmbCertType.SelectedValue != null)
            {
                objAutoDefine.CertificateType = Convert.ToInt32(cmbCertType.SelectedValue);
            }
            if (cmbCertType.SelectedValue != null)
            {
                objAutoDefine.EmployeeType = Convert.ToInt32(cmbEmpType.SelectedValue);
            }
            if (cmbFleet.SelectedValue != null)
            {
                objAutoDefine.FleetCode = Convert.ToInt32(cmbFleet.SelectedValue);
            }
            if (cmbSpecific.SelectedValue != null)
            {
                objAutoDefine.Specification = Convert.ToInt32(cmbSpecific.SelectedValue);
            }

            if (State == ClassLibrary.JFormState.Insert)
            {
                _Code  = objAutoDefine.Insert();
                result = _Code > 0;
                if (result)
                {
                    accountControl.PersonCode = objAutoDefine.PersonCode;
                    accountControl.Save();
                    State = ClassLibrary.JFormState.Update;
                }
            }
            else
            if (State == ClassLibrary.JFormState.Update)
            {
                result = objAutoDefine.Update();
                accountControl.PersonCode = objAutoDefine.PersonCode;
                accountControl.Save();
            }
            if (jArchiveList1.ObjectCode == 0)
            {
                jArchiveList1.ObjectCode = _Code;
            }

            jArchiveList1.ArchiveList();
            if (result)
            {
                jPropertyValue.ValueObjectCode = _Code;
                jPropertyValue.Save();
            }
            return(result);
        }