public CodeFrm(GridViewNames CodeName) { InitializeComponent(); ViewName = CodeName; switch (CodeName) { case GridViewNames.CDMarahel: gridControlCode.MainView = gridViewCDMarahel; LoadData(GridViewNames.CDMarahel); Text += " المراحل"; break; case GridViewNames.CDAlsofof: gridControlCode.MainView = gridViewCDAlsofof; LoadData(GridViewNames.CDAlsofof); Text += " الصفوف"; break; case GridViewNames.CDEFasl: gridControlCode.MainView = gridViewCDEFasl; LoadData(GridViewNames.CDEFasl); Text += " الفصول"; break; case GridViewNames.CDAlokobat: gridControlCode.MainView = gridViewCDAlokobat; LoadData(GridViewNames.CDAlokobat); Text += " العقوبات"; break; case GridViewNames.CDColekeyat: gridControlCode.MainView = gridViewCDColekeyat; LoadData(GridViewNames.CDColekeyat); Text += " سلوكيات"; break; case GridViewNames.CDDyana: gridControlCode.MainView = gridViewCDDyana; LoadData(GridViewNames.CDDyana); Text += " الديانه"; break; case GridViewNames.cdEyab_code: gridControlCode.MainView = gridViewcdEyab_code; LoadData(GridViewNames.cdEyab_code); Text += " انواع الغياب"; break; case GridViewNames.CDGov: gridControlCode.MainView = gridViewCDGov; LoadData(GridViewNames.CDGov); Text += " المحافظات"; break; case GridViewNames.CDHaletalked: gridControlCode.MainView = gridViewCDHaletalked; LoadData(GridViewNames.CDHaletalked); Text += " القيود"; break; case GridViewNames.CDHealth_office: gridControlCode.MainView = gridViewCDHealth_office; LoadData(GridViewNames.CDHealth_office); Text += " مكاتب الصحه"; break; case GridViewNames.CDJop: gridControlCode.MainView = gridViewCDJop; LoadData(GridViewNames.CDJop); Text += " الوظائف"; break; case GridViewNames.CDLogatcode: gridControlCode.MainView = gridViewCDLogatcode; LoadData(GridViewNames.CDLogatcode); Text += " اللغات"; break; case GridViewNames.CDEltataem_code: gridControlCode.MainView = gridViewCDEltataem_code; LoadData(GridViewNames.CDEltataem_code); Text += " التطعيمات"; break; case GridViewNames.CDGamaat_alnashat: gridControlCode.MainView = gridViewCDGamaat_alnashat; LoadData(GridViewNames.CDGamaat_alnashat); Text += " الجماعات"; break; case GridViewNames.CDMantaka: gridControlCode.MainView = gridViewCDMantaka; LoadData(GridViewNames.CDMantaka); Text += " المناطق"; break; case GridViewNames.CDMarakez: gridControlCode.MainView = gridViewCDMarakez; LoadData(GridViewNames.CDMarakez); Text += " المراكز"; break; case GridViewNames.CDMawad: gridControlCode.MainView = advBandedGridViewCDMawad; LoadData(GridViewNames.CDMawad); Text += " المواد"; break; case GridViewNames.CDnationalty: gridControlCode.MainView = gridViewCDnationalty; LoadData(GridViewNames.CDnationalty); Text += " المواد"; break; case GridViewNames.CDQualification: gridControlCode.MainView = gridViewCDQualification; LoadData(GridViewNames.CDQualification); Text += " المؤهلات"; break; case GridViewNames.CDEqamaType: gridControlCode.MainView = gridViewCDEqamaType; LoadData(GridViewNames.CDEqamaType); Text += " انواع الاقامه"; break; case GridViewNames.CDSaltalkaraba: gridControlCode.MainView = gridViewCDSaltalkaraba; LoadData(GridViewNames.CDSaltalkaraba); Text += " انواع صلة القرابه"; break; case GridViewNames.CDRelativeCode: gridControlCode.MainView = gridViewCDRelativeCode; LoadData(GridViewNames.CDRelativeCode); Text += " انواع الاخوه و الاقارب"; break; case GridViewNames.CDTakasosat: gridControlCode.MainView = gridViewCDTakasosat; LoadData(GridViewNames.CDTakasosat); Text += " انواع التخصصات"; break; case GridViewNames.CDAlanshata: gridControlCode.MainView = gridViewCDAlanshata; LoadData(GridViewNames.CDAlanshata); Text += " انواع الانشطه الرياضيه"; break; case GridViewNames.AppOptions: gridControlCode.MainView = layoutViewAppOptions; LoadData(GridViewNames.AppOptions); Text += " خيارات البرنامج"; break; default: break; } }
private void LoadData(GridViewNames CodeName) { DataTable dt = new DataTable(); switch (CodeName) { case GridViewNames.CDMarahel: dt = FXFW.SqlDB.LoadDataTable(@"SELECT marhala_code, marhala_name, marhala_name_e FROM CDMarahel"); break; case GridViewNames.CDAlsofof: dt = FXFW.SqlDB.LoadDataTable(@"SELECT alsofof_code, alsofof_name, marhala_code, alsofof_name_e, Shortly, Shortlye FROM CDAlsofof"); repositoryItemGridLookUpEditmarhala_code.DataSource = FXFW.SqlDB.LoadDataTable("Select marhala_code, marhala_name, marhala_name_e From CDMarahel"); break; case GridViewNames.CDEFasl: dt = FXFW.SqlDB.LoadDataTable(@"SELECT fasl_code, fasl_name, fasl_name_e FROM CDEFasl"); break; case GridViewNames.CDAlokobat: dt = FXFW.SqlDB.LoadDataTable(@"SELECT code_alokobat, name_alokobat, name_alokobat_e FROM CDAlokobat"); break; case GridViewNames.CDColekeyat: dt = FXFW.SqlDB.LoadDataTable(@"SELECT colekeyat_code, colekeyat_name, colekeyat_name_e FROM CDColekeyat"); break; case GridViewNames.CDDyana: dt = FXFW.SqlDB.LoadDataTable(@"SELECT dyana_code, dyana_name, dyana_name_e FROM CDDyana"); break; case GridViewNames.cdEyab_code: dt = FXFW.SqlDB.LoadDataTable(@"SELECT eyab_code, eyab_Name, eyab_Name_e FROM cdEyab_code"); break; case GridViewNames.CDGov: dt = FXFW.SqlDB.LoadDataTable(@"SELECT GOV_CD, GOV, GOVe FROM CDGov"); break; case GridViewNames.CDHaletalked: dt = FXFW.SqlDB.LoadDataTable(@"SELECT haletalked_code, haletalked_name, haletalked_name_e FROM CDHaletalked"); break; case GridViewNames.CDHealth_office: dt = FXFW.SqlDB.LoadDataTable(@"SELECT HE_CODE, HE_DESC, HE_DESC_e, GOV_CD FROM CDHealth_office"); repositoryItemGridLookUpEditGOV_CD.DataSource = FXFW.SqlDB.LoadDataTable("Select GOV_CD, GOV, GOVe From CDGov"); break; case GridViewNames.CDJop: dt = FXFW.SqlDB.LoadDataTable(@"SELECT jop_code, jop_name, jop_name_e FROM CDJop"); break; case GridViewNames.CDLogatcode: dt = FXFW.SqlDB.LoadDataTable(@"SELECT loga_code, loga_name, loga_name_e FROM CDLogatcode"); break; case GridViewNames.CDEltataem_code: dt = FXFW.SqlDB.LoadDataTable(@"SELECT code_eltataem, name_eltataem, name_eltataem_e FROM CDEltataem_code"); break; case GridViewNames.CDGamaat_alnashat: dt = FXFW.SqlDB.LoadDataTable(@"SELECT code_gamaat_alnashat, name_gamaat_alnashat, name_gamaat_alnashat_e FROM CDGamaat_alnashat"); break; case GridViewNames.CDMantaka: dt = FXFW.SqlDB.LoadDataTable(@"SELECT mantaka_code, GOV_CD, mantaka_name, mantaka_name_e FROM CDMantaka"); repositoryItemGridLookUpEditGOV_CD.DataSource = FXFW.SqlDB.LoadDataTable("Select GOV_CD, GOV, GOVe From CDGov"); break; case GridViewNames.CDMarakez: dt = FXFW.SqlDB.LoadDataTable(@"SELECT markaz_code, GOV_CD, markaz_name, markaz_name_e FROM CDMarakez"); repositoryItemGridLookUpEditGOV_CD.DataSource = FXFW.SqlDB.LoadDataTable("Select GOV_CD, GOV, GOVe From CDGov"); break; case GridViewNames.CDMawad: dt = FXFW.SqlDB.LoadDataTable(@"SELECT mawad_no, mowad_name, shortcut, mowad_name_e, shortcut_e, kg, prim, prp, sec, gadwal, exam FROM CDMawad"); break; case GridViewNames.CDnationalty: dt = FXFW.SqlDB.LoadDataTable(@"SELECT nationaltyId, nationaltyname, nationaltyname_e FROM CDnationalty"); break; case GridViewNames.CDQualification: dt = FXFW.SqlDB.LoadDataTable(@"SELECT qualId, qualName, qualName_e, trbawy FROM CDQualification"); break; case GridViewNames.CDEqamaType: dt = FXFW.SqlDB.LoadDataTable(@"SELECT EqamaID, EqamaName, EqamaNameE FROM CDEqamaType"); break; case GridViewNames.CDSaltalkaraba: dt = FXFW.SqlDB.LoadDataTable(@"SELECT saltalkarba_code, saltalkaraba_name FROM CDSaltalkaraba"); break; case GridViewNames.CDRelativeCode: dt = FXFW.SqlDB.LoadDataTable(@"SELECT RelativeCode, RelativeName, RelativeNamee FROM CDRelativeCode"); break; case GridViewNames.CDTakasosat: dt = FXFW.SqlDB.LoadDataTable(@"SELECT SPECIAL_CODE, SPECIAL_DESC, SPECIAL_DESCE, alsofof_code FROM CDTakasosat"); repositoryItemSearchLookUpEditalsofof_code.DataSource = FXFW.SqlDB.LoadDataTable(@"Select alsofof_code, alsofof_name, alsofof_name_e From CDAlsofof"); repositoryItemSearchLookUpEditalsofof_code.DisplayMember = "alsofof_name"; repositoryItemSearchLookUpEditalsofof_code.ValueMember = "alsofof_code"; break; case GridViewNames.CDAlanshata: dt = FXFW.SqlDB.LoadDataTable(@"SELECT code_alnashat, name_alnashat, name_alnashatE FROM CDAlanshata"); break; case GridViewNames.AppOptions: dt = FXFW.SqlDB.LoadDataTable(@"SELECT OpCodeID, Writer, Dictated, Writer2, Dictated2, ApprovedBy, SchoolLogo FROM AppOptions"); break; default: break; } gridControlCode.DataSource = dt; }