Example #1
0
 public Boolean InsertScreen(Screen screen)
 {
     InitDB();
     Screen newScreen = new Screen();
     newScreen.Screenname = screen.Screenname;
     newScreen.Description = screen.Description;
     newScreen.Location = screen.Location;
     newScreen.Groupid = screen.Groupid;
     Boolean functionResult = false;
     try
     {
         newScreen.Save();
         functionResult = true;
     }
     catch (Exception ex)
     {
         functionResult = false;
     }
     return functionResult;
 }
Example #2
0
 public Boolean RemoveScreen(Screen screenName)
 {
     InitDB();
     Screen deleteScreen = new Screen();
     deleteScreen.LoadByPrimaryKey((long)screenName.Id);
     deleteScreen.MarkAsDeleted();
     deleteScreen.Save();
     return true;
 }
Example #3
0
 public Boolean ChangeScreenGroup(Screen screen)
 {
     InitDB();
     Screen updateScreen = new Screen();
     updateScreen.LoadByPrimaryKey((long)screen.Id);
     updateScreen.Groupid = screen.Groupid;
     updateScreen.Save();
     return true;
 }
Example #4
0
 public string RegisterDisplayClientLogin(string screenid)
 {
     InitDB();
     string functionResult = "_none"; ;
     ScreenCollection screenCollection = new ScreenCollection();
     screenCollection.Query.Where(screenCollection.Query.Screenname.Equal(screenid));
     screenCollection.Query.Load();
     if (screenCollection.Count <= 0) //New
     {
         Screen newScreen = new Screen();
         newScreen.Screenname = screenid;
         newScreen.Description = "New";
         newScreen.Location = "Default";
         newScreen.Groupid = "Global";
         newScreen.Lastactive = (DateTime)DateTime.Now;
         functionResult = "_registered";
         try
         {
             newScreen.Save();
             functionResult = "_registered";
         }
         catch (Exception ex)
         {
             functionResult = "_error";
         }
     }
     else
     {
         foreach (Screen item in screenCollection)
         {
             item.Lastactive = (DateTime)DateTime.Now;
             functionResult = item.Groupid;
         }
         screenCollection.Save();
     }
     return functionResult;
 }