Ejemplo n.º 1
0
        /// <summary>
        /// 즐겨찾기추가
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
        public bool InsertBookMark(BookMark_VO list)
        {
            using (SqlCommand cmd = new SqlCommand())
            {
                cmd.Connection  = new SqlConnection(Connstr);
                cmd.CommandText = "InsertBookMark";
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.AddWithValue("@User_ID", list.User_ID);
                cmd.Parameters.AddWithValue("@Screen_Code", list.Screen_Code);
                cmd.Parameters.AddWithValue("@Parent_Screen_Code", list.Parent_Screen_Code);
                cmd.Parameters.AddWithValue("@Type", list.Type);
                cmd.Parameters.AddWithValue("@Ins_Date", DateTime.Now);
                cmd.Parameters.AddWithValue("@Ins_Emp", "박상인");

                cmd.Connection.Open();
                var rowsAffected = cmd.ExecuteNonQuery();
                cmd.Connection.Close();

                return(rowsAffected > 0);
            }
        }
Ejemplo n.º 2
0
        private void 즐겨찾기ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MainForm_Service   service    = new MainForm_Service();
            MenuTree_Master_VO parentname = menulist.Find(item => item.Screen_Name == tvMenu.SelectedNode.Text);//부모코드find
            BookMark_VO        bookmark   = new BookMark_VO();

            bookmark.Parent_Screen_Code = parentname.Parent_Screen_Code;
            bookmark.Screen_Code        = parentname.Screen_Code;
            bookmark.User_ID            = UserInfo.User_ID;
            bookmark.Type = parentname.Screen_Name;

            if (!string.IsNullOrEmpty(parentname.Parent_Screen_Code))
            {
                if (!service.InsertBookMark(bookmark))
                {
                    MessageBox.Show("이미등록된 항목입니다.", "알림", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    tvBookMark.Nodes.Clear();
                    booklist = service.GetAll_BookMark(UserInfo.User_ID);
                    tvBookMark.Nodes.Add("즐겨찾기");

                    for (int i = 0; i < booklist.Count; i++)
                    {
                        tvBookMark.TopNode.Nodes.Add(booklist[i].Type);
                    }

                    tvBookMark.ExpandAll();
                }
            }
            else
            {
                MessageBox.Show("등록할 수 없는 항목입니다.", "알림", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Ejemplo n.º 3
0
        public bool InsertBookMark(BookMark_VO list)
        {
            MainForm_DAC dac = new DAC.MainForm_DAC();

            return(dac.InsertBookMark(list));
        }