Exemplo n.º 1
0
 private void LoadGrid()
 {
     gdvRobots.DataSource = RobotsController.GetRobots(GetPortalID);
     gdvRobots.DataBind();
 }
Exemplo n.º 2
0
    private void generateRobots()
    {
        RobotsController.DeleteExistingRobots(GetPortalID);
        List <RobotsInfo> items = RobotsController.GetRobots(GetPortalID);
        int    flag             = 0;
        string TabPath          = string.Empty;

        foreach (ListItem chkitem in chkChoice.Items)
        {
            if (chkitem.Selected == false)
            {
                flag++;
            }
            else if (chkitem.Selected == true && chkitem.Text == "Google")
            {
                foreach (GridViewRow gvRow in gdvRobots.Rows)
                {
                    CheckBox chk = (CheckBox)gvRow.FindControl("chkPath");
                    if (chk.Checked)
                    {
                        Label lblTabPath = (Label)gvRow.FindControl("lblTabPath");
                        TabPath = lblTabPath.Text;
                        if (!IsParent)
                        {
                            TabPath = "/portal/" + GetPortalSEOName + TabPath;
                        }
                        RobotsController.SaveRobotsPage(GetPortalID, "Googlebot", TabPath);
                    }
                }
            }
            else if (chkitem.Selected == true && chkitem.Text == "Yahoo")
            {
                foreach (GridViewRow gvRow in gdvRobots.Rows)
                {
                    CheckBox chk = (CheckBox)gvRow.FindControl("chkPath");
                    if (chk.Checked)
                    {
                        Label lblTabPath = (Label)gvRow.FindControl("lblTabPath");
                        TabPath = lblTabPath.Text;
                        if (!IsParent)
                        {
                            TabPath = "/portal/" + GetPortalSEOName + TabPath;
                        }
                        RobotsController.SaveRobotsPage(GetPortalID, "Slurp", TabPath);
                    }
                }
            }
            else if (chkitem.Selected == true && chkitem.Text == "Msn")
            {
                foreach (GridViewRow gvRow in gdvRobots.Rows)
                {
                    CheckBox chk = (CheckBox)gvRow.FindControl("chkPath");
                    if (chk.Checked)
                    {
                        Label lblTabPath = (Label)gvRow.FindControl("lblTabPath");
                        TabPath = lblTabPath.Text;
                        if (!IsParent)
                        {
                            TabPath = "/portal/" + GetPortalSEOName + TabPath;
                        }

                        RobotsController.SaveRobotsPage(GetPortalID, "msnbot", TabPath);
                    }
                }
            }
            else if (chkitem.Selected == true && chkitem.Text == "Bing")
            {
                foreach (GridViewRow gvRow in gdvRobots.Rows)
                {
                    CheckBox chk = (CheckBox)gvRow.FindControl("chkPath");
                    if (chk.Checked)
                    {
                        Label lblTabPath = (Label)gvRow.FindControl("lblTabPath");
                        TabPath = lblTabPath.Text;
                        if (!IsParent)
                        {
                            TabPath = "/portal/" + GetPortalSEOName + TabPath;
                        }
                        RobotsController.SaveRobotsPage(GetPortalID, "bingbot", TabPath);
                    }
                }
            }
            if (flag == chkChoice.Items.Count)
            {
                string message = "Select Searchengine";
                ShowMessage("", message, "", SageMessageType.Alert);
            }
            else
            {
                WriteRobots();
                string message = "Robots Generated Successfully";
                ShowMessage("", message, "", SageMessageType.Success);
            }
        }
    }
    private void generateRobots()
    {
        RobotsController.DeleteExistingRobots(GetPortalID);
        List <RobotsInfo> items = RobotsController.GetRobots(GetStoreID, GetPortalID);
        int    flag             = 0;
        string TabPath          = string.Empty;

        foreach (ListItem chkitem in chkChoice.Items)
        {
            if (chkitem.Selected == false)
            {
                flag++;
            }
            if (chkitem.Selected == true && chkitem.Text == "Google")
            {
                foreach (GridViewRow gvRow in gdvRobots.Rows)
                {
                    CheckBox chk = (CheckBox)gvRow.FindControl("chkPath");
                    if (chk.Checked)
                    {
                        Label lblTabPath = (Label)gvRow.FindControl("lblTabPath");
                        TabPath = lblTabPath.Text;
                        if (GetPortalID > 1)
                        {
                            TabPath = "/portal/" + GetPortalSEOName + TabPath;
                        }
                        RobotsController.SaveRobotsPage(GetPortalID, "Googlebot", TabPath);
                    }
                }
            }
            if (chkitem.Selected == true && chkitem.Text == "Yahoo")
            {
                foreach (GridViewRow gvRow in gdvRobots.Rows)
                {
                    CheckBox chk = (CheckBox)gvRow.FindControl("chkPath");
                    if (chk.Checked)
                    {
                        Label lblTabPath = (Label)gvRow.FindControl("lblTabPath");
                        TabPath = lblTabPath.Text;
                        if (GetPortalID > 1)
                        {
                            TabPath = "/portal/" + GetPortalSEOName + TabPath;
                        }
                        RobotsController.SaveRobotsPage(GetPortalID, "Slurp", TabPath);
                    }
                }
            }
            if (chkitem.Selected == true && chkitem.Text == "Msn")
            {
                foreach (GridViewRow gvRow in gdvRobots.Rows)
                {
                    CheckBox chk = (CheckBox)gvRow.FindControl("chkPath");
                    if (chk.Checked)
                    {
                        Label lblTabPath = (Label)gvRow.FindControl("lblTabPath");
                        TabPath = lblTabPath.Text;
                        if (GetPortalID > 1)
                        {
                            TabPath = "/portal/" + GetPortalSEOName + TabPath;
                        }

                        RobotsController.SaveRobotsPage(GetPortalID, "msnbot", TabPath);
                    }
                }
            }
            if (chkitem.Selected == true && chkitem.Text == "Bing")
            {
                foreach (GridViewRow gvRow in gdvRobots.Rows)
                {
                    CheckBox chk = (CheckBox)gvRow.FindControl("chkPath");
                    if (chk.Checked)
                    {
                        Label lblTabPath = (Label)gvRow.FindControl("lblTabPath");
                        TabPath = lblTabPath.Text;
                        if (GetPortalID > 1)
                        {
                            TabPath = "/portal/" + GetPortalSEOName + TabPath;
                        }
                        RobotsController.SaveRobotsPage(GetPortalID, "bingbot", TabPath);
                    }
                }
            }
            if (flag == chkChoice.Items.Count)
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "globalVariables", " alert('Select Searchengine'); ", true);
            }
            else
            {
                WriteRobots();
            }
        }
    }