Exemple #1
0
        /// <summary>
        /// 新增便签
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tsmNode_Click(object sender, EventArgs e)
        {
            KHNode node = null;

            try
            {
                IKHNodeService service = new KHNodeService();
                var            lst     = service.GetList();
                if (lst.Count >= 10)
                {
                    MessageBox.Show("最多只能建10个");
                }

                node            = new KHNode();
                node.FontName   = "微软雅黑";
                node.Bold       = 0;
                node.FontSize   = 12;
                node.FontColor  = "white";
                node.Content    = "";
                node.Enabled    = 1;
                node.CreateDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                node.UpdateDate = node.CreateDate;
                node.ID         = service.Add(node);
            }
            catch (Exception ex)
            {
                CommonMethod.WriteLogErr(ex.Message);
            }
            frmNode frmNode = new frmNode(node);

            frmNode.Show();
        }
Exemple #2
0
        /// <summary>
        /// 加载便签
        /// </summary>
        public void LoadNodeList()
        {
            try
            {
                List <KHNode> lst = new KHNodeService().GetList();
                foreach (KHNode node in lst)
                {
                    if (string.IsNullOrEmpty(node.Content))
                    {
                        continue;
                    }

                    frmNode fmNode = new frmNode(node);
                    fmNode.Show();
                }
            }
            catch (Exception ex)
            {
                CommonMethod.WriteLogErr(ex.Message);
            }
        }