public ScreenShortcutEdit(t_ScreenShortcut shortcut) : this() { this.Title = "编辑设备信息"; _shortcut = shortcut; this.DataContext = _shortcut; this.ScreenCombobox.SelectedItem = ScreenTreeVM.Instance.AllScreens.FirstOrDefault(s => s.ScreenID == _shortcut.ScreenId); _isNew = false; }
public void Insert(t_ScreenShortcut shortcut) { string sql = "INSERT INTO T_SCREEN_SHORTCUT(SCREENID, SCREENNAME, SCREENDESCRIPTION, SCREENIMAGE) VALUES(@SCREENID, @SCREENNAME, @SCREENDESCRIPTION, @SCREENIMAGE)"; base.db.ExecuteNoQuery( sql, new SqlParameter[]{ new SqlParameter("@SCREENID", shortcut.ScreenId), new SqlParameter("@SCREENNAME", shortcut.ScreenName ?? string.Empty), new SqlParameter("@SCREENDESCRIPTION", shortcut.ScreenDescription ?? string.Empty), new SqlParameter("@SCREENIMAGE", shortcut.ImageBuffer ?? new byte[0]) }); }
public void Update(t_ScreenShortcut shortcut) { string sql = "UPDATE T_SCREEN_SHORTCUT SET SCREENID = @SCREENID, SCREENNAME = @SCREENNAME, SCREENDESCRIPTION = @SCREENDESCRIPTION, SCREENIMAGE = @SCREENIMAGE WHERE ID = @ID"; base.db.ExecuteNoQuery( sql, new SqlParameter[]{ new SqlParameter("@ID", shortcut.Id), new SqlParameter("@SCREENID", shortcut.ScreenId), new SqlParameter("@SCREENNAME", shortcut.ScreenName), new SqlParameter("@SCREENDESCRIPTION", shortcut.ScreenDescription), new SqlParameter("@SCREENIMAGE", shortcut.ImageBuffer) }); }