private static Module Resolve(string kind) { Module module = null; if (kind == "csx" || kind == "cs") { module = new CsModule(); } else if (kind == "remote") { module = new RemoteModule(); } return(module); }
public bool Insert(CsModule admProfilUsers) { try { Galatee.Entity.Model.MODULE admProfilUser = Galatee.Tools.Utility.ConvertEntity <Galatee.Entity.Model.MODULE, CsModule>(admProfilUsers); using (galadbEntities context = new galadbEntities()) { return(Entities.InsertEntity <Galatee.Entity.Model.MODULE>(admProfilUser)); }; } catch (Exception ex) { throw ex; } }
private void dtg_Module_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (dtg_Module.SelectedItem != null && this.cbo_profile.SelectedItem != null) { List <CsModule> lesModule = ((ObservableCollection <CsModule>)dtg_Module.ItemsSource).ToList(); lesModule.ForEach(t => t.IsSelect = false); CsModule leModuleSelect = (CsModule)dtg_Module.SelectedItem; if (leModuleSelect.IsSelect == true) { leModuleSelect.IsSelect = false; } else { leModuleSelect.IsSelect = true; } } }
public List <CsModule> GetAllModuleFonction() { try { List <CsModule> lesModule = new List <CsModule>(); galadbEntities context = new galadbEntities(); List <Galatee.Entity.Model.MODULE> dt = AdminProcedures.RetourneListeToutModuleFonctionTotal(context); foreach (Galatee.Entity.Model.MODULE item in dt) { CsModule leModule = new CsModule(); leModule = Entities.ConvertObject <CsModule, Galatee.Entity.Model.MODULE>(item); leModule.lstFonction = Entities.ConvertObject <CsModuleDeFonction, Galatee.Entity.Model.MODULESDEFONCTION>(item.MODULESDEFONCTION.ToList()); lesModule.Add(leModule); } List <CsModule> lesModules = lesModule.OrderBy(g => g.PK_ID).ToList(); context.Dispose(); return(lesModules); } catch (Exception ex) { throw ex; } }