コード例 #1
0
ファイル: Program.cs プロジェクト: keyanmca/_Signage
 public Boolean InsertCSScreen(CSScreen screen)
 {
     InitDB();
     User newUser = new User();
     CSScreen newScreen = new CSScreen();
     newScreen.Computername = screen.Computername;
     newScreen.Computerlocation = screen.Computerlocation;
     newScreen.Hardwareid = screen.Hardwareid;
     newScreen.Isdirectional = screen.Isdirectional;
     newScreen.Screenlocation = screen.Screenlocation;
     newScreen.Screennumber = screen.Screennumber;
     newScreen.Thumbnail = screen.Thumbnail;
     newScreen.Thumbnaildatetime = screen.Thumbnaildatetime;
     newScreen.Defaulttemplate = screen.Defaulttemplate;
     Boolean functionResult = false;
     try
     {
         newScreen.Save();
         functionResult = true;
     }
     catch (Exception ex)
     {
         functionResult = false;
     }
     return functionResult;
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: keyanmca/_Signage
        public Boolean ChangeCSScreen(CSScreen screen)
        {
            InitDB();
            CSScreen newScreen = new CSScreen();

            newScreen.LoadByPrimaryKey((long)screen.Id);
            newScreen.Computerlocation = screen.Computerlocation;
            newScreen.Computername = screen.Computername;
            newScreen.Hardwareid = screen.Hardwareid;
            newScreen.Isdirectional = screen.Isdirectional;
            newScreen.Lastqueriedcore = screen.Lastqueriedcore;
            newScreen.Screenlocation = screen.Screenlocation;
            newScreen.Screennumber = screen.Screennumber;
            newScreen.Thumbnail = screen.Thumbnail;
            newScreen.Thumbnaildatetime = screen.Thumbnaildatetime;

            Boolean functionResult = false;
            try
            {
                newScreen.Save();
                functionResult = true;
            }
            catch (Exception ex)
            {
                functionResult = false;
            }
            return functionResult;
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: keyanmca/_Signage
 public Boolean RemoveCSScreen(CSScreen screen)
 {
     InitDB();
     try
     {
         screen.MarkAsDeleted();
         screen.Save();
         Console.WriteLine(DateTime.Now.ToShortTimeString()+"  "+"Display deleted ok");
     }
     catch (Exception ex)
     {
         Console.WriteLine(DateTime.Now.ToShortTimeString()+"  "+"Error deleting display");
         return false;
     }
     return true;
 }