Ejemplo n.º 1
0
        private void btviewCm_Click(object sender, EventArgs e)
        {
            if (_isshowdocumet)
            {
                btviewCm.Text  = "View Document";
                _isshowdocumet = false;
                _document      = Webdetail.RtfText;
                string de = "";
                int    i  = 0;
                Webdetail.CreateNewDocument();

                string     addtitle = "";
                TreeNode[] node     = tvDocument.Nodes.Find(_IDDocument, true);
                if (node.Length > 0)
                {
                    if (addtitle == string.Empty)
                    {
                        addtitle = node[0].Text;
                    }
                    while (node[0].Parent != null)
                    {
                        addtitle = node[0].Parent.Text + "->" + addtitle;
                        node[0]  = node[0].Parent;
                    }
                }

                string          Title           = @"<!DOCTYPE html PUBLIC " + '"' + "-//W3C//DTD XHTML 1.0 Transitional//EN" + '"' + " " + '"' + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" + '"' + @">
<html>
	<head>
		<meta HTTP-EQUIV="         + '"' + "Content-Type" + '"' + " CONTENT=" + '"' + "text/html; charset=utf-8" + '"' + @" /><title>

		</title><style type="         + '"' + "text/css" + '"' + @">
			.cs7CED571B{text-align:left;text-indent:0pt;padding:0pt 0pt 0pt 0pt;margin:0pt 0pt 0pt 0pt}
			.csF4FE13F3{color:#000000;background-color:#C0FFC0;font-family:Times New Roman; font-size:12pt; font-weight:normal; font-style:italic; }

		</style>
	</head><body>
		<span><p class="         + '"' + @"cs7CED571B" + '"' + @"><span class=" + '"' + @"csF4FE13F3" + '"' + @"> </span><span class=" + '"' + @"csF4FE13F3" + '"' + @"> " + addtitle + @"</span></p></span>
	</body>
</html>";
                RichEditControl richEditControl = new RichEditControl();
                richEditControl.HtmlText = Title;
                richEditControl.Refresh();
                Webdetail.Document.InsertRtfText(Webdetail.Document.CaretPosition, richEditControl.RtfText);
                richEditControl.CreateNewDocument();
                foreach (DataRow dataRow in _dataFeedBack.Rows)
                {
                    string s = @"<!DOCTYPE html PUBLIC " + '"' + "-//W3C//DTD XHTML 1.0 Transitional//EN" + '"' + " " + '"' + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" + '"' + @">
<html>
	<head>
		<meta HTTP-EQUIV="         + '"' + "Content-Type" + '"' + " CONTENT=" + '"' + "text/html; charset=utf-8" + '"' + @" /><title>

		</title><style type="         + '"' + "text/css" + '"' + @">
			.cs742CAEF8{text-align:left;text-indent:36pt;padding:0pt 0pt 0pt 0pt;margin:0pt 0pt 0pt 36pt}
			.cs5EFED22F{color:#000000;background-color:FFFFC0;font-family:Times New Roman; font-size:12pt; font-weight:normal; font-style:italic; }
			.cs676C7CC9{text-align:left;text-indent:0pt;padding:12pt 0pt 0pt 0pt;margin:0pt 0pt 11pt 0pt}
			.csC0D2101E{color:#0000FF;background-color:FFFFC0;font-family:Times New Roman; font-size:11pt; font-weight:normal; font-style:italic; }

		</style>
	</head><body>
		<span><p class="         + '"' + @"cs742CAEF8" + '"' + @"><span class=" + '"' + @"cs5EFED22F" + '"' + @">-------------------------------------------------------</span></p><p class=" + '"' + @"cs676C7CC9" + '"' + @"><span class=" + '"' + @"csC0D2101E" + '"' + @">" + dataRow["DateCreated"].ToString() + @"</span><span class=" + '"' + "csC0D2101E" + '"' + @">			</span><span class="+ '"' + @"csC0D2101E" + '"' + @"> " + dataRow["Creator"].ToString() + @"</span></p></span>
	</body>
</html>"
                    ;
                    richEditControl.HtmlText = s;
                    richEditControl.Refresh();
                    de = dataRow["Detail"].ToString();
                    Webdetail.Document.InsertRtfText(Webdetail.Document.CaretPosition, richEditControl.RtfText);
                    Webdetail.Document.InsertRtfText(Webdetail.Document.CaretPosition, de);
                    i = de.Length;
                }
                richEditControl.Dispose();
            }
            else
            {
                btviewCm.Text     = "View comment";
                _isshowdocumet    = true;
                Webdetail.RtfText = _document;
                _document         = "";
            }
        }
Ejemplo n.º 2
0
        protected void linkLabel_LinkClick(object sender, LinkLabelLinkClickedEventArgs e)
        {
            LinkLabel link = (LinkLabel)sender;

            Webdetail.CreateNewDocument();
            CTLSearchBug searchBug      = new CTLSearchBug();
            DataTable    createdocument = searchBug.GetCreateDocument(_Tablemanin.Rows[Convert.ToInt32(link.Name)]["ID"].ToString());

            if (createdocument != null)
            {
                if (createdocument.Rows.Count > 0)
                {
                    _isPrintClick = false;
                    string create = createdocument.Rows[0]["Creator"].ToString();
                    string date   = createdocument.Rows[0]["DateCreated"].ToString();
                    if (createdocument.Rows[0]["UpDateBy"].ToString().Trim() != "NULL" && createdocument.Rows[0]["UpDateBy"].ToString().Trim() == "null")
                    {
                        create = createdocument.Rows[0]["UpDateBy"].ToString();
                    }
                    DataTable tbTenNV = searchBug.GetNameCreateDoc(create);
                    Webdetail.CreateNewDocument();
                    if (createdocument.Rows[0]["DateModify"].ToString() != string.Empty)
                    {
                        date = createdocument.Rows[0]["DateModify"].ToString();
                    }
                    if (tbTenNV != null)
                    {
                        if (tbTenNV.Rows.Count > 0)
                        {
                            create = tbTenNV.Rows[0]["TenNV"] + " - " + tbTenNV.Rows[0]["MaST"] + " - " + tbTenNV.Rows[0]["TenSieuThi"];
                        }
                    }

                    string s = @"<!DOCTYPE html PUBLIC " + '"' + "-//W3C//DTD XHTML 1.0 Transitional//EN" + '"' + " " + '"' + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" + '"' + @">
                        <html>
	                        <head>
		                        <meta HTTP-EQUIV="         + '"' + "Content-Type" + '"' + " CONTENT=" + '"' + "text/html; charset=utf-8" + '"' + @" /><title>

		                        </title><style type="         + '"' + "text/css" + '"' + @">
			                        .cs742CAEF8{text-align:center;text-indent:36pt;padding:0pt 0pt 0pt 0pt;margin:0pt 0pt 0pt 36pt}
			                        .cs5EFED22F{color:#000000;background-color:#FFFFC0;font-family:Times New Roman; font-size:11pt; font-weight:normal; font-style:italic; }
			                        .cs676C7CC9{text-align:left;text-indent:0pt;padding:0pt 0pt 0pt 0pt;margin:0pt 0pt 0pt 0pt}
			                        .csC0D2101E{color:#0000FF;background-color:#FFFFC0;font-family:Times New Roman; font-size:11pt; font-weight:normal; font-style:italic; }
                                    .cs6EF5D217{color:#0000FF;background-color:#FFFFC0;font-family:Times New Roman; font-size:11pt; font-weight:normal; font-style:italic; }
                                    .cs3D49C0F4{text-align:center;text-indent:36pt;padding:0pt 0pt 0pt 0pt;margin:0pt 0pt 0pt 36pt}

		                        </style>
	                        </head><body>
		                        <span><p class="         + '"' + @"cs742CAEF8" + '"' + @"><span class=" + '"' + @"csC0D2101E" + '"' + @">" + date + "    --    " + @"</span><span class=" + '"' + "csC0D2101E" + '"' + @">			</span><span class="+ '"' + @"csC0D2101E" + '"' + @"> " + create + @"</span></p></span><p class=" + '"' + "cs3D49C0F4" + '"' + "><span class=" + '"' + "cs6EF5D217" + '"' + @">Tài liệu mật - lưu hành nội bộ</span></p><p class=" + '"' + @"cs742CAEF8" + '"' + @"><span class=" + '"' + @"cs5EFED22F" + '"' + @">-------------------------------------------------------</span></p>
	                        </body>
                        </html>"
                    ;
                    RichEditControl richEditControl = new RichEditControl();
                    richEditControl.HtmlText = s;
                    richEditControl.Refresh();
                    Webdetail.Document.InsertRtfText(Webdetail.Document.CaretPosition, richEditControl.RtfText);
                    richEditControl.Dispose();
                }
            }

            //Webdetail.RtfText = dataTable.Rows[0]["IssueContent"].ToString();
            RichEditControl noidungftf = new RichEditControl();

            noidungftf.RtfText = _Tablemanin.Rows[Convert.ToInt32(link.Name)]["IssueContent"].ToString();
            Webdetail.Document.InsertRtfText(Webdetail.Document.CaretPosition, noidungftf.RtfText);
            noidungftf.Dispose();
            //Webdetail.RtfText = _Tablemanin.Rows[Convert.ToInt32(link.Name)]["IssueContent"].ToString();
            _IDDocument = _Tablemanin.Rows[Convert.ToInt32(link.Name)]["ID"].ToString();
            if (CheckFeedback(_IDDocument))
            {
                //Webdetail.Height -= 30;
                btviewCm.Enabled = true;
            }
            else
            {
                btviewCm.Enabled = false;
            }
            flowLayoutPanel1.Controls.Clear();
            flowLayoutPanel1.Controls.Add(labThongTinlienQuang);
            for (int i = 0; i < _Tablemanin.Rows.Count; i++)
            {
                if (i.ToString() == link.Name)
                {
                    continue;
                }
                ControlAtt controlAtt = new ControlAtt();
                //LinkLabel linkLabel = new LinkLabel();
                //linkLabel.Text = _Tablemanin.Rows[i]["Title"].ToString();
                //linkLabel.Name = i.ToString();
                //linkLabel.LinkClicked += new LinkLabelLinkClickedEventHandler(linkLabel_LinkClick);
                //flowLayoutPanel1.Controls.Add(linkLabel);
                controlAtt.getlink.Text         = _Tablemanin.Rows[i]["Event"].ToString();
                controlAtt.getlink.Name         = i.ToString();
                controlAtt.getlink.LinkClicked += new LinkLabelLinkClickedEventHandler(linkLabel_LinkClick);
                controlAtt.getpicturebox.Image  = imageList2.Images[0];
                flowLayoutPanel1.Controls.Add(controlAtt);
            }
            _TableAttfile = null;
            _TableAttfile = _control.GetAttachment(_Tablemanin.Rows[Convert.ToInt32(link.Name)]["ID"].ToString());
            loadAttachmentFile(_TableAttfile);
            createdocument.Dispose();
            _TableAttfile = null;
        }