Exemple #1
0
        protected void grdShopping_DeleteCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
        {
            Reports rpt = new Reports();
            int     sum = 0;

            downloadreq.DeleteDownloadReq(Convert.ToInt32(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["RequestID"]));
            List <ReportDownloadReqDTO> lstdnl = new List <ReportDownloadReqDTO>();

            lstdnl = rpt.Get_SelectedAsset_NotPay(Session[sessionNames.userID_StudentOstad].ToString());
            grdShopping.DataSource = lstdnl;
            grdShopping.DataBind();
            RadListView lst = (RadListView)ContentPlaceHolder1.FindControl("lstSelectedClass");

            if (lst != null)
            {
                lst.DataSource = lstdnl;
                lst.DataBind();
            }
            //Pages.ConfirmCheckList chk = new Pages.ConfirmCheckList();
            //RadListView lst = (RadListView)chk.FindControl("lstClass");
            //lst.DataSource = lstdnl;
            //lst.DataBind();
            foreach (GridDataItem item in grdShopping.MasterTableView.Items)
            {
                if (grdShopping.MasterTableView.Items.Count > 0)
                {
                    Paybtn.Visible = true;
                }
                if (grdShopping.Columns[3].UniqueName == "SumPrice")
                {
                    sum += int.Parse(item["SumPrice"].Text.Replace(",", ""));
                }
            }
            Session["Fee"] = sum.ToString();
        }
Exemple #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if (ContentPlaceHolder1.FindControl("HiddenTitle") != null)
            {
                LiteralTitle.Text = ((HiddenField)ContentPlaceHolder1.FindControl("HiddenTitle")).Value;
            }
            else
            {
                LiteralTitle.Text = "";
            }



            //登入 登出切換
            if (Request.Cookies["name"] != null)
            {
                HyperLinkLogin.Text        = "<span class='glyphicon glyphicon-user'></span> " + Request.Cookies["name"].Value + " 登出";
                HyperLinkLogin.NavigateUrl = "~/Logout.aspx";
            }
            else
            {
                HyperLinkLogin.Text        = "登入";
                HyperLinkLogin.NavigateUrl = "~/Login.aspx";
            }
        }
    }
Exemple #3
0
    protected void btn_mst_Click(object sender, EventArgs e)
    {
        string s  = ((TextBox)ContentPlaceHolder1.FindControl("TextBox1")).Text;
        string s2 = ((TextBox)ContentPlaceHolder1.FindControl("TextBox2")).Text;

        txt_result.Text = s + s2;
    }
Exemple #4
0
 protected void Page_PreRender(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(SessionManager.AlertMessage))
     {
         string jscript1122 = "alert('" + SessionManager.AlertMessage + "');";
         ScriptManager.RegisterStartupScript(ContentPlaceHolder1, ContentPlaceHolder1.GetType(), "jscript1122", jscript1122, true);
         SessionManager.AlertMessage = null;
     }
 }
Exemple #5
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        Label mylbl = ContentPlaceHolder1.FindControl("lblP2") as Label;

        if (mylbl != null)
        {
            mylbl.Text += " from master!";
        }
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (null != ContentPlaceHolder1.FindControl("hfBackgroundImage"))
     {
         var hfBackgroundImage = ContentPlaceHolder1.FindControl("hfBackgroundImage") as HiddenField;
         htmlBody.Style.Add(HtmlTextWriterStyle.BackgroundImage, mkoIt.Asp.AspWebSitePath.MapUrl(Page, "~/Bilder/" + hfBackgroundImage.Value));
         htmlBody.Style.Add("background-repeat", "repeat");
     }
 }
Exemple #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //将子页面的信息传递到页首用户控件中,我们可以在母版页中访问子页面的控件和属性,同样也可以在内容页面中访问母版页上的控件和属性
        Label tempLblMsg = ContentPlaceHolder1.FindControl("lblName") as Label;   //页面的标题
        Label tempLblIcn = ContentPlaceHolder1.FindControl("lblImgUrl") as Label; //页面的图标

        //传值
        bbsHeader1.Message      = tempLblMsg.Text;
        bbsHeader1.IconImageUrI = tempLblIcn.Text;
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        //PlaceHolderStaff.Visible = true;
        //ltlName.Text = SessionManager.LoggedInUserDetail.Name;

        if (!string.IsNullOrEmpty(SessionManager.AlertMessage))
        {
            string jscript1122 = "alert('" + SessionManager.AlertMessage + "');";
            ScriptManager.RegisterStartupScript(ContentPlaceHolder1, ContentPlaceHolder1.GetType(), "jscript1122", jscript1122, true);
            SessionManager.AlertMessage = null;
        }
    }
 private void ShowPaineis(string[] paineis, bool visivel)
 {
     foreach (string nome in paineis)
     {
         Control painel;
         if (nome.IndexOf("MASTER->") > -1)
         {
             painel = FindControl(nome.Substring(8));
         }
         else
         {
             painel = ContentPlaceHolder1.FindControl(nome);
         }
         painel.Visible = visivel;
     }
 }
Exemple #10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (ContentPlaceHolder1.FindControl("PageTitle") != null)
        {
            Literal1.Text = ((HiddenField)ContentPlaceHolder1.FindControl("PageTitle")).Value;
        }

        if (Request.Cookies["name"] != null)
        {
            lkLogin.Text        = Request.Cookies["name"].Value + "登出";
            lkLogin.NavigateUrl = "~/Logout.aspx";
        }
        else
        {
            lkLogin.Text        = "登入";
            lkLogin.NavigateUrl = "~/Login.aspx";
        }
    }
Exemple #11
0
        protected void ImageButtonListar_Click(object sender, ImageClickEventArgs e)
        {
            RadioButtonList rbl = (RadioButtonList)ContentPlaceHolder1.FindControl("RadioButtonListTipos");

            if (rbl.Items[0].Selected || rbl.Items[1].Selected || rbl.Items[2].Selected)
            {
                if (rbl.Items[0].Selected)
                {
                    Server.Transfer("listar.aspx");
                }
                else if (rbl.Items[1].Selected)
                {
                    Server.Transfer("listarprocessosdespesa.aspx");
                }
                else
                {
                    Server.Transfer("listarprotocolos.aspx");
                }
            }
            else
            {
                Response.Write("<script>alert('Informe o módulo que deseja listar')</script>");
            }
        }
        protected void btnitemsearch_Click(object sender, EventArgs e)
        {
            String        query = "select * from tblItems where Name LIKE '%" + txtsearch.Text + "%'";
            SqlConnection conn  = new SqlConnection(ConfigurationManager.ConnectionStrings["kartconnection"].ConnectionString);

            conn.Open();
            SqlCommand     com = new SqlCommand(query, conn);
            DataTable      dt  = new DataTable();
            SqlDataAdapter da  = new SqlDataAdapter(com);
            DataSet        ds  = new DataSet();

            da.Fill(ds);

            dlsearchitems.DataSource = ds.Tables[0];
            dlsearchitems.DataBind();
            conn.Close();
            DataList dl = new DataList();

            dl = (DataList)ContentPlaceHolder1.FindControl("dlindexitems");
            if (dl != null)
            {
                dl.Visible = false;
            }
        }
Exemple #13
0
        protected void Button1_Click1(object sender, EventArgs e)
        {
            System.Web.UI.WebControls.Panel pn1;

            if (ContentPlaceHolder1.FindControl("ACTPanel") != null)
            {
                pn1         = (System.Web.UI.WebControls.Panel)ContentPlaceHolder1.FindControl("ACTPanel");
                pn1.Visible = false;
            }

            if (ContentPlaceHolder1.FindControl("XactPanel") != null)
            {
                pn1         = (System.Web.UI.WebControls.Panel)ContentPlaceHolder1.FindControl("XactPanel");
                pn1.Visible = false;
            }
            if (ContentPlaceHolder1.FindControl("rosterPanel") != null)
            {
                pn1         = (System.Web.UI.WebControls.Panel)ContentPlaceHolder1.FindControl("rosterPanel");
                pn1.Visible = false;
            }
            if (ContentPlaceHolder1.FindControl("ZabbixPanel") != null)
            {
                pn1         = (System.Web.UI.WebControls.Panel)ContentPlaceHolder1.FindControl("ZabbixPanel");
                pn1.Visible = false;
            }

            if (ContentPlaceHolder1.FindControl("VcePanel") != null)
            {
                pn1         = (System.Web.UI.WebControls.Panel)ContentPlaceHolder1.FindControl("VcePanel");
                pn1.Visible = false;
            }
            if (ContentPlaceHolder1.FindControl("PegaPanel") != null)
            {
                pn1         = (System.Web.UI.WebControls.Panel)ContentPlaceHolder1.FindControl("PegaPanel");
                pn1.Visible = false;
            }

            int k = 0;

            //roster.Visible = false;
            myenDiv.Visible = false;
            //Label1.Visible = true;
            LiteralControl linkslist = new LiteralControl();
            string         tmplist   = "</br>";
            string         divStart  = @"<div id='linkslist' style='display:inline-block; background-color: #000000'><ul class='navbar-nav mr-auto'>";

            linkslist.Text += divStart;

            string line;

            System.IO.StreamReader file = new System.IO.StreamReader(AppDomain.CurrentDomain.BaseDirectory + @"Raha.Master");

            while ((line = file.ReadLine()) != null)
            {
                //Response.Write(line);
                Regex regexObj = new Regex("<a[^>]*? href=\"(?<url>[^\"]+)\"[^>]*?>(?<text>.*?)<.*?a>", RegexOptions.Singleline);
                var   matches  = regexObj.Matches(line);
                foreach (Match m in matches)
                {
                    //if (m.Groups["text"].Value.ToString().ToLower().Contains(txtContactsSearch.Text.ToLower()))
                    if (m.Groups["text"].Value.ToString().ToLower().Contains(TextBox3.Text.ToLower()))
                    {
                        linkslist.Text += line + "</br></br>";
                    }
                    //Console.WriteLine("URL: " + m.Groups["url"].Value + " -- Text = " + m.Groups["text"].Value);
                }
            }
            string divEnd = @"</ul></div>";

            linkslist.Text += divEnd;
            file.Close();
            file = new System.IO.StreamReader(AppDomain.CurrentDomain.BaseDirectory + @"ActApplicationDetails.aspx");
            string tabStart = @"<table border='1' cellpadding='0' cellspacing='0' width='1633' style='border-collapse: collapse; table-layout: fixed; width: 1224pt; background-color: white'>
 <col class=xl7514219 width=183 style='mso-width-source:userset;mso-width-alt:
 6400;width:138pt'>
 <col class=xl6314219 width=731 style='mso-width-source:userset;mso-width-alt:
 25530;width:549pt'>
 <col width=227 span=2 style='mso-width-source:userset;mso-width-alt:7912;
 width:170pt'> <tr height=19 style='height:14.5pt'>
  <td class=xl6614219 width=183 style='border-top:none;width:138pt'>Application</td>
  <td class=xl6614219 width=731 style='border-top:none;border-left:none;
  width:549pt'>Application Description</td>
  <td class=xl6614219 width=227 style='border-left:none;width:170pt'>Server Details</td>
  <td class=xl6614219 width=227 style='border-left:none;width:170pt'>IP Address</td>
 </tr>";

            while ((line = file.ReadLine()) != null)
            {
                //Response.Write(line);
                Regex regexObj = new Regex("<td class=.(xl6714219|xl6417156|xl6817156|xl6914219|xl6517156|xl6814219).*?>(?<text>.*?)<.*?td>", RegexOptions.Singleline);
                if (line.Contains("<tr") || tmplist.Contains("<tr"))
                {
                    line     = line.Replace('\uFFFD', ' ');
                    tmplist += line;
                    if (line.Contains("</tr>"))
                    {
                        if (k == 1)
                        {
                            linkslist.Text += tmplist;
                            k = 0;
                        }


                        tmplist = "</br>";
                    }
                }

                var matches = regexObj.Matches(line);
                foreach (Match m in matches)
                {
                    //if (m.Groups["text"].Value.ToString().ToLower().Contains(txtContactsSearch.Text.ToLower()))
                    if (m.Groups["text"].Value.ToString().ToLower().Contains(TextBox3.Text.ToLower()))
                    {
                        linkslist.Text += tabStart;
                        //linkslist.Text += line + "</br></br>";
                        k = 1;
                    }
                    //Console.WriteLine("URL: " + m.Groups["url"].Value + " -- Text = " + m.Groups["text"].Value);
                }
            }

            file = new System.IO.StreamReader(AppDomain.CurrentDomain.BaseDirectory + @"Contacts.aspx");


            while ((line = file.ReadLine()) != null)
            {
                //Response.Write(line);
                Regex regexObj = new Regex("<td>(?<text>.*?)<.*?td>", RegexOptions.Singleline);
                if (line.Contains("<tr") || tmplist.Contains("<tr"))
                {
                    line     = line.Replace('\uFFFD', ' ');
                    tmplist += line;
                    if (line.Contains("</tr>"))
                    {
                        if (k == 1)
                        {
                            linkslist.Text += tmplist;
                            k = 0;
                        }
                        tmplist = "</br>";
                    }
                }

                var matches = regexObj.Matches(line);
                foreach (Match m in matches)
                {
                    if (m.Groups["text"].Value.ToString().ToLower().Contains(TextBox3.Text.ToLower()))
                    {
                        linkslist.Text += tabStart;
                        //linkslist.Text += line + "</br></br>";
                        k = 1;
                    }
                }
            }
            if (linkslist.Text.Length > 100)
            {
                Label1.Style["display"] = "block";
            }
            this.Controls.Add(linkslist);

            file.Close();
        }
 protected void lnkAgregarEvento_Click(object sender, EventArgs e)
 {
     ((Button)ContentPlaceHolder1.FindControl("btnEditarEvento")).Visible   = false;
     ((Button)ContentPlaceHolder1.FindControl("btnAgregarEvento")).Visible  = true;
     ((Panel)ContentPlaceHolder1.FindControl("panelAgregarEvento")).Visible = true;
 }
Exemple #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string  connection        = System.Configuration.ConfigurationManager.ConnectionStrings["BizTalkMonitor"].ConnectionString;
            string  storedProc        = System.Configuration.ConfigurationManager.AppSettings["UserAuthorization"];
            string  userName          = HttpContext.Current.User.Identity.Name.ToString();
            int     charcount         = userName.IndexOf(@"\");
            DataSet userAuthorization = null;

            userName = userName.Substring(charcount + 1);

            try
            {
                bool useConfig = false;
                if (Convert.ToBoolean(Convert.ToInt32(ConfigurationManager.AppSettings["UseConfig"].ToString())))
                {
                    useConfig = true;
                }
                userAuthorization = bt_helper.dbHelper.UserAccessDetails(connection, storedProc, userName, useConfig);

                if (!IsPostBack)
                {
                    if (userAuthorization.Tables.Count > 1)
                    {
                        if (Session["AppDomain"] == null)
                        {
                            Session["AuthenticBTUser"] = "******";
                            Session["BTRole"]          = userAuthorization.Tables[1].Rows[0][0].ToString();
                            //Session["BTUSER"] = userAuthorization.Tables[1].Rows[0][1].ToString();
                            Session["BTUSER"]     = userName;
                            Session["AppDomain"]  = userAuthorization.Tables[1].Rows[0][2].ToString();
                            Session["HostDomain"] = userAuthorization.Tables[1].Rows[0][3].ToString();
                        }

                        int count = 0;

                        foreach (DataRow row in userAuthorization.Tables[0].Rows)
                        {
                            string image = "~/Images/" + row[2];
                            menuDashBoard.Items.Add(new MenuItem(" " + " | " + row[0].ToString(), row[0].ToString(), image, row[1].ToString() + ".aspx"));
                            count++;
                        }

                        string[] serverNameListKey   = ConfigurationManager.AppSettings["serverNameKey"].Split(',');
                        string[] serverNameListvalue = ConfigurationManager.AppSettings["serverNameValue"].Split(',');
                        lblServers.Text = serverNameListvalue[0].ToString();

                        Label lblUesrInfoText = (Label)ContentPlaceHolder1.FindControl("lblUesrInfoText");
                        Label lblDatabase     = (Label)ContentPlaceHolder1.FindControl("lblDatabase");
                        Label lblBTServers    = (Label)ContentPlaceHolder1.FindControl("lblBTServers");
                        Label lblDBServers    = (Label)ContentPlaceHolder1.FindControl("lblDBServers");
                        Label lblBTDRServers  = (Label)ContentPlaceHolder1.FindControl("lblBTDRServers");
                        Label lblDBDRServers  = (Label)ContentPlaceHolder1.FindControl("lblDBDRServers");
                        if (lblUesrInfoText != null)
                        {
                            lblUesrInfoText.Text = "<pre><span style=\"color: gray\">WELCOME, <span style=\"color: green\"><b>" + Session["BTUSER"] + "</b></span></span></pre>";
                            lblDatabase.Text     = "<pre><span style=\"color: gray\"><b>" + " BizTalkMgmtDb" + "</b></span></pre>";
                            lblBTServers.Text    = "<pre><span style=\"color: gray\"><b> " + ConfigurationManager.AppSettings["BizTalkServers"].ToString() + "</b></span></pre>";
                            lblDBServers.Text    = "<pre><span style=\"color: gray\"><b> " + ConfigurationManager.AppSettings["DatabaseServers"].ToString() + "</b></span></pre>";
                            lblBTDRServers.Text  = "<pre><span style=\"color: gray\"><b> " + ConfigurationManager.AppSettings["DRServers"].ToString() + "</b></span></pre>";
                            lblDBDRServers.Text  = "<pre><span style=\"color: gray\"><b> " + ConfigurationManager.AppSettings["DRDBServers"].ToString() + "</b></span></pre>";
                        }
                    }
                    else
                    {
                        Response.Redirect("ErrorPage.aspx", true);
                        lblPage.Text = "122";
                    }
                }
            }
            catch (Exception ex)
            {
                lblPage.Text = ex.Message + "\n" + ex.InnerException;
            }
        }
Exemple #16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                var usuarioLogado = new ManterUsuario().ObterUsuarioLogado();

                // Exibir mensagem de alerta.
                RecuperarMensageSessao();

                if (Request.Url.AbsolutePath.ToLower() == "/dashboard.aspx")
                {
                    var inicio = Request["i"];

                    if (inicio == null)
                    {
                        Response.Redirect(Request.Url.AbsolutePath + "?i=" + (new DateTime(DateTime.Now.Year, 1, 1)).ToShortDateString());
                        return;
                    }

                    var fim = Request["f"];

                    if (fim == null)
                    {
                        Response.Redirect(Request.Url + "&f=" + DateTime.Now.ToShortDateString());
                    }

                    var ufQuery = Request["uf"];

                    if (ufQuery == null && usuarioLogado != null && usuarioLogado.UF.ID != (int)enumUF.NA)
                    {
                        ufQuery = usuarioLogado.UF.ID.ToString();
                        Response.Redirect(Request.Url + "&uf=" + ufQuery);
                    }

                    if (!ValidarDatas(inicio, fim))
                    {
                        WebFormHelper.ExibirMensagem(enumTipoMensagem.Atencao, "Data Inicial não pode ser maior que a Data Final.", Request.Url.AbsolutePath + "?i=" + (new DateTime(DateTime.Now.Year, 1, 1)).ToShortDateString() + "&f=" + DateTime.Now.ToShortDateString());
                        return;
                    }

                    txtDataInicial.Text = inicio;
                    txtDataFinal.Text   = fim;

                    var manterUfs = new ManterUf();
                    var listaUfs  = manterUfs.ObterTodosUf();
                    WebFormHelper.PreencherLista(listaUfs, cbxUf, true);

                    if (ufQuery != null)
                    {
                        var idUf = 0;
                        var uf   = int.TryParse(ufQuery, out idUf) ? manterUfs.ObterUfPorID(idUf) : manterUfs.ObterUfPorSigla(ufQuery);
                        if (uf != null)
                        {
                            WebFormHelper.SetarValorNaCombo(uf.ID.ToString(), cbxUf);
                        }
                    }

                    // Setar datas nos controles responsivos da sub-tela.
                    var txtDataInicialResponsivo = (TextBox)ContentPlaceHolder1.FindControl("txtDataInicial");
                    var txtDataFinalResponsivo   = (TextBox)ContentPlaceHolder1.FindControl("txtDataFinal");

                    if (txtDataInicialResponsivo != null)
                    {
                        txtDataInicialResponsivo.Text = inicio;
                    }

                    if (txtDataFinalResponsivo != null)
                    {
                        txtDataFinalResponsivo.Text = fim;
                    }
                }
                else
                {
                    txtDataInicial.Visible = false;
                    txtDataFinal.Visible   = false;
                    cbxUf.Visible          = false;
                    btnFiltrar.Visible     = false;
                }
            }
        }