Beispiel #1
0
 public ILookup saveGroup(Group group)
 {
     MainFactory.getLogSvc().logAction("Insert new group - " + group.Text + "into console.");
     GROUP_lkp lkp = new GROUP_lkp {
         GROUP_TEXT = group.Text
     };
     try {
         using (ConsoleDataContext db = (ConsoleDataContext)MainFactory.getDb("Console", false)) {
             db.GROUP_lkps.InsertOnSubmit(lkp);
             db.SubmitChanges();
             group = new Group(lkp.GROUP_ID, lkp.GROUP_TEXT);
         }
     } catch (SqlException se) {
         MainFactory.getLogSvc().logError(this.GetType().Name,
                                          MainFactory.getCurrentMethod(),
                                          "rs-sg-01",
                                          se.Message + "\n" + se.StackTrace);
         throw new Exception("Unable to create Group . Please see error log for further details.");
     }
     return (ILookup)group;
 }
Beispiel #2
0
 public ILookup createGroup(string text)
 {
     Group group = new Group(text);
     return this.repository.saveGroup(group);
 }