private void FillPath()
    {
        lblPath.Text = "";
        if (Request.QueryString["ID_Root"] != null)
        {
            if (Request.QueryString["ID_Root"] != "-1")
            {
                dm.Id = int.Parse(Request.QueryString["ID_Root"]);
                DataTable dt = ac.SelectOne(dm);

                string    delimitedInfo = dt.Rows[0]["Path"].ToString();
                string[]  discreteInfo  = delimitedInfo.Split(new char[] { ',' });
                string    title         = "";
                DataTable dt2           = new DataTable();
                foreach (string Data in discreteInfo)
                {
                    if (Data == "-1")
                    {
                        title = "بخش اصلی";
                    }
                    else
                    {
                        dm.Id = int.Parse(Data);
                        dt2   = ac.SelectOne(dm);
                        if (dt2.Rows.Count > 0)
                        {
                            title = dt2.Rows[0]["Title"].ToString();
                        }
                    }
                    lblPath.Text = lblPath.Text + "<a href='./index.aspx?Type=ProductCategory&ID_Root=" +
                                   Data + "'>" + title + "</a>" + " >> ";
                }
                lblPath.Text = lblPath.Text + "<a href='./index.aspx?Type=ProductCategory&ID_Root=" +
                               dt.Rows[0]["ID"].ToString() + "'>" + dt.Rows[0]["Title"].ToString() + "</a>" + " >> ";
            }
            else
            {
                lblPath.Text = lblPath.Text + "<a href='./index.aspx?Type=ProductCategory&ID_Root=-1'>بخش اصلی</a>  >> ";
            }
        }
        else
        {
            lblPath.Text = lblPath.Text + "<a href='./index.aspx?Type=ProductCategory&ID_Root=-1'>بخش اصلی</a>  >> ";
        }
    }
예제 #2
0
    private void Fill()
    {
        if (Request.QueryString["ID_Product"] != null)
        {
            dm.Id = decimal.Parse(Request.QueryString["ID_Product"].ToString());
        }

        DataTable dt = ac.Select_Product_One(dm);

        TextTitle.Text   = dt.Rows[0]["title"].ToString();
        FCKeditor2.Value = dt.Rows[0]["text_short"].ToString();
        FCKeditor1.Value = dt.Rows[0]["text_long"].ToString();
        TextBox4.Text    = dt.Rows[0]["price"].ToString();
        TextBox3.Text    = dt.Rows[0]["post_price"].ToString();
        TextBox5.Text    = dt.Rows[0]["weight"].ToString();
        TextBox6.Text    = dt.Rows[0]["rate"].ToString();
        TextBox1.Text    = dt.Rows[0]["MetaKeyword"].ToString();
        TextBox2.Text    = dt.Rows[0]["MetaDescription"].ToString();

        DropDownList1.SelectedIndex = -1;
        DropDownListVaziat.Items.FindByValue(dt.Rows[0]["id_State"].ToString()).Selected = true;

        TextBox8.Text = dt.Rows[0]["catalug"].ToString();
        TextBox7.Text = dt.Rows[0]["demo"].ToString();

        FileUpload1.ToolTip = dt.Rows[0]["pic"].ToString();

        Image1.ImageUrl = dt.Rows[0]["pic"].ToString();


        Product_Grouping      ac2 = new Product_Grouping();
        Product_GroupingDatum dm2 = new Product_GroupingDatum();

        dm2.Id = decimal.Parse(dt.Rows[0]["ID_Group"].ToString());
        DataTable dt2 = ac2.SelectOne(dm2);

        if (dt2.Rows.Count > 0)
        {
            string   delimitedInfo = dt2.Rows[0]["Path"].ToString();
            string[] discreteInfo  = delimitedInfo.Split(new char[] { ',' });
            int      i             = 1;
            foreach (string Data in discreteInfo)
            {
                if (Data == "-1")
                {
                    FillDr(int.Parse(Data), (DropDownList)FindControl("DropDownList" + i.ToString()));
                }
                else
                {
                    ((DropDownList)(FindControl("DropDownList" + (i - 1).ToString()))).Items.FindByValue(Data).Selected = true;
                    FillDr(int.Parse(Data), (DropDownList)FindControl("DropDownList" + i.ToString()));
                }
                i++;
            }
            ((DropDownList)(FindControl("DropDownList" + (i - 1).ToString()))).Items.FindByValue(dt.Rows[0]["ID_Group"].ToString()).Selected = true;
        }
    }
예제 #3
0
    private void FillMeta()
    {
        Product_Grouping      acg = new Product_Grouping();
        Product_GroupingDatum dmg = new Product_GroupingDatum();
        bool Home = false;

        if (Request.QueryString["ID_Root"] != null)
        {
            if (Request.QueryString["ID_Root"] != "-1")
            {
                dmg.Id = decimal.Parse(Request.QueryString["ID_Root"]);
                DataTable dt = acg.SelectOne(dmg);
                if (dt.Rows.Count > 0)
                {
                    SetMetaTags("گروه " + dt.Rows[0]["title"].ToString(),
                                dt.Rows[0]["MetaDescription"].ToString(),
                                dt.Rows[0]["MetaKeyword"].ToString());
                }
                else
                {
                    Home = true;
                }
            }
            else
            {
                Home = true;
            }
        }
        else
        {
            Home = true;
        }
        if (Home)
        {
            OneRecord      ac2   = new OneRecord();
            OneRecordDatum dm2   = new OneRecordDatum();
            string         title = "فروشگاه اینترنتی فراجهش شمال";
            string         key   = "";
            string         desc  = "";
            DataTable      dt2;
            dm2.Type = "MetaTagTitle";
            dt2      = ac2.SelectOne(dm2);
            if (dt2.Rows.Count > 0)
            {
                title = dt2.Rows[0]["text"].ToString();
            }
            dm2.Type = "MetaTagKeyword";
            dt2      = ac2.SelectOne(dm2);
            if (dt2.Rows.Count > 0)
            {
                key = dt2.Rows[0]["text"].ToString();
            }
            dm2.Type = "MetaTagDescription";
            dt2      = ac2.SelectOne(dm2);
            if (dt2.Rows.Count > 0)
            {
                desc = dt2.Rows[0]["text"].ToString();
            }
            SetMetaTags(title, desc, key);
        }
    }
예제 #4
0
    private void FillPath()
    {
        lblPath.Text = "";
        if (Request.QueryString["ID_Root"] != null && Request.QueryString["ID_Root"].Length > 0)
        {
            if (Request.QueryString["ID_Root"] != "-1")
            {
                dm.Id = int.Parse(Request.QueryString["ID_Root"]);
                DataTable dt = ac.SelectOne(dm);

                string    delimitedInfo = dt.Rows[0]["Path"].ToString();
                string[]  discreteInfo  = delimitedInfo.Split(new char[] { ',' });
                string    title         = "";
                DataTable dt2           = new DataTable();
                foreach (string Data in discreteInfo)
                {
                    if (Data == "-1")
                    {
                        title = "صفحه اصلی";
                    }
                    else
                    {
                        dm.Id = int.Parse(Data);
                        dt2   = ac.SelectOne(dm);
                        if (dt2.Rows.Count > 0)
                        {
                            title = dt2.Rows[0]["Title"].ToString();
                        }
                    }
                    lblPath.Text = lblPath.Text + "<a href='./index.aspx?Type=ProductCategory&ID_Root=" +
                                   Data + "'>" + title + "</a>" + "<img src='./Administrator/files/Design/arrow_rtl.png' class='PathArrow'/>";
                }
                lblPath.Text = lblPath.Text + "<a href='./index.aspx?Type=ProductCategory&ID_Root=" +
                               dt.Rows[0]["ID"].ToString() + "'>" + dt.Rows[0]["Title"].ToString() + "</a>" + "<img src='./Administrator/files/Design/arrow_rtl.png' class='PathArrow'/>";
            }
            else
            {
                lblPath.Text = lblPath.Text + "<a href='./index.aspx'>صفحه اصلی</a><img src='./Administrator/files/Design/arrow_rtl.png' class='PathArrow'/>";
            }
        }
        else
        {
            lblPath.Text = lblPath.Text + "<a href='./index.aspx'>صفحه اصلی</a><img src='./Administrator/files/Design/arrow_rtl.png' class='PathArrow'/>";
        }

        if (Request.QueryString["ID_Product"] != null)
        {
            Product      ac3 = new Product();
            ProductDatum dm3 = new ProductDatum();
            dm3.Id = decimal.Parse(Request.QueryString["ID_Product"]);
            DataTable dt3 = ac3.Select_Product_One(dm3);
            if (dt3.Rows.Count > 0)
            {
                lblPath.Text = lblPath.Text + "<a href='./index.aspx?ID_Product=" + Request.QueryString["ID_Product"] +
                               "&ID_Root=" + dt3.Rows[0]["id_group"].ToString() + "'>" + dt3.Rows[0]["Title"].ToString() + "</a><img src='./Administrator/files/Design/arrow_rtl.png' class='PathArrow'/>";
            }
            else
            {
                Response.Redirect("~/index.aspx?Type=404");
            }
        }
        if (Request.QueryString["ID_Page"] != null)
        {
            Page_Manage      ac4 = new Page_Manage();
            Page_ManageDatum dm4 = new Page_ManageDatum();
            dm4.Id = decimal.Parse(Request.QueryString["ID_Page"]);
            DataTable dt4 = ac4.Select_page_One(dm4);
            if (dt4.Rows.Count > 0)
            {
                lblPath.Text = lblPath.Text + "<a href='./index.aspx?Type=PageArchive'>آرشیو صفحات</a><img src='./Administrator/files/Design/arrow_rtl.png' class='PathArrow'/>" +
                               "<a href='./index.aspx?ID_Page=" + Request.QueryString["ID_Page"] +
                               "'>" + dt4.Rows[0]["Title"].ToString() + "</a><img src='./Administrator/files/Design/arrow_rtl.png' class='PathArrow'/>";
            }
            else
            {
                Response.Redirect("~/index.aspx?Type=404");
            }
        }
    }