示例#1
0
        private void editorRender(ref ASPxPanel editorPanel)
        {
            ASPxUploadControl upPanel = (ASPxUploadControl)(editorPanel.FindControl("upPanel"));
            ASPxLabel         label   = (ASPxLabel)(editorPanel.FindControl("upLabelPanel"));

            if (upPanel != null)
            {
                upPanel.NullText = fileuploads == null ? "Click để chọn file từ PC.." : string.Format("{0}", fileuploads.FileName);
            }

            if (label != null && CurrentObject != null && isUploadComplete)
            {
                label.Text      = string.Format("File '{0}' đã upload thành công!", ((FileUploads)CurrentObject).FileName);
                label.ForeColor = System.Drawing.Color.FromArgb(0x33, 0x66, 0x00);
                label.Visible   = true;
                this.Refresh();
            }
        }
示例#2
0
        private void editorRender(ref ASPxPanel editorPanel)
        {
            ASPxTrackBar trackbarPanel = (ASPxTrackBar)(editorPanel.FindControl("trackbarPanel"));

            if (trackbarPanel != null)
            {
                trackbarPanel.Value = tbValue;
            }
        }
示例#3
0
        private void editorRender(ref ASPxPanel editorPanel)
        {
            ASPxHtmlEditor htmlPanel = (ASPxHtmlEditor)(editorPanel.FindControl("htmlPanel"));

            if (htmlPanel != null)
            {
                htmlPanel.Html = txtHTML;
            }
        }
示例#4
0
        protected void ASPxDataView2_DataBound(object sender, EventArgs e)
        {
            //    Mukund 10Jun2014
            //VSPLUS-673: Executive Summary should have the same right-click menu as other screens
            try
            {
                ASPxDataView dataview = new ASPxDataView();
                dataview = (ASPxDataView)sender;
                if (dataview.Items.Count > 0)
                {
                    for (int j = 0; j < dataview.Items.Count; j++)
                    {
                        ASPxPanel panel = new ASPxPanel();
                        panel           = (ASPxPanel)dataview.FindItemControl("ASPxPanel1", dataview.Items[j]);
                        panel.BackColor = GetColor(dataview.Items[j].DataItem);

                        string strURL     = HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Authority;
                        string strURLFile = "";

                        string lblLoc = (dataview.Items[j].DataItem as DataRowView)["Location"].ToString();
                        //10/5/2015 NS modified for VSPLUS-2247
                        //string lblIP = (dataview.Items[j].DataItem as DataRowView)["IPAddress"].ToString();
                        string lbltext = (dataview.Items[j].DataItem as DataRowView)["Name"].ToString();
                        string lbltype = (dataview.Items[j].DataItem as DataRowView)["Type"].ToString();
                        //10/9/2014 NS added
                        string lblstatus = (dataview.Items[j].DataItem as DataRowView)["Status"].ToString();
                        string Cat       = (dataview.Items[j].DataItem as DataRowView)["Category"].ToString();

                        string lbltext1 = "";
                        //1/30/2015 NS added for VSPLUS-1367
                        string lblDate = (dataview.Items[j].DataItem as DataRowView)["LastUpdate"].ToString();
                        lbltext1 = lbltext;
                        HtmlGenericControl divControl = (HtmlGenericControl)panel.FindControl("divmenu");                        // e.Item.FindControl("divControl") as HtmlGenericControl;
                        string             imgtext    = "";
                        imgtext = "<img src='" + (dataview.Items[j].DataItem as DataRowView)["imgsource"].ToString() + "'/>";
                        string lbl2 = "";
                        //lbl2 = "<font color='" + GetTextColor(dataview.Items[j].DataItem).ToString() + "' face='Tahoma' size='1'>" + (dataview.Items[j].DataItem as DataRowView)["Status"].ToString() + "</font>";
                        lbl2 = "<span class='" + GetTextCSS(dataview.Items[j].DataItem) + "'>" + (dataview.Items[j].DataItem as DataRowView)["Status"].ToString() + "</span>";
                        if (lbltext.Length > 16)
                        {
                            lbltext1 = lbltext.Substring(0, 14) + "...";
                        }
                        if (!(Session["UserFullName"] != null && Session["UserFullName"].ToString() == "Anonymous"))
                        {
                            string stredit    = "";
                            string strsuspend = "";
                            if (Session["Isconfigurator"] != null)
                            {
                                if (Session["Isconfigurator"].ToString() == "True")
                                {
                                    stredit    = "                    ,'edit" + j + "': { name: 'Edit in Configurator', icon: 'cut' }";
                                    strsuspend = "                    ,'suspend" + j + "': { name: 'Suspend Temporarily', icon: 'copy' }";
                                }
                            }

                            string id = (VSWebBL.SecurityBL.ServersBL.Ins.GetServerIDbyServerNameType(lbltext, lbltype)).ToString();
                            if (lbltype == "Exchange")
                            {
                                //10/5/2015 NS modified for VSPLUS-2247
                                strURLFile = "/Configurator/ExchangeServer.aspx?ID=" + id + "&name=" + lbltext + "&Cat=Exchange&Loc=" + lblLoc; // + "&ipaddr=" + lblIP;
                            }
                            else if (lbltype == "Mail")
                            {
                                id         = (VSWebBL.ConfiguratorBL.MailServicesBL.Ins.GetServerIDbyServerName(lbltext)).ToString();
                                strURLFile = "/Configurator/MailService.aspx?Key=" + id;
                            }
                            else if (lbltype == "Skype for Business")
                            {
                                strURLFile = "/Configurator/LyncServer.aspx?ID=" + id + "&Name=" + lbltext + "&Cat=" + Cat + "&Loc=" + lblLoc;
                            }
                            else if (lbltype == "SharePoint")
                            {
                                strURLFile = "/Configurator/SharepointServer.aspx?ID=" + id + "&Name=" + lbltext + "&Cat=" + Cat + "&Loc=" + lblLoc;
                            }
                            else if (lbltype.ToString() == "BES")
                            {
                                id = (VSWebBL.SecurityBL.ServersBL.Ins.GetServerIDbyServerName(lbltext)).ToString();

                                strURLFile = "/Configurator/BlackBerryEntertpriseServer.aspx?Key=" + id;
                            }
                            else if (lbltype == "Sametime")
                            {
                                id         = (VSWebBL.SecurityBL.ServersBL.Ins.GetServerIDbyServerName(lbltext)).ToString();
                                strURLFile = "/Configurator/SametimeServer.aspx?ID=" + id;
                            }


                            else if (lbltype == "Network Device")
                            {
                                id         = (VSWebBL.ConfiguratorBL.NetworkDevicesBL.Ins.GetServerIDbyServerName(lbltext)).ToString();
                                strURLFile = "/Configurator/NetworkDeviceProperties.aspx?ID=" + id;
                            }
                            else if (lbltype == "URL")
                            {
                                id         = (VSWebBL.ConfiguratorBL.URLsBL.Ins.GetServerIDbyServerName(lbltext)).ToString();
                                strURLFile = "/Configurator/URLProperties.aspx?ID=" + id;
                            }
                            else if (lbltype == "Notes Database")
                            {
                                NotesDatabases nodj = new NotesDatabases();
                                nodj.Name = lbltext;
                                DataTable dt = VSWebBL.ConfiguratorBL.NotesDatabaseBL.Ins.GetName(nodj);
                                if (dt.Rows.Count > 0)
                                {
                                    id = dt.Rows[0]["ID"].ToString();
                                }
                                strURLFile = "/Configurator/EditNotes.aspx?ID=" + id;
                            }
                            else if (lbltype == "NotesMail Probe")
                            {
                                strURLFile = "/Configurator/EditNotesMailProbe.aspx?Name=" + lbltext;
                            }
                            else if (lbltype == "ExchangeMail Probe")
                            {
                                strURLFile = "/Configurator/EditExchangeMailProbe.aspx?Name=" + lbltext;
                            }
                            else if (lbltype == "Windows")
                            {
                                id = (VSWebBL.SecurityBL.ServersBL.Ins.GetServerIDbyServerName(lbltext)).ToString();

                                strURLFile = "/Configurator/WindowsProperties.aspx?ID=" + id + "&Name=" + lbltext + "&Cat=" + Cat + "&Loc=" + lblLoc;
                            }
                            else if (lbltype == "Active Directory")
                            {
                                id = (VSWebBL.SecurityBL.ServersBL.Ins.GetServerIDbyServerName(lbltext)).ToString();
                                //10/5/2015 NS modified for VSPLUS-2247
                                strURLFile = "/Configurator/ActiveDirectoryProperties.aspx?ID=" + id + "&name=" + lbltext + "&Cat=" + Cat + "&Loc=" + lblLoc; // +"&ipaddr=" + lblIP;
                            }
                            //5/9/2016 Sowjanya modified for VSPLUS-2943
                            else if (lbltype == "IBM Connections")
                            {
                                id = (VSWebBL.SecurityBL.ServersBL.Ins.GetServerIDbyServerName(lbltext)).ToString();

                                strURLFile = "/Configurator/IBMConnections.aspx?ID=" + id + "&name=" + lbltext + "&Cat=" + Cat + "&Loc=" + lblLoc; // +"&ipaddr=" + lblIP;
                            }
                            else if (lbltype == "Office365")
                            {
                                strURLFile = "/Configurator/O365ServerProperties.aspx";
                            }
                            else
                            {
                                strURLFile = "/Configurator/DominoProperties.aspx?Key=" + id;
                            }


                            //lbltext1 = "<strong><font color='Black' face='Tahoma' size='2'><a class='dlink' href='DominoServerDetailsPage2.aspx?Name=" + lbltext + "&Type=Domino'>" + lbltext1 + "</a></font></strong>";
                            //1/30/2015 NS modified for VSPLUS-1367
                            //lbltext1 = "<a class='ahrefdom' href='DominoServerDetailsPage2.aspx?Name=" + lbltext + "&Type=Domino&Status=" + lblstatus + "'>" + lbltext1 + "</a>";
                            //10/5/2015 NS modified for VSPLUS-2247
                            if (lbltype == "Domino")
                            {
                                lbltext1 = "<a class='ahrefdom' title='" + lbltext + "' href='DominoServerDetailsPage2.aspx?Name=" + lbltext + "&Type=" + lbltype + "&Status=" + lblstatus + "'>" + lbltext1 + "</a>";
                            }
                            else if (lbltype == "Exchange")
                            {
                                lbltext1 = "<a class='ahrefdom' title='" + lbltext + "' href='ExchangeServerDetailsPage3.aspx?Name=" + lbltext + "&Type=" + lbltype + "&Status=" + lblstatus + "&LastDate=" + lblDate + "'>" + lbltext1 + "</a>";
                            }
                            else if (lbltype == "Database Availability Group")
                            {
                                lbltext1 = "<a class='ahrefdom' title='" + lbltext + "' href='DAGHealth.aspx?Name=" + lbltext + "'>" + lbltext1 + "</a>";
                            }
                            else if (lbltype == "SharePoint")
                            {
                                lbltext1 = "<a class='ahrefdom' title='" + lbltext + "' href='Sharepointdetailspage.aspx?Name=" + lbltext + "&Type=" + lbltype + "&Status=" + lblstatus + "&LastDate=" + lblDate + "'>" + lbltext1 + "</a>";
                            }
                            else if (lbltype == "Active Directory")
                            {
                                lbltext1 = "<a class='ahrefdom' title='" + lbltext + "' href='ActiveDirectoryServerDetailsPage3.aspx?Name=" + lbltext + "&Type=" + lbltype + "&Status=" + lblstatus + "&LastDate=" + lblDate + "'>" + lbltext1 + "</a>";
                            }
                            else if (lbltype == "URL")
                            {
                                lbltext1 = "<a class='ahrefdom' title='" + lbltext + "' href='URLDetails.aspx?Name=" + lbltext + "&Type=" + lbltype + "&Status=" + lblstatus + "'>" + lbltext1 + "</a>";
                            }
                            else if (lbltype == "Sametime")
                            {
                                lbltext1 = "<a class='ahrefdom' title='" + lbltext + "' href='SametimeServerDetailsPage.aspx?Name=" + lbltext + "&Type=" + lbltype + "&Status=" + lblstatus + "&LastDate=" + lblDate + "'>" + lbltext1 + "</a>";
                            }
                            else if (lbltype == "Notes Database")
                            {
                                lbltext1 = "<a class='ahrefdom' title='" + lbltext + "' href='DominoServerDetailsPage2.aspx?Name=" + lbltext + "&Type=" + lbltype + "&Status=" + lblstatus + "&LastDate=" + lblDate + "'>" + lbltext1 + "</a>";
                            }
                            else if (lbltype == "Office365")
                            {
                                lbltext1 = "<a class='ahrefdom' title='" + lbltext + "' href='office365health.aspx?Name=" + lbltext + "&Type=" + lbltype + "&LastDate=" + lblDate + "'>" + lbltext1 + "</a>";
                            }
                            else if (lbltype == "NotesMail Probe")
                            {
                                lbltext1 = "<a class='ahrefdom' title='" + lbltext + "' href='NotesMailProbeDetailsPage.aspx?Name=" + lbltext + "&Type=" + lbltype + "&Status=" + lblstatus + "&LastDate=" + lblDate + "'>" + lbltext1 + "</a>";
                            }
                            else if (lbltype == "Skype for Business")
                            {
                                lbltext1 = "<a class='ahrefdom' title='" + lbltext + "' href='Lyncdetailspage.aspx?Name=" + lbltext + "&Type=" + lbltype + "&LastDate=" + lblDate + "'>" + lbltext1 + "</a>";
                            }
                            else if (lbltype == "BES")
                            {
                                lbltext1 = "<a class='ahrefdom' title='" + lbltext + "' href='BlackBerryServerDetailsPage2.aspx?Name=" + lbltext + "&Type=" + lbltype + "&LastDate=" + lblDate + "'>" + lbltext1 + "</a>";
                            }
                            else if (lbltype == "ExchangeMail Probe")
                            {
                                lbltext1 = "<a class='ahrefdom' title='" + lbltext + "' href='ExchangeMailProbeDetailsPage.aspx?Name=" + lbltext + "&Type=" + lbltype + "&LastDate=" + lblDate + "'>" + lbltext1 + "</a>";
                            }
                            else if (lbltype == "Windows")
                            {
                                lbltext1 = "<a class='ahrefdom' title='" + lbltext + "' href='WindowsServerDetails.aspx?Name=" + lbltext + "&Type=" + lbltype + "&LastDate=" + lblDate + "'>" + lbltext1 + "</a>";
                            }
                            else if (lbltype == "Network Device")
                            {
                                lbltext1 = "<a class='ahrefdom' title='" + lbltext + "' href='NetworkServerDetails.aspx?Name=" + lbltext + "&Type=" + lbltype + "&LastDate=" + lblDate + "'>" + lbltext1 + "</a>";
                            }
                            else if (lbltype == "SNMP Device")
                            {
                                lbltext1 = "<a class='ahrefdom' title='" + lbltext + "' href='SNMPDeviceDetails.aspx?Name=" + lbltext + "&Type=" + lbltype + "&LastDate=" + lblDate + "'>" + lbltext1 + "</a>";
                            }
                            //5/12/2016 Sowjanya modified for VSPLUS-2943
                            else if (lbltype == "IBM Connections")
                            {
                                lbltext1 = "<a class='ahrefdom' title='" + lbltext + "' href='ConnectionsDetailsPage.aspx?Name=" + lbltext + "&Type=" + lbltype + "&Status=" + lblstatus + "&LastDate=" + lblDate + "'>" + lbltext1 + "</a>";
                            }
                            else
                            {
                                lbltext1 = "<a class='ahrefdom' title='" + lbltext + "' href='DominoServerDetailsPage2.aspx?Name=" + lbltext + "&Type=" + lbltype + "&Status=" + lblstatus + "&LastDate=" + lblDate + "'>" + lbltext1 + "</a>";
                            }
                            divControl.InnerHtml =
                                "     <div class='context-menu-one" + j + "'><table id='tbl' class='boxshadow' runat='server'>" +
                                "   <tr>" +
                                "     <td>" + imgtext +
                                "      </td>" +
                                "<td>" +
                                "            <div style='overflow: visible'>" + lbltext1 +
                                "            </div>" +
                                "        </td>" +
                                "    </tr>" +
                                "    <tr>" +
                                "        <td>" +
                                "            &nbsp;</td>" +
                                "        <td>" + lbl2 +
                                "        </td>" +
                                "    </tr>" +
                                "</table> </div>" +
                                "<script type='text/javascript'>" +
                                "        $(function () {" +
                                "            $.contextMenu({" +
                                "                selector: '.context-menu-one" + j + "'," +
                                "                callback: function (key, options) {" +
                                "                    var m =  key; " +
                                "                    var scan_n = 'scan" + j + "'; " +
                                "                    var edit_n = 'edit" + j + "'; " +
                                "                    var suspend_n = 'suspend" + j + "'; " +
                                " if(m==edit_n){window.location.replace('" + strURL + strURLFile + "');}" +
                                " if(m==scan_n){ScanNow('" + lbltext + "','" + lbltype + "');}" +
                                " if(m==suspend_n){SuspendNow('" + lbltext + "');}" +
                                "                }," +
                                "                items: {" +
                                "                    'scan" + j + "': { name: 'Scan Now', icon: 'edit' }" +
                                stredit +
                                strsuspend +
                                "                }" +
                                "            });" +
                                "" +
                                "            $('.context-menu-one" + j + "').on('click', function (e) {" +
                                "                console.log('clicked', this); " +
                                "            })" +
                                "        });" +
                                " " +
                                "    </script>";
                        }
                        else
                        {
                            lbltext1             = "<strong><font color='Black' face='Tahoma' size='2'>" + lbltext1 + "</font></strong>";
                            divControl.InnerHtml =
                                "    <table id='tbl' class='boxshadow' runat='server'>" +
                                "   <tr>" +
                                "     <td>" + imgtext +
                                "      </td>" +
                                "<td>" +
                                "            <div style='overflow: visible'>" + lbltext1 +
                                "            </div>" +
                                "        </td>" +
                                "    </tr>" +
                                "    <tr>" +
                                "        <td>" +
                                "            &nbsp;</td>" +
                                "        <td>" + lbl2 +
                                "        </td>" +
                                "    </tr>" +
                                "</table>";
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#5
0
        protected void btnSaveQuestions_Click(object sender, EventArgs e)
        {
            Int64 ticketID = validateTicket();

            if (ticketID > -1)
            {
                tblQuestions = getQuestions();
                List <SqlParameter> sp;
                string query = "INSERT INTO tblAnswers values(@Aswer, @OptionValue, @UserAnswer, @DateAnswer, @QuestionsID, @TicketID)";
                foreach (DataRow dr in tblQuestions.Rows)
                {
                    int    id          = Convert.ToInt32(dr["ID"]);
                    string typeInput   = dr["TypeInput"].ToString();
                    string value       = string.Empty;
                    int    optionValue = 0;


                    ASPxPanel pnlQuestion = (ASPxPanel)phContent.FindControl("pnl" + id);

                    if (typeInput == "TEXT")
                    {
                        ASPxMemo memo = (ASPxMemo)pnlQuestion.FindControl("memo" + id);
                        if (memo != null)
                        {
                            value = memo.Text;
                        }
                    }

                    if (typeInput == "RADIOBUTTON")
                    {
                        ASPxRadioButtonList radio = (ASPxRadioButtonList)pnlQuestion.FindControl("radio" + id);
                        if (radio != null)
                        {
                            optionValue = Convert.ToInt32(radio.SelectedItem.Value);
                        }
                    }
                    sp = new List <SqlParameter>()
                    {
                        new SqlParameter()
                        {
                            ParameterName = "@Aswer", SqlDbType = SqlDbType.NVarChar, Value = value
                        },
                        new SqlParameter()
                        {
                            ParameterName = "@OptionValue", SqlDbType = SqlDbType.NVarChar, Value = optionValue
                        },
                        new SqlParameter()
                        {
                            ParameterName = "@UserAnswer", SqlDbType = SqlDbType.NVarChar, Value = User.Identity.Name
                        },
                        new SqlParameter()
                        {
                            ParameterName = "@DateAnswer", SqlDbType = SqlDbType.NVarChar, Value = DateTime.Now
                        },
                        new SqlParameter()
                        {
                            ParameterName = "@QuestionsID", SqlDbType = SqlDbType.NVarChar, Value = id
                        },
                        new SqlParameter()
                        {
                            ParameterName = "@TicketID", SqlDbType = SqlDbType.BigInt, Value = ticketID
                        }
                    };

                    DataBase.UpdateDB(sp, query);
                }

                query = "UPDATE tblTicket set QuestionUI = null WHERE ID = @ID";
                sp    = new List <SqlParameter>()
                {
                    new SqlParameter()
                    {
                        ParameterName = "@ID", SqlDbType = SqlDbType.BigInt, Value = ticketID
                    }
                };
                DataBase.UpdateDB(sp, query);

                lblMsg.Text = "Answers Saved Successfully";
            }
            else
            {
                lblMsg.Text = "Survey does not exist or has already been registered";
            }

            popMsg.ShowOnPageLoad = true;
        }