public IncidentModel GetIncidentById(IncidentId incidentId)
        {
            IncidentModel incidentModel = new IncidentModel();

            using (ISession session = NHibernateSession.OpenSession())  // Open a session to conect to the database
            {
                var incident = session.Query <Incident>().FirstOrDefault(c => c.IncidentId == incidentId.Value);
                if (incident != null)
                {
                    incidentModel = incident.ToIncidentModel();
                }
            }
            return(incidentModel);
        }
Beispiel #2
0
        //
        /// <summary>
        /// Create a 'to string'.
        /// </summary>
        public override string ToString()
        {
            //
            StringBuilder _return = new StringBuilder("record:[");

            _return.AppendFormat("IncidentId: {0}, ", IncidentId.ToString());
            _return.AppendFormat("ServerId: {0}, ", ServerId.ToString());
            _return.AppendFormat("IPAddress: {0}, ", IPAddress);
            _return.AppendFormat("NIC: {0}, ", NIC);
            _return.AppendFormat("NetworkName: {0}, ", NetworkName);
            _return.AppendFormat("AbuseEmailAddress: {0}, ", AbuseEmailAddress);
            _return.AppendFormat("ISPTicketNumber: {0}, ", ISPTicketNumber);
            _return.AppendFormat("Mailed: {0}, ", Mailed.ToString());
            _return.AppendFormat("Closed: {0}, ", Closed.ToString());
            _return.AppendFormat("Special: {0}, ", Special.ToString());
            _return.AppendFormat("Notes: {0}, ", Notes);
            _return.AppendFormat("CreatedDate: {0}]", CreatedDate.ToString());
            return(_return.ToString());
        }
 protected void Delete_Click(object sender, EventArgs e)
 {
     localCtx.ExecuteStoreCommand("DELETE FROM INCFORM_ALERT WHERE INCIDENT_ID = {0}", IncidentId.ToString());
 }
Beispiel #4
0
        private void BindToolbar()
        {
            secHeader.Title = LocRM.GetString("tbView");

            bool canUpdate       = Incident.CanUpdate(IncidentId);
            bool canAddToDoBox   = Incident.CanAddToDo(IncidentId);
            bool canAddResBox    = Incident.CanModifyResources(IncidentId);
            bool canViewFinances = Incident.CanViewFinances(IncidentId);
            bool canDelete       = Incident.CanDelete(IncidentId);
            bool isExternal      = Security.CurrentUser.IsExternal;

            ComponentArt.Web.UI.MenuItem topMenuItem = new ComponentArt.Web.UI.MenuItem();
            topMenuItem.Text                = /*"<img border='0' src='../Layouts/Images/downbtn.gif' width='9px' height='5px' align='absmiddle'/>&nbsp;" + */ LocRM2.GetString("Actions");
            topMenuItem.Look.LeftIconUrl    = ResolveUrl("~/Layouts/Images/downbtn1.gif");
            topMenuItem.Look.LeftIconHeight = Unit.Pixel(5);
            topMenuItem.Look.LeftIconWidth  = Unit.Pixel(16);
            topMenuItem.LookId              = "TopItemLook";

            ComponentArt.Web.UI.MenuItem subItem;

            CommandManager cm = null;

            if (!Security.CurrentUser.IsExternal)
            {
                cm = CommandManager.GetCurrent(this.Page);
            }
            CommandParameters cp  = new CommandParameters();
            string            cmd = String.Empty;

            #region Create ToDo
            if (canAddToDoBox && !isExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/icons/task_create.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.NavigateUrl         = "~/ToDo/ToDoEdit.aspx?IncidentId=" + IncidentId;
                subItem.Text = LocRM.GetString("tbAdd");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Edit: Incident, GeneralInfo, ResolutionInfo, Status
            if (canUpdate)
            {
                ComponentArt.Web.UI.MenuItem editItem = new ComponentArt.Web.UI.MenuItem();
                editItem.Text = LocRM.GetString("tbViewEdit");
                editItem.Look.RightIconUrl      = "../Layouts/Images/arrow_right.gif";
                editItem.Look.HoverRightIconUrl = "../Layouts/Images/arrow_right_hover.gif";
                editItem.Look.RightIconWidth    = Unit.Pixel(15);
                editItem.Look.RightIconHeight   = Unit.Pixel(10);

                #region Edit Incident
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/icons/incident_edit.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.NavigateUrl         = "../Incidents/IncidentEdit.aspx?IncidentId=" + IncidentId + "&Back=incident";
                subItem.Text = LocRM.GetString("EditIssue");
                editItem.Items.Add(subItem);
                #endregion

                #region Edit General Info
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.ClientSideCommand = "javascript:ShowWizard('EditGeneralInfo.aspx?IncidentId=" + IncidentId + "', 500, 400);";
                subItem.Text = LocRM2.GetString("EditGeneralInfo");
                editItem.Items.Add(subItem);
                #endregion

                #region Edit Categories
                if (PortalConfig.CommonIncidentAllowEditGeneralCategoriesField ||
                    PortalConfig.IncidentAllowEditIncidentCategoriesField)
                {
                    subItem = new ComponentArt.Web.UI.MenuItem();
                    subItem.ClientSideCommand = "javascript:ShowWizard('EditCategories.aspx?IncidentId=" + IncidentId + "', 300, 350);";
                    subItem.Text = LocRM2.GetString("EditCategories");
                    editItem.Items.Add(subItem);
                }
                #endregion

                /*
                 #region Edit State Info
                 * subItem = new ComponentArt.Web.UI.MenuItem();
                 * subItem.ClientSideCommand = "javascript:ShowWizard('EditStateInfo.aspx?ProjectId=" + ProjectId + "', 350, 250);";
                 * subItem.Text = LocRM.GetString("EditStateInfo");
                 * editItem.Items.Add(subItem);
                 #endregion
                 *
                 */
                topMenuItem.Items.Add(editItem);
            }
            #endregion

            #region Modyfy Recipients
            if (!isExternal && Mediachase.IBN.Business.Incident.CanUpdateExternalRecipients(IncidentId))
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/icons/editgroup.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                cp  = new CommandParameters("MC_HDM_RecipEdit");
                cmd = cm.AddCommand("Incident", "", "IncidentView", cp);
                cmd = cmd.Replace("\"", "&quot;");
                subItem.ClientSideCommand = "javascript:" + cmd;
                //subItem.ClientSideCommand = "javascript:ShowWizard('RecipientsEditor.aspx?IncidentId=" + IncidentId + "', 450, 350);";
                subItem.Text = LocRM.GetString("AddRecipients");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Modyfy Resources
            if (canAddResBox && !isExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/icons/editgroup.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                cp  = new CommandParameters("MC_HDM_ResEdit");
                cmd = cm.AddCommand("Incident", "", "IncidentView", cp);
                cmd = cmd.Replace("\"", "&quot;");
                subItem.ClientSideCommand = "javascript:" + cmd;
                //subItem.ClientSideCommand = "javascript:ShowWizard('ResourcesEditor.aspx?IncidentId=" + IncidentId + "', 650, 350);";
                subItem.Text = LocRM.GetString("AddResources");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Delete
            if (canDelete)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/icons/incident_delete.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.ClientSideCommand   = "javascript:DeleteIncident()";
                subItem.Text = LocRM.GetString("Delete");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region MarkAsSpam
            if (canDelete)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/red_denied.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                cp  = new CommandParameters("MC_HDM_MarkAsSpam");
                cmd = cm.AddCommand("Incident", "", "IncidentView", cp);
                cmd = cmd.Replace("\"", "&quot;");
                subItem.ClientSideCommand = "javascript:" + cmd;
                subItem.Text = GetGlobalResourceObject("IbnFramework.Incident", "MarkAsSpam").ToString();
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region --- Seperator ---
            if (topMenuItem.Items.Count > 0)
            {
                subItem        = new ComponentArt.Web.UI.MenuItem();
                subItem.LookId = "BreakItem";
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Copy to Clipboard
            if (!isExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/xp-copy.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.ClientSideCommand   = "javascript:try{_XMLReqForClip('AddClip=Issue&IncidentId=" + IncidentId.ToString() + "', '" + LocRM2.GetString("tXMLError") + "')}catch(e){}";
                subItem.Text = LocRM.GetString("tCopyToClipboard");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Add from Clipboard
            if (canUpdate && !isExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/xp-paste.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                cp  = new CommandParameters("MC_HDM_RelatedIssClip");
                cmd = cm.AddCommand("Incident", "", "IncidentView", cp);
                cmd = cmd.Replace("\"", "&quot;");
                subItem.ClientSideCommand = "javascript:" + cmd;
                subItem.Text = LocRM.GetString("tPasteFromClipboard");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Clear Clipboard
            if (canUpdate && !isExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/clearbuffer.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.ClientSideCommand   = "javascript:try{_XMLReqForClip('ClearClip=Issue', '" + LocRM2.GetString("tXMLError") + "')}catch(e){}";
                subItem.Text = LocRM2.GetString("tClearClipboard");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region --- Seperator ---
            if (topMenuItem.Items.Count > 0)
            {
                subItem        = new ComponentArt.Web.UI.MenuItem();
                subItem.LookId = "BreakItem";
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Add Related Issue
            if (canUpdate && !isExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/icons/relincidents.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);

                cp  = new CommandParameters("MC_HDM_RelatedIss");
                cmd = cm.AddCommand("Incident", "", "IncidentView", cp);
                cmd = cmd.Replace("\"", "&quot;");
                subItem.ClientSideCommand = "javascript:" + cmd;
                //subItem.ClientSideCommand = String.Format("javascript:OpenPopUpNoScrollWindow(\"../Common/SelectIncident.aspx?btn={0}&exclude={1}\", 640, 480);",
                //    Page.ClientScript.GetPostBackEventReference(btnAddRelatedIss, "xxxtypeid;xxxid"), IncidentId.ToString());
                subItem.Text = LocRM.GetString("tAdd");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Timesheet
            // OR [2007-08-23]: We should use IbnNext TimeTracking

            /*
             * if (Configuration.ProjectManagementEnabled)
             * {
             *      subItem = new ComponentArt.Web.UI.MenuItem();
             *      subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/timesheet.gif";
             *      subItem.Look.LeftIconWidth = Unit.Pixel(16);
             *      subItem.Look.LeftIconHeight = Unit.Pixel(16);
             *      string sPath = (Security.CurrentUser.IsExternal) ? "../External/ExternalTimeTracking.aspx" : "../TimeTracking/TimeTrackingWeek.aspx";
             *      subItem.ClientSideCommand = String.Format("javascript:ShowWizard('{0}?IncidentId={1}', {2});",
             *        sPath, IncidentId, (Security.CurrentUser.IsExternal) ? "800,600" : "450, 200");
             *      subItem.Text = LocRM.GetString("tbAddTimeSheet");
             *      topMenuItem.Items.Add(subItem);
             * }
             */
            #endregion

            #region UpdateHistory
            if (!isExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.ClientSideCommand = String.Format("javascript:ShowWizard('../Common/SystemEventsByObject.aspx?ObjectId={0}&ObjectTypeId={1}', 750, 466);", IncidentId, (int)ObjectTypes.Issue);
                subItem.Text = LocRM3.GetString("UpdateHistory");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Latest Visitors
            if (!isExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.ClientSideCommand = String.Format("javascript:ShowWizard('../Common/LatestVisitors.aspx?ObjectId={0}&ObjectTypeId={1}', 450, 266);", IncidentId, (int)ObjectTypes.Issue);
                subItem.Text = LocRM3.GetString("LatestVisitors");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region System Notifications
            if (!isExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/accept_1.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.NavigateUrl         = String.Format("../Directory/SystemNotificationForObject.aspx?ObjectId={0}&ObjectTypeId={1}", IncidentId, ((int)ObjectTypes.Issue).ToString());
                subItem.Text = LocRM2.GetString("SystemNotifications");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region Favorites
            if (!Incident.CheckFavorites(IncidentId) && !isExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/Favorites.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                subItem.ClientSideCommand   = "javascript:" + Page.ClientScript.GetPostBackEventReference(btnAddToFavorites, "");
                subItem.Text = LocRM.GetString("AddToFavorites");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            #region PrintPreviewSettings
            if (!isExternal)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/printPreviewButton.png";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                cp = new CommandParameters("MC_HDM_PrintPreviewSettings");
                cp.CommandArguments = new System.Collections.Generic.Dictionary <string, string>();
                cp.AddCommandArgument("IncidentId", IncidentId.ToString());
                cmd = cm.AddCommand("Incident", "", "IncidentView", cp);
                cmd = cmd.Replace("\"", "&quot;");
                subItem.ClientSideCommand = "javascript:" + cmd;
                subItem.Text = LocRM.GetString("PrintSettings");
                topMenuItem.Items.Add(subItem);

                subItem = new ComponentArt.Web.UI.MenuItem();
                subItem.Look.LeftIconUrl    = "~/Layouts/Images/print.gif";
                subItem.Look.LeftIconWidth  = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
                cp = new CommandParameters("MC_HDM_PrintIssue");
                cp.CommandArguments = new System.Collections.Generic.Dictionary <string, string>();
                cp.AddCommandArgument("IncidentId", IncidentId.ToString());
                cmd = cm.AddCommand("Incident", "", "IncidentView", cp);
                cmd = cmd.Replace("\"", "&quot;");
                subItem.ClientSideCommand = "javascript:" + cmd;
                subItem.Text = LocRM.GetString("PrintIssue");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            if (topMenuItem.Items.Count > 0)
            {
                secHeader.ActionsMenu.Items.Add(topMenuItem);
            }
        }
Beispiel #5
0
 public IncidentModel GetIncidentById(IncidentId incidentId)
 {
     return(_incidentRepository.GetIncidentById(incidentId));
 }
Beispiel #6
0
        protected void lbSend_Click(object sender, System.EventArgs e)
        {
            string sTo = txtTo.Text.Trim();

            // all recipients string
            string allRecipients = String.Empty;

            if (sTo != String.Empty)
            {
                allRecipients = sTo;
            }
            if (allRecipients != String.Empty)
            {
                allRecipients += "; ";
            }
            allRecipients += lblCC.Text;
            CommonHelper.AddToContext(ForumThreadNodeSetting.AllRecipients, allRecipients);

            string regex = "([0-9a-zA-Z]([-.\\w]*[0-9a-zA-Z])*@(([0-9a-zA-Z])+([-\\w]*[0-9a-zA-Z])*\\.)+[a-zA-Z]" +
                           "{2,9})";
            List <string> dic = new List <string>();

            System.Text.RegularExpressions.RegexOptions options = ((System.Text.RegularExpressions.RegexOptions.IgnorePatternWhitespace | System.Text.RegularExpressions.RegexOptions.Multiline)
                                                                   | System.Text.RegularExpressions.RegexOptions.IgnoreCase);
            System.Text.RegularExpressions.Regex reg = new System.Text.RegularExpressions.Regex(regex, options);


            foreach (Match item in reg.Matches(sTo))
            {
                if (!dic.Contains(item.Value))
                {
                    dic.Add(item.Value);
                }
            }
            string[] masTo = dic.ToArray();

            if (masTo.Length == 0 && lblCC.Text == String.Empty)
            {
                lblException.Text  = LocRM.GetString("NoRecipients");
                divMessage.Visible = true;
                Page.ClientScript.RegisterStartupScript(this.GetType(), "_getFiles",
                                                        "window.setTimeout('updateAttachments()', 500);", true);
                return;
            }


            string _containerName = "FileLibrary";
            string _containerKey  = "EMailAttach";

            CS.BaseIbnContainer bic = CS.BaseIbnContainer.Create(_containerName, _containerKey);
            CS.FileStorage      fs  = (CS.FileStorage)bic.LoadControl("FileStorage");
            CS.DirectoryInfo    di  = fs.GetDirectory(fs.Root.Id, _guid, true);

            try
            {
                if (IncidentId > 0)
                {
                    NameValueCollection _params = new NameValueCollection();
                    _params["IssueId"] = IncidentId.ToString();
                    EMailClient.SendMessage(masTo, txtSubject.Text, fckEditor.Text, di, EMailClient.IssueMode, _params);
                    string sUrl = "../Incidents/IncidentView.aspx?IncidentId=" + IncidentId;
                    if (Request["back"] != null)
                    {
                        sUrl = HttpUtility.UrlDecode(Request["back"]);
                    }
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "_close", "try{window.opener.location.href='" + sUrl + "';}catch(ex){}window.close();", true);
                }
                else
                {
                    EMailClient.SendMessage(masTo, txtSubject.Text, fckEditor.Text, di);
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "_close", "window.close();", true);
                }
            }
            catch (Exception ex)
            {
                string sException = "";
                switch (ex.GetType().ToString())
                {
                case "System.Net.Sockets.SocketException":
                    sException = ex.Message;
                    break;

                case "Mediachase.IBN.Business.EMail.SmtpClientException":
                    sException = LocRM2.GetString("tServerSMTPError") + ":&nbsp;<span style='color:#444;font-style:italic;'>" + ex.Message + "</span>";
                    break;

                default:
                    // TODO: Save Exception to IBN Log And Show Friendly Link to Log
                    sException = ex.Message;
                    CHelper.GenerateErrorReport(ex);
                    break;
                }
                lblException.Text = LocRM2.GetString("SMTPSettingsIncorrect") + "&nbsp;" +
                                    LocRM2.GetString("tWereErrorsSMTP") + "<br/>" + sException;
                if (Security.IsUserInGroup(InternalSecureGroups.Administrator))
                {
                    lblSMTP.Text = "<a href='javascript:ToSMTPSettings();'><font style='color:Red;'><b><u>" + LocRM2.GetString("tSetupSMTPServer") + "</u></b></font></a>";
                }
                else
                {
                    lblSMTP.Text = LocRM2.GetString("tContactSMTPError");
                }
                divMessage.Visible = true;
                Page.ClientScript.RegisterStartupScript(this.GetType(), "_getFiles",
                                                        "window.setTimeout('updateAttachments()', 500);", true);
            }
        }
Beispiel #7
0
        private void BindDefaultValues()
        {
            string fromEmail = Security.CurrentUser.Email;

            if (IncidentId > 0)
            {
                fromEmail = EMailRouterOutputMessage.FindEMailRouterPublicEmail(IncidentId);
            }
            txtFrom.Text = String.Format(CultureInfo.InvariantCulture,
                                         "{1}&nbsp;&lt;{0}&gt;", fromEmail, Security.CurrentUser.DisplayName);
            lblCCTitle.Text = "";
            lblToTitle.Text = LocRM.GetString("tTo") + ":";
            if (IncidentId > 0)
            {
                NameValueCollection _params = new NameValueCollection();
                _params["IssueId"] = IncidentId.ToString();
                string[] erList = EMailClient.GetDefaultRecipientList(EMailClient.IssueMode, _params);
                for (int i = 0; i < erList.Length; i++)
                {
                    string sName = GetNameByEMail(erList[i]);
                    if (sName != "")
                    {
                        lblCC.Text += String.Format(CultureInfo.InvariantCulture, "{0} &lt;{1}&gt;; ", sName, erList[i]);
                    }
                    else
                    {
                        lblCC.Text += erList[i] + "; ";
                    }
                }

                string sValue = EMailMessage.GetOutgoingEmailFormatBodyPreview(IncidentId).Replace("[=Text=]", "");
                if (NodeId > 0)
                {
                    EMailMessageInfo mi = EMailMessageInfo.Load(NodeId);
                    sValue += "<br/>" + "<blockquote style='border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; padding-left: 5px; margin-left: 5px; margin-right: 0px;' dir='ltr'>" + mi.HtmlBody + "</blockquote>";
                }
                fckEditor.Text = sValue;

                using (IDataReader reader = Incident.GetIncident(IncidentId))
                {
                    if (reader.Read())
                    {
                        txtSubject.Text = string.Format(CultureInfo.InvariantCulture
                                                        , "RE: [{0}] {1}"
                                                        , (reader["Identifier"] != DBNull.Value) ?
                                                        reader["Identifier"].ToString()
                                                                : TicketUidUtil.Create(IncidentBox.Load((int)reader["IncidentBoxId"]).IdentifierMask, IncidentId)
                                                        , HttpUtility.HtmlDecode(reader["Title"].ToString())
                                                        );
                    }
                }
            }
            if (FileIds != "")
            {
                string sFiles = FileIds.Trim();
                if (sFiles.EndsWith(","))
                {
                    sFiles = sFiles.Substring(0, sFiles.Length - 1);
                }
                string[] masFiles = sFiles.Split(',');
                if (masFiles.Length > 0)
                {
                    string _containerName   = "FileLibrary";
                    string _containerKey    = "EMailAttach";
                    CS.BaseIbnContainer bic = CS.BaseIbnContainer.Create(_containerName, _containerKey);
                    CS.FileStorage      fs  = (CS.FileStorage)bic.LoadControl("FileStorage");

                    CS.BaseIbnContainer bic2 = CS.BaseIbnContainer.Create(FilesContainerName, FilesContainerKey);
                    CS.FileStorage      fs2  = (CS.FileStorage)bic.LoadControl("FileStorage");

                    CS.DirectoryInfo di = fs.GetDirectory(fs.Root.Id, _guid, true);
                    for (int i = 0; i < masFiles.Length; i++)
                    {
                        fs2.CopyFile(int.Parse(masFiles[i]), di.Id);
                    }
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "_getFiles",
                                                            "window.setTimeout('updateAttachments()', 500);", true);
                }
            }
            if (ErrorId != "")
            {
                string support_email = GlobalResourceManager.Strings["SupportEmail"];
                //if (Security.CurrentUser != null && Security.CurrentUser.Culture.ToLower().IndexOf("ru") >= 0)
                //    support_email = "*****@*****.**";
                txtTo.Text = support_email + "; ";

                txtSubject.Text = String.Format("{0} {1} {2} Error Report", IbnConst.CompanyName, IbnConst.ProductFamilyShort, IbnConst.VersionMajorDotMinor);

                string prefix   = Request.Url.Host.Replace(".", "_");
                string FilePath = Server.MapPath("../Admin/Log/Error/" + prefix + "_" + ErrorId + ".html");
                string sTemp    = String.Empty;
                using (StreamReader sr = File.OpenText(FilePath))
                {
                    sTemp += sr.ReadToEnd();
                }

                Match match = Regex.Match(sTemp, @"<body[^>]*>(?<HtmlBody>[\s\S]*?)</body>", RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.Multiline);
                if (match.Success)
                {
                    string body       = match.Groups["HtmlBody"].Value;
                    Match  matchStyle = Regex.Match(sTemp, @"<style[^>]*>(?<HtmlStyle>[\s\S]*?)</style>", RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.Multiline);
                    if (matchStyle.Success)
                    {
                        body += matchStyle.Value;
                    }
                    sTemp = body;
                }
                fckEditor.Text = sTemp;
            }
            if (lblCC.Text != "")
            {
                lblCCTitle.Text = LocRM.GetString("tTo") + ":";
                lblToTitle.Text = LocRM.GetString("tCc") + ":";
            }
        }