private void LoadDefaultData(CodeFrm.TableNames TableName)
 {
     switch (TableName)
     {
         case CodeFrm.TableNames.CDKashf:
             repositoryItemGridLookUpEditEmpKashfId.DataSource = SQLProvider.SelectCDKashf();
             repositoryItemGridLookUpEditEmpKashfId.DisplayMember = "EmpKashf";
             repositoryItemGridLookUpEditEmpKashfId.ValueMember = "EmpKashfId";
             break;
         case CodeFrm.TableNames.All:
             //CDKashf
             repositoryItemGridLookUpEditEmpKashfId.DataSource = SQLProvider.SelectCDKashf();
             repositoryItemGridLookUpEditEmpKashfId.DisplayMember = "EmpKashf";
             repositoryItemGridLookUpEditEmpKashfId.ValueMember = "EmpKashfId";
             //TBL_Emp
             repositoryItemGridLookUpEditEmpID.DataSource = SqlDB.LoadDataTable(@"SELECT EmpID, 
             Isnull(EMP_FIRST_NAME, '') + ' ' + Isnull(EMP_FATHER_NAME, '') + ' ' + Isnull(EMP_FAM_NAME, '') + ' ' + Isnull(EMP_FOURTH_NAME, '') AS Emp_Name FROM TBL_Emp");
             repositoryItemGridLookUpEditEmpID.DisplayMember = "Emp_Name";
             repositoryItemGridLookUpEditEmpID.ValueMember = "EmpID";
             break;
         default:
             break;
     }
     
 }
        private void LoadAsase()
        {
            foreach (DockPanel pnl in dockManagerMain.Panels)
                pnl.Enabled = false;

            repositoryItemLookUpEditasase_code.DataSource = FXFW.SqlDB.LoadDataTable(@"SELECT asase_code, asase_year, SPOS,
            (Select SCHOOL From TBLSCHOOL Where SPOS = CD_AsaseEmp.SPOS) AS SCHOOL, school_allcode FROM CD_AsaseEmp ORDER BY asase_code DESC");
            DataTable dt = (DataTable)repositoryItemLookUpEditasase_code.DataSource;
            if (dt.Rows.Count == 0)
            {
                CodeFrm FrmCode = new CodeFrm(CodeFrm.TableNames.CD_AsaseEmp) { Icon = FXFW.SqlDB.MakeIcon(imageCollection32.Images["CD_AsaseEmp.png"], 32, false) };
                FrmCode.ShowDialog();
                Application.Restart();
            }
            else
            {
                barEditItemasase_code.EditValue = dt.Rows[0]["asase_code"];
                ButtonPredefines btn = new ButtonPredefines();
                btn = ButtonPredefines.OK;
                repositoryItemLookUpEditasase_code_ButtonClick(repositoryItemLookUpEditasase_code, new ButtonPressedEventArgs(new EditorButton(btn)));
            }

            DataTable SalaryTbl = SQLProvider.SelectCD_AsaseSalary();
            repositoryItemLookUpEditAsaseSalary.DataSource = SalaryTbl;
            if (SalaryTbl.Rows.Count != 0)
                barEditItemAsaseSalary.EditValue = SalaryTbl.Rows[0]["AsaseSalaryId"];
            ButtonPredefines btnSalary = new ButtonPredefines();
            btnSalary = ButtonPredefines.OK;
            repositoryItemLookUpEditAsaseSalary_ButtonClick(repositoryItemLookUpEditAsaseSalary, new ButtonPressedEventArgs(new EditorButton(btnSalary)));
        }
 private void LoadDefaultData(CodeFrm.TableNames TableName)
 {
     switch (TableName)
     {
         case CodeFrm.TableNames.CDTakdeer:
             repositoryItemGridLookUpEditTakdeerId.DataSource = SqlDB.LoadDataTable(@"SELECT TakdeerId, TakdeerName, TakdeerName_e FROM CDTakdeer");
             repositoryItemGridLookUpEditTakdeerId.DisplayMember = "TakdeerName";
             repositoryItemGridLookUpEditTakdeerId.ValueMember = "TakdeerId";
             break;
         case CodeFrm.TableNames.All:
             //CDTakdeer
             repositoryItemGridLookUpEditTakdeerId.DataSource = SqlDB.LoadDataTable(@"SELECT TakdeerId, TakdeerName, TakdeerName_e FROM CDTakdeer");
             repositoryItemGridLookUpEditTakdeerId.DisplayMember = "TakdeerName";
             repositoryItemGridLookUpEditTakdeerId.ValueMember = "TakdeerId";
             //TBL_Emp
             repositoryItemGridLookUpEditEmpID.DataSource = SqlDB.LoadDataTable(@"SELECT EmpID, Isnull(EMP_FIRST_NAME, '') + ' ' + Isnull(EMP_FATHER_NAME, '') + ' ' + Isnull(EMP_FAM_NAME, '') + ' ' + Isnull(EMP_FOURTH_NAME, '') AS Emp_Name FROM TBL_Emp");
             repositoryItemGridLookUpEditEmpID.DisplayMember = "Emp_Name";
             repositoryItemGridLookUpEditEmpID.ValueMember = "EmpID";
             break;
         default:
             break;
     }
 }
 private void repositoryItemGridLookUpEditEmpKashfId_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
 {
     if (e.Button.Kind != DevExpress.XtraEditors.Controls.ButtonPredefines.Plus)
         return;
     CodeFrm FrmCode = new CodeFrm(CodeFrm.TableNames.CDKashf);
     FrmCode.ShowDialog();
     LoadDefaultData(CodeFrm.TableNames.CDKashf);
 }
 private void navBarItemEmpCD_AsaseSalary_LinkClicked(object sender, NavBarLinkEventArgs e)
 {
     CodeFrm FrmCode = new CodeFrm(CodeFrm.TableNames.CD_AsaseSalary) { MdiParent = this, Icon = FXFW.SqlDB.MakeIcon(imageCollection32.Images["CD_AsaseSalary.png"], 32, false) };
     FrmCode.Show();
 }
 private void LUEJOB_STATUS_ID_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
 {
     if (e.Button.Kind != DevExpress.XtraEditors.Controls.ButtonPredefines.Plus)
         return;
     CodeFrm FrmCode = new CodeFrm(CodeFrm.TableNames.CD_EmpState);
     FrmCode.ShowDialog();
     LoadDefaultData(TableName.CD_EmpState);
 }