Ejemplo n.º 1
0
        //수정버튼
        private void Btn_update_Click(object sender, EventArgs e)
        {
            string userid      = cut.UserID;
            string focuseduser = comment_list.FocusedNode["InsertUserID"].ToString();
            int    rowHandle   = comment_list.FocusedNode.Id;

            if (Comment.OptionsColumn.AllowEdit)
            {
                Comment.OptionsColumn.AllowEdit   = false; //전체 수정 끝
                btn_img_c.Buttons[0].Visible      = false;
                img_c_img.OptionsColumn.AllowEdit = false;

                int    seq     = int.Parse(comment_list.FocusedNode["Seq"].ToString());
                string comment = comment_list.FocusedNode["Comment"].ToString();

                using (var wb = new WsBiz(AppConfig.DEFAULTDB))
                {
                    var query     = "dbo.usp_HelpCommentHs_CRUD";
                    var paramList = new string[] {
                        "@iOp1"
                        , "@iOp2"
                        , "@Seq"
                        , "@Comment"
                        , "@ImageData"
                        , "@UpdateUserId"
                    };

                    var valueList = new object[] { "U"
                                                   , "1"
                                                   , seq
                                                   , comment
                                                   , comment_list.FocusedNode["ImageData"] == DBNull.Value?null:comment_list.FocusedNode["ImageData"] //이미지 데이터 변환 코딩
                                                   , userid };

                    wb.Tx_ExecuteNonQuery(AppConfig.DEFAULTDB, query, AppConfig.COMMANDSP, paramList, valueList);
                }

                SelectionData();
                comment_list.FocusedNode = comment_list.FindNodeByID(rowHandle);
            }

            else
            {
                if (userid == focuseduser)
                {
                    Comment.OptionsColumn.AllowEdit   = true; //전체 수정 가능
                    btn_img_c.Buttons[0].Visible      = true;
                    img_c_img.OptionsColumn.AllowEdit = true;
                    update_image_file = string.Empty;
                }
                if (userid.ToString() == "SYSTEM")
                {
                    Comment.OptionsColumn.AllowEdit   = true; //전체 수정 가능
                    btn_img_c.Buttons[0].Visible      = true;
                    img_c_img.OptionsColumn.AllowEdit = true;
                    update_image_file = string.Empty;
                }
            }
        }
Ejemplo n.º 2
0
        //대댓글 등록
        private void Btn_comment_Click(object sender, EventArgs e)
        {
            //string nowtime;
            ////현재시간 받아오기
            //System.DateTime.Now.ToString("yyyy");
            //nowtime = DateTime.Now.ToString("yyyy-MM-dd-HH-mm");
            //string reply_comment = comment_list.FocusedNode["Comment"].ToString();
            //if(seq != null){
            //    ParentNode.Nodes.Add("아이디", nowtime,"수정버튼을 누른후 댓글입력", "댓글", "수정", "삭제", "첨부파일");
            //    comment_list.ExpandAll();
            //    comment_list.Invalidate();
            //}
            int     seq       = int.Parse(comment_list.FocusedNode["Seq"].ToString());
            int     rowHandle = comment_list.FocusedNode.Id;
            DataSet ds;

            string userid = cut.UserID;

            using (var wb = new WsBiz(AppConfig.DEFAULTDB))
            {
                byte[] fileValue = null;
                if (img_box.Image != null)
                {
                    fileValue = File.ReadAllBytes(image_file);
                }


                var query     = "dbo.usp_HelpCommentHs_CRUD";
                var paramList = new string[] { "@iOp1"
                                               , "@iOp2"
                                               , "@MenuID"
                                               , "@ParentSeq"
                                               , "@Comment"
                                               , "@ImageData"
                                               , "@InsertUserID" };

                var valueList = new object[] { "C"
                                               , "2"
                                               , menuid
                                               , seq
                                               , ""
                                               , null //이미지 데이터 변환 코딩
                                               , userid };

                wb.Tx_ExecuteNonQuery(AppConfig.DEFAULTDB, query, AppConfig.COMMANDSP, paramList, valueList);
            }

            //comment_txt.Clear();
            //img_box.Image = null;
            SelectionData();
            TreeListNode newnode = comment_list.FindNodeByID(rowHandle);

            comment_list.FocusedNode = newnode.Nodes[newnode.Nodes.Count - 1];
        }
Ejemplo n.º 3
0
        //댓글 등록
        private void comment_save_Click(object sender, EventArgs e)
        {
            string commenttxt;
            string nowtime;

            //현재시간 받아오기
            System.DateTime.Now.ToString("yyyy");
            nowtime = DateTime.Now.ToString("yyyy-MM-dd-HH-mm");

            string userid = cut.UserID;

            commenttxt = comment_txt.Text.ToString();

            if (comment_txt.Text.ToString() == null)
            {
                MessageBox.Show("내용을 입력해주세요");
            }

            DataSet ds;

            using (var wb = new WsBiz(AppConfig.DEFAULTDB))
            {
                byte[] fileValue = null;
                if (img_box.Image != null)
                {
                    fileValue = File.ReadAllBytes(image_file);
                }


                var query     = "dbo.usp_HelpCommentHs_CRUD";
                var paramList = new string[] { "@iOp1"
                                               , "@iOp2"
                                               , "@MenuID"
                                               , "@Comment"
                                               , "@ImageData"
                                               , "@InsertUserID" };

                var valueList = new object[] { "C"
                                               , "1"
                                               , menuid
                                               , commenttxt
                                               , fileValue //이미지 데이터 변환 코딩
                                               , userid };

                wb.Tx_ExecuteNonQuery(AppConfig.DEFAULTDB, query, AppConfig.COMMANDSP, paramList, valueList);
            }

            comment_txt.Clear();
            img_box.Image = null;

            SelectionData();
            comment_list.MoveLast();
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 삭제 처리 Method
        /// </summary>
        private void DeleteData()
        {
            using (WsBiz wb = new WsBiz(AppConfig.DEFAULTDB))
            {
                string query = " DELETE FROM MatInfoPopup WHERE Seq = @Seq ";

                string[] paramList = new string[] { "@Seq" };

                object[] valueList = new object[] { Convert.ToInt64(viewGetMatInfo.GetFocusedDataRow()["Seq"]) };

                wb.Tx_ExecuteNonQuery(AppConfig.DEFAULTDB, query, AppConfig.COMMANDTEXT, paramList, valueList);
            }
        }
Ejemplo n.º 5
0
        private void ExceptionLogSave()
        {
            using (WsBiz wb = new WsBiz(AppConfig.DEFAULTDB))
            {
                string query = "dbo.ExceptionLog_Save";

                string[] paramList = new string[] { "@Message",
                                                    "@Trace",
                                                    "@Location",
                                                    "@Source" };

                object[] valueList = new object[] { _exception.Message,
                                                    _exception.StackTrace,
                                                    _exception.TargetSite.ToString(),
                                                    _exception.Source };

                wb.Tx_ExecuteNonQuery(AppConfig.DEFAULTDB, query, AppConfig.COMMANDSP, paramList, valueList);
            }
        }
Ejemplo n.º 6
0
        //삭제처리
        private void Btn_c_delete_Click(object sender, EventArgs e)
        {
            string focuseduser = comment_list.FocusedNode["InsertUserID"].ToString();

            if (comment_list.GetFocusedRowCellValue(Comment).ToString() == "삭제된 댓글입니다.")
            {
                MessageBox.Show("이미 삭제 된 글입니다.", "알림");
                return;
            }

            if (cut.UserID.ToString() == focuseduser)
            {
                if (MessageBox.Show("글을 삭제하시겠습니까?", "글 삭제", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    int seq       = int.Parse(comment_list.FocusedNode["Seq"].ToString());
                    int rowHandle = comment_list.FocusedNode.Id;
                    using (var wb = new WsBiz(AppConfig.DEFAULTDB))
                    {
                        var query     = "dbo.usp_HelpCommentHs_CRUD";
                        var paramList = new string[] { "@iOp1"
                                                       , "@iOp2"
                                                       , "@Seq" };

                        var valueList = new object[] { "D"
                                                       , "1"
                                                       , seq };

                        wb.Tx_ExecuteNonQuery(AppConfig.DEFAULTDB, query, AppConfig.COMMANDSP, paramList, valueList);
                    }

                    SelectionData();
                    comment_list.FocusedNode = comment_list.FindNodeByID(rowHandle);
                }
                else
                {
                }
            }
            if (cut.UserID.ToString() == "SYSTEM")
            {
                if (MessageBox.Show("글을 삭제하시겠습니까?", "글 삭제", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    int seq       = int.Parse(comment_list.FocusedNode["Seq"].ToString());
                    int rowHandle = comment_list.FocusedNode.Id;
                    using (var wb = new WsBiz(AppConfig.DEFAULTDB))
                    {
                        var query     = "dbo.usp_HelpCommentHs_CRUD";
                        var paramList = new string[] { "@iOp1"
                                                       , "@iOp2"
                                                       , "@Seq" };

                        var valueList = new object[] { "D"
                                                       , "1"
                                                       , seq };

                        wb.Tx_ExecuteNonQuery(AppConfig.DEFAULTDB, query, AppConfig.COMMANDSP, paramList, valueList);
                    }

                    SelectionData();
                    comment_list.FocusedNode = comment_list.FindNodeByID(rowHandle);
                }
                else
                {
                    return;
                }
            }
        }