Advertisement
Guest User

Untitled

a guest
Aug 25th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.91 KB | None | 0 0
  1. ViewState["TCount"] = TCount;
  2.  
  3. FILE NOTEClient/Ref:Surname/Date:15 July 2016Matter:Attended by:LCTime engaged:1 hour – .Time engaged – 1 hour
  4.  
  5. string count = Regex.Replace(CKEditor1.Text, @"<[^>]+>|&nbsp;|"|&#39;|&#xa0;|n|r|t|&ndash;|Start here|text here", "");
  6.  
  7. FILE NOTEClient/Ref:Surname/Date:15 July 2016Matter:Attended by:LCTime engaged:1 hour .Time engaged 1 hour
  8.  
  9. FILE NOTEClient/Ref:Surname/Date:15 July 2016Matter:Attended by:LCTime engaged:1 hour – .Time engaged – 1 hour
  10.  
  11. FILE NOTEClient/Ref:Surname/Date:15 July 2016Matter:Attended by:LCTime engaged:1 hour .Time engaged 1 hour
  12.  
  13. protected void ShowTemplate(byte[] Template)
  14. {
  15. CKEditor1.Text = "";
  16. byte[] excelContents = Template;
  17. File.WriteAllBytes(Server.MapPath("~/Doc/") + "Demo.Docx", excelContents);
  18. string[] splits = Request.Url.AbsoluteUri.Split('/');
  19. string url = string.Empty;
  20. if (splits.Length >= 2)
  21. {
  22. url = splits[0] + "//";
  23. for (int i = 2; i < splits.Length - 1; i++)
  24. {
  25. url += splits[i];
  26. url += "/";
  27. }
  28. }
  29. string ImgPath = url + "Doc\Demo_images";
  30. html = html.Replace("Demo_images", ImgPath);
  31. string STR = html;
  32. string STRFirst = "<title>";
  33. string STRLast = "</title>";
  34. string FinalString;
  35. int Pos1 = STR.IndexOf(STRFirst) + STRFirst.Length;
  36. int Pos2 = STR.IndexOf(STRLast);
  37. FinalString = STR.Substring(Pos1, Pos2 - Pos1);
  38. if (FinalString.Length > 0)
  39. { html = html.Replace(FinalString, ""); }
  40. string str = @"""0""";
  41. string str1 = "<table border=" + str + " ";
  42. html = html.Replace("<table", str1);
  43. html = html.Replace("border-top-color:", ""><hr /><border-top-color:");
  44. CKEditor1.Text = html;
  45. String TCount = Regex.Replace(CKEditor1.Text, @"<[^>]+>|&nbsp;|"|&#39;|&#xa0;|n|r|t|&ndash;|Start here|text here", "");
  46. ViewState["TCount"] = TCount;
  47. }
  48. protected void btnCompleteTranscription_Click(object sender, EventArgs e)
  49. {
  50. string count = Regex.Replace(CKEditor1.Text, @"<[^>]+>|&nbsp;|"|&#39;|&#xa0;|n|r|t|&ndash;|Start here|text here", "");
  51. string Text = "<html><body>" + CKEditor1.Text + "</body></html>";
  52. Text = Text.Replace("<", "<");
  53. Text = Text.Replace(">", ">");
  54. Text = Text.Replace(">style=", "><span style=");
  55. Text = Text.Replace("<span <", "<span></span> <");
  56. Text = Text.Replace("<p <", "<p> <");
  57. Text = Text.Replace("<del", "<s><span");
  58. Text = Text.Replace("</del", "</s></span");
  59. Text = Text.Replace("&nbsp;", " ");
  60. Text = Text.Replace("<s style=", "<s><span style=");
  61. Text = Text.Replace("<p <", "<p style="text-align:justify"><span><");
  62. Text = Text.Replace(">font-size:14pt", " "); ;
  63. CKEditor1.Text = Text;
  64.  
  65. string TCount = ViewState["TCount"].ToString();
  66. int TLength=(Int32)ViewState["TCount"].ToString().Length;
  67. int WCount = (Int32)count.Length - TLength;
  68. string datefolder = DateTime.Today.Month.ToString().Length < 2 ? "0" + DateTime.Today.Month.ToString() : DateTime.Today.Month.ToString();
  69. datefolder += DateTime.Today.Day.ToString().Length < 2 ? "0" + DateTime.Today.Day.ToString() : DateTime.Today.Day.ToString();
  70. datefolder += DateTime.Today.Year.ToString();
  71.  
  72. string ComparePath = Server.MapPath("~/GDocs/" + Session["uid"].ToString().ToUpper() + "/Transcribed/" + datefolder);
  73. if (!System.IO.Directory.Exists(ComparePath))
  74. {
  75. System.IO.Directory.CreateDirectory(ComparePath);
  76. }
  77. using (System.IO.StreamWriter file = new System.IO.StreamWriter(ComparePath + @"" + ViewState["af"].ToString().Replace(".wav", "") + ".Doc"))
  78. {
  79. file.Write(Text);
  80. }
  81. }
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement