Пример #1
0
    private void RunTest(string[] testData)
    {
        var testResults = new List <TestData>();

        foreach (string strTestData in testData)
        {
            var tr = new TestData {
                Name = strTestData
            };
            string fullName = HttpContext.Current.Server.MapPath(strTestData);
            tr.AbsolutePath = fullName;
            if (Directory.Exists(fullName))
            {
                tr.Exist = true;
                var di = new DirectoryInfo(fullName);
                try
                {
                    tr.FilesCount = di.GetFiles().Length;
                }
                catch (Exception)
                {
                }

                CheckDirectory(di, tr);
            }
            testResults.Add(tr);
        }

        StatusRepeater.DataSource = testResults;
        StatusRepeater.DataBind();
    }
Пример #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        GoBack.NavigateUrl = "ManageSiteGenText.aspx?sitelang=" + Request.QueryString["sitelang"] + "&cat=" + Request.QueryString["cat"] + "&sub=" + Request.QueryString["sub"];
        if (cmstrDefualts.CheckQueryString("status", out status))
        {
            GoBack.NavigateUrl = "ManageSiteGenText.aspx?sitelang=" + Request.QueryString["sitelang"] + "&cat=" + Request.QueryString["cat"] + "&sub=" + Request.QueryString["sub"] + "&status=";
        }
        if (Request.QueryString["sitelang"] != null && int.TryParse(Request.QueryString["sitelang"], out myLang))
        {
            if (Request.QueryString["page"] != null)
            {
                int.TryParse(Request.QueryString["page"], out pageid);
            }
            string pagequery = pageid == 0 ? "" : " AND langtext2.PageID=" + pageid;

            String           sql       = String.Format("Select langtext2.PageID as mypage, LangTextID, `{1}` as myText,TextType,PageStatus,TextComment,TextName,pagename From langtext2 left join pages2 On pages2.pageid=langtext2.PageID  where 1=1 {0}  order by PageStatus", pagequery, myLang);
            MySqlDataAdapter MyAdapter = new MySqlDataAdapter(sql, conn);
            MyAdapter.Fill(ds, "lang");
            dv = ds.Tables["lang"].DefaultView;
            if (!IsPostBack)
            {
                if (cmstrDefualts.CheckQueryString("status", out status))
                {
                    dv.RowFilter = "PageStatus=" + status;
                }
                EditTextRepeater.DataSource = dv;
                EditTextRepeater.DataBind();
                string[] myvalues = { "PageStatus", "mypage" };
                if (dv.Count > 0)
                {
                    pageHeader.Text = dv[0]["pagename"].ToString();
                }
                dv.RowFilter = "PageStatus>0";
                DataTable mytable = dv.ToTable(true, myvalues);
                StatusRepeater.DataSource = mytable;
                StatusRepeater.DataBind();
            }
        }
        else
        {
            Response.Redirect("../");
        }
    }