Beispiel #1
0
    public void populateServiceddl()
    {
        //GCommon<Service> obj = new DataManipulationClass().populateService();
        List <Service> obj = new DataManipulationClass().populateService_list();
        DataTable      dt  = GenericListToDataTable(obj);

        ViewState["dtdata1"] = dt;
        Session["list"]      = obj;
        // this.gridTest.DataSource = dt;
        this.gridTest.DataSource = obj;
        this.gridTest.DataBind();



        if (obj.Count > 0)
        {
            IEnumerator <Service> ie = obj.GetEnumerator();

            ListItem li = new ListItem();
            li.Value = "0";
            li.Text  = "Please Select";
            ddlService.Items.Insert(0, li);

            while (ie.MoveNext())
            {
                li       = new ListItem();
                li.Text  = ie.Current.service_name.ToString();
                li.Value = ie.Current.service_id.ToString();
                ddlService.Items.Add(li);
            }
        }
    }
Beispiel #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // DataTable dt=new DataTable();
        // dt.Columns.Add("recid", typeof(int));
        // DataRowState dr=dt.new
        //dr["recid"]="1";
        //Dictionary<int, string> dict = new Dictionary<int, string>();
        //dict.Add("1", "Ram");
        //dict.Add("2", "Sam");
        //dict.Add("1", "Jadhu");

        //try
        //{
        //    int x = 4;
        //    int y = 0;
        //    int res = x / y;
        //}
        //catch (Exception ex)
        //{

        //}
        //finally
        //{
        //    Response.Redirect("http://www.rediffmail.com:");
        //}
        //int x=fun();
        //if (ValidateUrl("http://www.rediffmail.com:"))
        if (ValidateUrl("http://www.suvrojyotik.com"))
        {
        }
        DataManipulationClass objd = new DataManipulationClass();

        objd.funOL(1);
    }
    protected void ddlSite_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (ddlSite.SelectedValue != "")
        {
            dvData.Visible    = true;
            GridView1.Visible = false;
            lblMsg.Text       = "";
            lblSearch.Text    = "";
            string sql = "SELECT " +
                         "LinkExchange.SubPage.ID, " +
                         "LinkExchange.SubPage.LinkURL " +
                         "FROM " +
                         "LinkExchange.SubPage " +
                         "WHERE LinkExchange.SubPage.Websiteid='" + ddlSite.SelectedValue + "'";
            string strError = "";
            string _schema  = Convert.ToString(ConfigurationManager.AppSettings["SCHEMA"]);

            DataManipulationClass objdata = new DataManipulationClass();

            objdata.DropDownFill(ddlSubPage, sql, "LinkURL", "ID", _schema, ref strError);
        }
        else
        {
            lblMsg.Text = "Please select a site";
            ddlSite.Focus();
            dvData.Visible = false;
            this.Page.ClientScript.RegisterStartupScript(this.GetType(), "alert1", "<script>alert('Please select a site');</script>");
        }
    }
Beispiel #4
0
    protected void btnSubmit_Click(object sender, ImageClickEventArgs e)
    {
        Login objlogin = new Login();

        objlogin.Address1 = txtAddress1.Value.ToString().Replace("'", "''");
        objlogin.username = txtUserName.Value;
        DataManipulationClass objdata = new DataManipulationClass();
        string strError = "";

        objdata.AddExpert(objlogin, ref strError);
    }
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Upd")
        {
            TextBox txtpageid = (TextBox)GridView1.Rows[Convert.ToInt32(e.CommandArgument)].FindControl("txtpageid");

            Label lblid = (Label)GridView1.Rows[Convert.ToInt32(e.CommandArgument)].FindControl("lblid");
            //Button btnUpdate = (Button)GridView1.Rows[Convert.ToInt32(e.CommandArgument)].FindControl("btnUpdate");
            LinkButton btnUpdate = (LinkButton)GridView1.Rows[Convert.ToInt32(e.CommandArgument)].FindControl("btnUpdate");

            btnUpdate.Attributes.Add("onclick", "javascript:return ValidateText('" + txtpageid.ClientID + "');");

            //btnGo.Attributes.Add("onclick", "javascript:ValidateText(" + btnGo.ID + ")");
            //ScriptManager sm = ScriptManager.GetCurrent(Page);
            //ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "MYScript", "ValidateText(" + txtUrlName.ClientID + ")", true);

            DataManipulationClass objData = new DataManipulationClass();
            string stError = "";
            if (txtpageid.Text != "")
            {
                if (objData.UpdateLinkExchangeMaster_Pageid(Convert.ToInt32(lblid.Text), Convert.ToInt32(txtpageid.Text), ref stError))
                {
                    Response.Redirect("Insert-Page-Number.aspx?flag=update");
                }
                else
                {
                }
            }
            else
            {
                lblMsg.Text = "Please enter Page Id";
                //this.Page.ClientScript.RegisterStartupScript(this.GetType(), "alert13", "<script>alert('Please enter Page Id');</script>");
                // ScriptManager.RegisterStartupScript(this, this.GetType(), "alert22", "<script>alert('Please enter Page Id');</script>", true);

                string[] _strContNameAll = txtpageid.ClientID.ToString().Split(new char[] { '_' });
                int      _intTempId      = Convert.ToInt32(_strContNameAll[1].Substring(3)) + 1;
                string   _strId          = "";
                if (_intTempId < 10)
                {
                    _strId = "GridView1_ctl0" + Convert.ToString(_intTempId) + "_txtpageid";
                }
                else
                {
                    _strId = "GridView1_ctl" + Convert.ToString(_intTempId) + "_txtpageid";
                }

                ScriptManager sm = ScriptManager.GetCurrent(Page);
                ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "MYScript", "alert('Please enter Page Id');document.getElementById(\"" + _strId + "\").focus();", true);
                ScriptManager.RegisterStartupScript(this, this.GetType(), "selectAndFocus", "$get('" + txtpageid.ClientID + "').focus();$get('" + txtpageid.ClientID + "').select();", true);
                return;
            }
        }
    }
Beispiel #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["log"] == "logout")
        {
            if (Request.Cookies["UserInfo"] != null)
            {
                if (Request.Cookies["UserInfo"]["userId"] != null)
                {
                    string[] cookies = Request.Cookies.AllKeys;
                    foreach (string cookie in cookies)
                    {
                        Response.Cookies[cookie].Expires = DateTime.Now.AddDays(-1);
                    }
                    Session.Abandon();
                    Session.Clear();
                    Response.Redirect("Index.aspx");
                }
            }
        }


        string strError = "";

        if (Request.Cookies["UserInfo"] != null)
        {
            if (!Page.IsPostBack)
            {
                if (Request.Cookies["UserInfo"]["userId"] != null)
                {
                    int intUserId = Convert.ToInt32(Request.Cookies["UserInfo"]["userId"]);
                    DataManipulationClass objdata = new DataManipulationClass();
                    // string name = objdata.GetName(intUserId, ref strError);
                    string name = "";
                    dvlogin.InnerHtml = "";
                    if (strError == "")
                    {
                        Welcome.InnerHtml = "Welcome " + name;
                        dvlogin.Visible   = false;
                        dvlogout.Visible  = true;
                    }
                    else
                    {
                        dvlogin.InnerHtml = strError;
                    }
                }
            }
        }
        else
        {
            dvlogin.Visible  = true;
            dvlogout.Visible = false;
        }
    }
    public void populateStateddl()
    {
        GCommon <State>     obj = new DataManipulationClass().populateState();
        IEnumerator <State> ie  = obj.GetEnumerator();

        while (ie.MoveNext())
        {
            ListItem li = new ListItem();
            li.Text  = ie.Current.sname.ToString();
            li.Value = ie.Current.sid.ToString();
            ddlState.Items.Add(li);
        }
    }
Beispiel #8
0
    public string get_MailCount(int LinkId, string SlNo)
    {
        DataManipulationClass objdata = new DataManipulationClass();
        string        mailcount       = "";
        string        mailtime        = "";
        StringBuilder sbMail          = new StringBuilder();

        if (objdata.get_MailCount(LinkId, ref mailcount, ref mailtime))
        {
            if (mailtime != "")
            {
                sbMail.Append("<a href=\"javascript:funOpenMailContentDiv(" + LinkId + "," + SlNo + ");\">" + mailcount + " Mails send against this Exchange. Last email sent " + Convert.ToDateTime(mailtime).ToString("MMMM dd, yyyy h:mm tt") + "</a>");
            }
            else
            {
                sbMail.Append(mailcount + " Mails send against this Exchange.");
            }
        }
        return(sbMail.ToString());
    }
    public void populateServiceddl()
    {
        GCommon <Service> obj = new DataManipulationClass().populateService();

        if (obj.Count > 0)
        {
            IEnumerator <Service> ie = obj.GetEnumerator();
            ListItem li = new ListItem();
            li.Value = "0";
            li.Text  = "Please Select";
            ddlService.Items.Insert(0, li);

            while (ie.MoveNext())
            {
                li       = new ListItem();
                li.Text  = ie.Current.service_name.ToString();
                li.Value = ie.Current.service_id.ToString();
                ddlService.Items.Add(li);
            }
        }
    }
Beispiel #10
0
    private void generateMenu(string id)
    {
        string strSql = "SELECT " +
                        "dbo.Menu_Master.Id AS [ID],  " +
                        "dbo.Menu_Master.Title AS [Title], " +
                        "dbo.Menu_Master.ParentId AS [pid],  " +
                        "dbo.Menu_Master.Level AS [lvl],  " +
                        //"dbo.Menu_Master.SQL AS [SQL], " +
                        "CASE WHEN dbo.Menu_Master.PageLink IS NULL THEN '#' ELSE dbo.Menu_Master.PageLink END AS [URL]  " +
                        "FROM  " +
                        "dbo.Menu_Login_Relation  " +
                        "INNER JOIN dbo.Menu_Master ON (dbo.Menu_Login_Relation.MenuId = dbo.Menu_Master.Id)  " +
                        "WHERE  " +
                        "(dbo.Menu_Master.RecordStatus = '1')   " +
                        "AND  " +
                        "(dbo.Menu_Login_Relation.LoginId='" + id + "') ORDER BY dbo.Menu_Master.Title";

        DataTable dt = new DataManipulationClass().FillDataTable(strSql);

        dvMenu.InnerHtml = generateRootMenu(dt);
    }
    private void populateSite(int UserId)
    {
        GCommon <WebSiteDetail> objLink = new DataManipulationClass().GetSiteCollection(UserId);

        if (objLink.Count > 0)
        {
            System.Collections.Generic.IEnumerator <WebSiteDetail> ie = objLink.GetEnumerator();
            ddlSite.Items.Clear();
            ListItem li = new ListItem();
            li.Text  = "Please Select";
            li.Value = "";
            ddlSite.Items.Add(li);

            while (ie.MoveNext())
            {
                li       = new ListItem();
                li.Text  = Convert.ToString(ie.Current.SiteURL);
                li.Value = Convert.ToString(ie.Current.Id);
                ddlSite.Items.Add(li);
            }
        }
    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        string ids = "";

        foreach (ListItem li in cbSubService.Items)
        {
            if (li.Selected == true)
            {
                ids += li.Value + "|";
            }
        }
        string strError = "";

        DataManipulationClass objDataM = new DataManipulationClass();

        if (!objDataM.Add_Service_SubService_Relation(Convert.ToInt32(ddlService.SelectedValue), ids, ref strError))
        {
            lblMsg.Text = strError;
        }
        else
        {
            lblMsg.Text = "Relation added Successfully";
        }
    }
Beispiel #13
0
    public void BindDatalist(string UserId, string Type)
    {
        DataManipulationClass objdata = new DataManipulationClass();
        string strError = "";
        string strSQL   = "";

        if (Type != "2")
        {
            strSQL = " SELECT " +
                     " LinkExchange.WebSite_Master.Id  ,  " +
                     " LinkExchange.WebSite_Master.Name, " +
                     "  LinkExchange.LinkExchangeMaster.Status," +
                     " count(LinkExchange.WebSite_Master.Name)as Wait " +
                     " FROM LinkExchange.LinkExchangeMaster  " +
                     " INNER JOIN LinkExchange.WebSite_Master ON (LinkExchange.LinkExchangeMaster.WebSiteId=LinkExchange.WebSite_Master.Id)" +
                     " WHERE " +
                     " (LinkExchange.WebSite_Master.UserId = '" + UserId + "') " +
                     " group by " +
                     " LinkExchange.WebSite_Master.Id  ,  " +
                     " LinkExchange.WebSite_Master.Name,  " +
                     " LinkExchange.LinkExchangeMaster.Status " +
                     " having LinkExchange.LinkExchangeMaster.Status=2 ";
        }
        else
        {
            strSQL = " SELECT " +
                     " LinkExchange.WebSite_Master.Id  ,  " +
                     " LinkExchange.WebSite_Master.Name, " +
                     "  LinkExchange.LinkExchangeMaster.Status," +
                     " count(LinkExchange.WebSite_Master.Name)as Wait " +
                     " FROM LinkExchange.LinkExchangeMaster  " +
                     " INNER JOIN LinkExchange.WebSite_Master ON (LinkExchange.LinkExchangeMaster.WebSiteId=LinkExchange.WebSite_Master.Id)" +
                     " INNER JOIN LinkExchange.User_WebSite_Relation ON (LinkExchange.WebSite_Master.id = LinkExchange.User_WebSite_Relation.WebSiteId)" +
                     " WHERE " +
                     " (LinkExchange.User_WebSite_Relation.UserId = '" + UserId + "') " +
                     " group by " +
                     " LinkExchange.WebSite_Master.Id  ,  " +
                     " LinkExchange.WebSite_Master.Name,  " +
                     " LinkExchange.LinkExchangeMaster.Status " +
                     " having LinkExchange.LinkExchangeMaster.Status=2 ";
        }
        DataTable dtWait = new DataTable();

        //dtWait.Columns.Add("SNo", typeof(int));
        //dtWait.PrimaryKey = new System.Data.DataColumn[] { dtWait.Columns["Id"] };

        dtWait = objdata.FillDataTable(strSQL, ref strError);

        if (Type != "2")
        {
            strSQL = " SELECT " +
                     " LinkExchange.WebSite_Master.Id  ,  " +
                     " LinkExchange.WebSite_Master.Name, " +
                     "  LinkExchange.LinkExchangeMaster.Status," +
                     " count(LinkExchange.WebSite_Master.Name)as Approved " +
                     " FROM LinkExchange.LinkExchangeMaster  " +
                     " INNER JOIN LinkExchange.WebSite_Master ON (LinkExchange.LinkExchangeMaster.WebSiteId=LinkExchange.WebSite_Master.Id)" +
                     " WHERE " +
                     " (LinkExchange.WebSite_Master.UserId = '" + UserId + "') " +
                     " group by " +
                     " LinkExchange.WebSite_Master.Id  ,  " +
                     " LinkExchange.WebSite_Master.Name,  " +
                     " LinkExchange.LinkExchangeMaster.Status " +
                     " having LinkExchange.LinkExchangeMaster.Status=1 ";
        }
        else
        {
            strSQL = " SELECT " +
                     " LinkExchange.WebSite_Master.Id  ,  " +
                     " LinkExchange.WebSite_Master.Name, " +
                     "  LinkExchange.LinkExchangeMaster.Status," +
                     " count(LinkExchange.WebSite_Master.Name)as Approved " +
                     " FROM LinkExchange.LinkExchangeMaster  " +
                     " INNER JOIN LinkExchange.WebSite_Master ON (LinkExchange.LinkExchangeMaster.WebSiteId=LinkExchange.WebSite_Master.Id)" +
                     " INNER JOIN LinkExchange.User_WebSite_Relation ON (LinkExchange.WebSite_Master.id = LinkExchange.User_WebSite_Relation.WebSiteId)" +
                     " WHERE " +
                     " (LinkExchange.User_WebSite_Relation.UserId = '" + UserId + "') " +
                     " group by " +
                     " LinkExchange.WebSite_Master.Id  ,  " +
                     " LinkExchange.WebSite_Master.Name,  " +
                     " LinkExchange.LinkExchangeMaster.Status " +
                     " having LinkExchange.LinkExchangeMaster.Status=1 ";
        }

        DataTable dtApproved = objdata.FillDataTable(strSQL, ref strError);

        if (Type != "2")
        {
            strSQL = " SELECT " +
                     " LinkExchange.WebSite_Master.Id  ,  " +
                     " LinkExchange.WebSite_Master.Name, " +
                     "  LinkExchange.LinkExchangeMaster.Status," +
                     " count(LinkExchange.WebSite_Master.Name)as Reject " +
                     " FROM LinkExchange.LinkExchangeMaster  " +
                     " INNER JOIN LinkExchange.WebSite_Master ON (LinkExchange.LinkExchangeMaster.WebSiteId=LinkExchange.WebSite_Master.Id)" +
                     " WHERE " +
                     " (LinkExchange.WebSite_Master.UserId = '" + UserId + "') " +
                     " group by " +
                     " LinkExchange.WebSite_Master.Id  ,  " +
                     " LinkExchange.WebSite_Master.Name,  " +
                     " LinkExchange.LinkExchangeMaster.Status " +
                     " having LinkExchange.LinkExchangeMaster.Status=3 ";
        }
        else
        {
            strSQL = " SELECT " +
                     " LinkExchange.WebSite_Master.Id  ,  " +
                     " LinkExchange.WebSite_Master.Name, " +
                     "  LinkExchange.LinkExchangeMaster.Status," +
                     " count(LinkExchange.WebSite_Master.Name)as Reject " +
                     " FROM LinkExchange.LinkExchangeMaster  " +
                     " INNER JOIN LinkExchange.WebSite_Master ON (LinkExchange.LinkExchangeMaster.WebSiteId=LinkExchange.WebSite_Master.Id)" +
                     " INNER JOIN LinkExchange.User_WebSite_Relation ON (LinkExchange.WebSite_Master.id = LinkExchange.User_WebSite_Relation.WebSiteId)" +
                     " WHERE " +
                     " (LinkExchange.User_WebSite_Relation.UserId = '" + UserId + "') " +
                     " group by " +
                     " LinkExchange.WebSite_Master.Id  ,  " +
                     " LinkExchange.WebSite_Master.Name,  " +
                     " LinkExchange.LinkExchangeMaster.Status " +
                     " having LinkExchange.LinkExchangeMaster.Status=3 ";
        }

        DataTable dtReject = objdata.FillDataTable(strSQL, ref strError);

        //DataRow drWait = null;
        //dtWait.Columns.Add("Approved", typeof(string));
        //for (int i = 0; i < dtWait.Rows.Count; i++)
        //{
        //    for (int j = 0; j < dtApproved.Rows.Count; j++)
        //    {
        //        if (dtWait.Rows[i]["id"].ToString() == dtApproved.Rows[j]["id"].ToString())
        //        {
        //            drWait = dtApproved.NewRow();
        //            drWait["Approved"] = dtApproved.Rows[j]["Approved"].ToString();

        //        }
        //    }
        //}
        //dtWait.AcceptChanges();


        dtWait.PrimaryKey = new DataColumn[1] {
            dtWait.Columns["Id"]
        };
        dtApproved.PrimaryKey = new DataColumn[1] {
            dtApproved.Columns["Id"]
        };
        dtReject.PrimaryKey = new DataColumn[1] {
            dtReject.Columns["Id"]
        };


        dtWait.Merge(dtApproved);
        dtWait.Merge(dtReject);


        DataTable dtFinal = new DataTable();

        DataRow drFinalRow;

        dtFinal.Columns.Add("SlNo", typeof(int));
        dtFinal.Columns["SlNo"].AutoIncrement     = true;
        dtFinal.Columns["SlNo"].AutoIncrementSeed = 1;
        dtFinal.Columns.Add("Id", typeof(string));
        dtFinal.Columns.Add("Name", typeof(string));
        dtFinal.Columns.Add("Wait", typeof(string));
        dtFinal.Columns.Add("Approved", typeof(string));
        dtFinal.Columns.Add("Reject", typeof(string));

        // dtFinal = dtWait.Copy();

        for (int j = 0; j < dtWait.Rows.Count; j++)
        {
            drFinalRow             = dtFinal.NewRow();
            drFinalRow["Id"]       = Convert.ToString(dtWait.Rows[j]["Id"]);
            drFinalRow["Name"]     = Convert.ToString(dtWait.Rows[j]["Name"]);
            drFinalRow["Wait"]     = dtWait.Rows[j]["Wait"].ToString();
            drFinalRow["Approved"] = dtWait.Rows[j]["Approved"].ToString();

            drFinalRow["Reject"] = dtWait.Rows[j]["Reject"].ToString();
            dtFinal.Rows.Add(drFinalRow);
        }
        if (dtFinal.Rows.Count > 0)
        {
            rptLink.Visible    = true;
            rptLink.DataSource = dtFinal;
            rptLink.DataBind();
            foreach (RepeaterItem rpt in rptLink.Items)
            {
                //HtmlControl sp = rpt.FindControl("spApproved");
                HtmlGenericControl spWait     = (HtmlGenericControl)rpt.FindControl("spWait");
                HtmlGenericControl spWaitView = (HtmlGenericControl)rpt.FindControl("spWaitView");

                HtmlGenericControl spApproved     = (HtmlGenericControl)rpt.FindControl("spApproved");
                HtmlGenericControl spApprovedView = (HtmlGenericControl)rpt.FindControl("spApprovedView");

                HtmlGenericControl spReject     = (HtmlGenericControl)rpt.FindControl("spReject");
                HtmlGenericControl spRejectView = (HtmlGenericControl)rpt.FindControl("spRejectView");


                if (spWait.InnerHtml.ToString().Trim() == "")
                {
                    spWaitView.InnerHtml = "";
                }
                if (spApproved.InnerHtml.ToString().Trim() == "")
                {
                    spApprovedView.InnerHtml = "";
                }
                if (spReject.InnerHtml.ToString().Trim() == "")
                {
                    spRejectView.InnerHtml = "";
                }
            }
        }
        else
        {
            strSQL = "SELECT  ROW_NUMBER() OVER(ORDER BY LinkExchange.WebSite_Master.Id) AS 'SlNo',LinkExchange.WebSite_Master.Id ," +
                     " LinkExchange.WebSite_Master.Name," +
                     " 0 as 'Wait',0 as 'Approved',0 as 'Reject'" +
                     " FROM " +
                     " LinkExchange.WebSite_Master" +
                     " WHERE  (LinkExchange.WebSite_Master.UserId = '" + UserId + "')";
            dtWait             = objdata.FillDataTable(strSQL, ref strError);
            rptLink.Visible    = true;
            rptLink.DataSource = dtWait;
            rptLink.DataBind();

            foreach (RepeaterItem rpt in rptLink.Items)
            {
                HtmlGenericControl spWait     = (HtmlGenericControl)rpt.FindControl("spWait");
                HtmlGenericControl spWaitView = (HtmlGenericControl)rpt.FindControl("spWaitView");

                HtmlGenericControl spApproved     = (HtmlGenericControl)rpt.FindControl("spApproved");
                HtmlGenericControl spApprovedView = (HtmlGenericControl)rpt.FindControl("spApprovedView");

                HtmlGenericControl spReject     = (HtmlGenericControl)rpt.FindControl("spReject");
                HtmlGenericControl spRejectView = (HtmlGenericControl)rpt.FindControl("spRejectView");


                if (spWait.InnerHtml.ToString().Trim() == "0")
                {
                    spWaitView.InnerHtml = "";
                }
                if (spApproved.InnerHtml.ToString().Trim() == "0")
                {
                    spApprovedView.InnerHtml = "";
                }
                if (spReject.InnerHtml.ToString().Trim() == "0")
                {
                    spRejectView.InnerHtml = "";
                }
            }
        }
    }
    protected void btnSearch_Click(object sender, EventArgs e)
    {
        if (ddlSubPage.SelectedValue != "")
        {
            lblSearch.Text = "";
            lblMsg.Text    = "";
            //string strSQL = "SELECT " +
            //             "LinkExchange.LinkExchangeMaster.Id AS [id], " +
            //             "LinkExchange.SubPage.SubPageName AS [subpagename], " +
            //             "LinkExchange.SubPage.LinkURL AS [linkurl], " +
            //             "LinkExchange.WebSite_Master.Name AS [sitename], " +
            //             "LinkExchange.WebSite_Master.SiteURL AS [siteurl], " +
            //             "LinkExchange.LinkExchangeMaster.HTMLcode AS [htmlcode], " +
            //             "LinkExchange.LinkExchangeMaster.OurAdId AS [adid], " +
            //             "LinkExchange.LinkExchangeMaster.email AS [email], " +
            //             "LinkExchange.LinkExchangeMaster.Reciprocal AS [reci], " +
            //             "LinkExchange.LinkExchangeMaster.Status AS [status] " +
            //             "FROM " +
            //             "LinkExchange.LinkExchangeMaster " +
            //             "INNER JOIN LinkExchange.SubPage ON (LinkExchange.LinkExchangeMaster.SubPageID = LinkExchange.SubPage.Id) " +
            //             "INNER JOIN LinkExchange.WebSite_Master ON (LinkExchange.LinkExchangeMaster.WebSiteId = LinkExchange.WebSite_Master.ID) " +
            //             "WHERE " +
            //             "(LinkExchange.LinkExchangeMaster.HTMLCode LIKE '%" + txtSearchString.Value + "%') AND  (LinkExchange.LinkExchangeMaster.websiteid ='" + ddlSite.SelectedValue + "') AND LinkExchange.LinkExchangeMaster.SubPageID ='" + ddlSubPage.SelectedValue + "' AND " +
            //             "(LinkExchange.WebSite_Master.UserId = '" + Convert.ToString(Session["UserID"]) + "') " +
            //             " and LinkExchange.LinkExchangeMaster.pageid is null "+
            //             " ORDER BY " +
            //             "LinkExchange.LinkExchangeMaster.Status, " +
            //             "LinkExchange.LinkExchangeMaster.Type";
            string strSQL = "SELECT " +
                            "LinkExchange.LinkExchangeMaster.Id AS [id], " +
                            "LinkExchange.LinkExchangeMaster.HTMLcode AS [htmlcode], " +
                            "LinkExchange.LinkExchangeMaster.pageid , " +
                            "LinkExchange.LinkExchangeMaster.Reciprocal AS [reci], " +
                            "LinkExchange.LinkExchangeMaster.email AS [email] " +
                            "FROM " +
                            "LinkExchange.LinkExchangeMaster " +
                            //   "INNER JOIN LinkExchange.SubPage ON (LinkExchange.LinkExchangeMaster.SubPageID = LinkExchange.SubPage.Id) " +
                            "INNER JOIN LinkExchange.WebSite_Master ON (LinkExchange.LinkExchangeMaster.WebSiteId = LinkExchange.WebSite_Master.ID) " +
                            "WHERE " +
                            "(LinkExchange.LinkExchangeMaster.HTMLCode LIKE '%" + txtSearchString.Value + "%') AND  (LinkExchange.LinkExchangeMaster.websiteid ='" + ddlSite.SelectedValue + "') AND LinkExchange.LinkExchangeMaster.SubPageID ='" + ddlSubPage.SelectedValue + "' AND " +
                            "(LinkExchange.WebSite_Master.UserId = '" + Convert.ToString(Session["UserID"]) + "') " +
                            " and  LinkExchange.LinkExchangeMaster.Status=2 " +
                            //  " and LinkExchange.LinkExchangeMaster.pageid is null " +
                            " ORDER BY " +
                            "LinkExchange.LinkExchangeMaster.Status, " +
                            "LinkExchange.LinkExchangeMaster.Type";

            string strError = "";
            DataManipulationClass objdata = new DataManipulationClass();
            DataTable             dtGrid  = new DataTable();
            dtGrid = objdata.FillDataTable(strSQL, ref strError);
            if (dtGrid.Rows.Count > 0)
            {
                GridView1.Visible    = true;
                GridView1.DataSource = dtGrid;
                GridView1.DataBind();
            }
            else
            {
                lblSearch.Text    = "No Record found";
                GridView1.Visible = false;
            }
        }
        else
        {
            lblMsg.Text = "Please select SubPage ";
            ddlSubPage.Focus();
            return;
        }
    }
Beispiel #15
0
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        // var hdnMeasurementIds=document.getElementById("hdnMeasurementIds").value;

        //var strMeasurementIds =new Array();
        //var SelectedMeasurements="";
        //strMeasurementIds=hdnMeasurementIds.split('|');

        //for(var i=0;i<strMeasurementIds.length-1;i++)
        //{
        //    if(document.getElementById("CheckBox"+strMeasurementIds[i]).checked == true)
        //    {
        //       SelectedMeasurements+=document.getElementById("CheckBox"+strMeasurementIds[i]).value  + "|";
        //    }
        //}



        string[] strCityIds = hidCityIds.Value.Split(new char[] { ',' });

        string seletedcities = "";

        for (int i = 0; i < strCityIds.Length - 1; i++)
        {
            if (Request.Form.Get("chkCity" + strCityIds[i]) != null)
            {
                seletedcities += Request.Form.Get("chkCity" + strCityIds[i]) + "|";
            }
        }
        string[] strcity = seletedcities.Split(new char[] { '|' });
        int      cityid  = 0;

        if (strcity.Length > 0)
        {
            cityid = Convert.ToInt32(strcity[0]);
        }

        string[] strSubService = hidSubServId.Value.Split(new char[] { ',' });

        string seletedSubService = "";

        for (int i = 0; i < strSubService.Length - 1; i++)
        {
            if (Request.Form.Get("chkSubServ" + strSubService[i]) != null)
            {
                seletedSubService += Request.Form.Get("chkSubServ" + strSubService[i]) + "|";
            }
        }


        //foreach (DataListItem dl in rptCity.Items)
        //{
        //    for (int i = 1; i < strCityIds.Length - 1; i++)
        //    {
        //        CheckBox cbcity = (CheckBox)dl.FindControl("chkCity" + strCityIds[i]);
        //        if (cbcity.Checked == true)
        //        {
        //            seletedcities += cbcity.Text;
        //        }
        //    }
        //}

        string strError = "";

        Session["login_id"]   = 1;
        Session["package_id"] = 18;
        string order_id = "-";
        DataManipulationClass objDataM = new DataManipulationClass();

        if (!objDataM.Add_Package_CitySelection(seletedSubService, cityid, Convert.ToInt32(Session["login_id"]), Convert.ToInt32(Session["package_id"]), order_id, ref strError))
        {
            //lblMsg.Text = strError;
        }
        else
        {
            //lblMsg.Text = "Relation added Successfully";
            Response.Redirect("EditExpertProfile.aspx");
        }
    }
Beispiel #16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Convert.ToString(Session["UserId"]) == null)
        {
            Response.Redirect("Default.aspx");
        }
        else
        {
            if (!IsPostBack)
            {
                string SubPageId = "";
                string SiteId    = "";
                DataManipulationClass objdata      = new DataManipulationClass();
                DataTable             dtLinkDetail = new DataTable();
                string strPagination = "";
                string strError      = "";
                int    intPageNo     = 1;
                string Status        = "";
                int    intTotalProd  = 0;
                if (Request.QueryString["SiteId"] != null && Request.QueryString["Status"] != null)
                {
                    Status = Convert.ToString(Request.QueryString["Status"]);
                    string    strCurrentSubPageName = "";
                    ArrayList arrExistProd          = new ArrayList();
                    if (Request.QueryString["pageno"] != null)
                    {
                        intPageNo = Convert.ToInt32(Request.QueryString["pageno"]);
                    }

                    if (objdata.FetchLinkDetailsViewData(ref dtLinkDetail, Convert.ToString(Request.QueryString["SiteId"]), Convert.ToString(Request.QueryString["SubPageId"]), Request.QueryString["Status"], ref intTotalProd, intPageNo, 25, ref strPagination, ref strError))
                    {
                        rptLinkDetail.Visible    = true;
                        rptLinkDetail.DataSource = dtLinkDetail;
                        rptLinkDetail.DataBind();

                        foreach (RepeaterItem rpt in rptLinkDetail.Items)
                        {
                            HtmlImage          btnSendMail   = (HtmlImage)rpt.FindControl("btnSendMail");
                            HtmlGenericControl spReject      = (HtmlGenericControl)rpt.FindControl("spReject");
                            HtmlGenericControl spApproved    = (HtmlGenericControl)rpt.FindControl("spApproved");
                            HtmlGenericControl spViewOurLink = (HtmlGenericControl)rpt.FindControl("spViewOurLink");
                            HtmlGenericControl hdReciprocal  = (HtmlGenericControl)rpt.FindControl("hdReciprocal");
                            //if (hdReciprocal.InnerHtml.ToString().Trim() != "")
                            //{
                            //    spViewOurLink.InnerHtml = "<a href=" + hdReciprocal.InnerHtml + " target=\"_blank\">Our Link</a>";
                            //}
                            //else
                            //{
                            //}
                            Literal lit_SlNo = (Literal)rpt.FindControl("lit_SlNo");
                            if (Status == "2")
                            {
                                //btnApproved.Visible = false;
                                spApproved.Visible = false;
                            }
                            if (Status == "3")
                            {
                                //btnApproved.Visible = false;
                                spApproved.Visible = false;
                                spReject.Visible   = false;
                            }
                            HtmlGenericControl spSubPageName = (HtmlGenericControl)rpt.FindControl("spSubPageName");
                            //  strCurrentSubPageName = Convert.ToString(drCat["SubPageName"].ToString());
                            strCurrentSubPageName = spSubPageName.InnerHtml.ToString().Trim();
                            if (!arrExistProd.Contains(strCurrentSubPageName))
                            {
                                spSubPageName.InnerHtml = strCurrentSubPageName;
                                arrExistProd.Add(strCurrentSubPageName);
                            }
                            else
                            {
                                spSubPageName.InnerHtml = "";
                            }
                        }

                        lblPage.Text = strPagination;
                    }

                    hdSiteId.Value    = Convert.ToString(Request.QueryString["SiteId"]);
                    hdStatus.Value    = Convert.ToString(Request.QueryString["Status"]);
                    hdPagecount.Value = Convert.ToString(intTotalProd);
                    hdFrom.Value      = Convert.ToString(((intPageNo - 1) * 25) + 1);
                    hdTo.Value        = Convert.ToString(intPageNo * 25);
                    lblSiteName.Text  = objdata.getSiteName(Convert.ToString(Request.QueryString["SiteId"]));
                    this.Page.ClientScript.RegisterStartupScript(this.GetType(), "alert1", "<script>document.getElementById(\"dvRpt\").style.display=\"block\"</script>");
                    this.Page.ClientScript.RegisterStartupScript(this.GetType(), "alert2", "<script>document.getElementById(\"dvSubPageWise\").style.display=\"none\"</script>");
                }
                else if (Request.QueryString["SubPageId"] != null && Request.QueryString["Status"] != null)
                {
                    if (Request.QueryString["pageno"] != null)
                    {
                        intPageNo = Convert.ToInt32(Request.QueryString["pageno"]);
                    }


                    if (objdata.FetchLinkDetailsViewData(ref dtLinkDetail, Convert.ToString(Request.QueryString["SiteId"]), Convert.ToString(Request.QueryString["SubPageId"]), Request.QueryString["Status"], ref intTotalProd, intPageNo, 25, ref strPagination, ref strError))
                    {
                        if (dtLinkDetail.Rows.Count > 0)
                        {
                            rptSubPageWise.Visible = true;
                            //  dtLinkDetail = getSerialNumberToDataTable(dtLinkDetail, intInner);
                            rptSubPageWise.DataSource = dtLinkDetail;
                            rptSubPageWise.DataBind();

                            foreach (RepeaterItem rpt in rptSubPageWise.Items)
                            {
                                HtmlImage          btnSendMail = (HtmlImage)rpt.FindControl("btnSendMail");
                                HtmlGenericControl spReject    = (HtmlGenericControl)rpt.FindControl("spReject");
                                HtmlGenericControl spApproved  = (HtmlGenericControl)rpt.FindControl("spApproved");

                                HtmlGenericControl spViewOurLink = (HtmlGenericControl)rpt.FindControl("spViewOurLink");
                                HtmlGenericControl hdReciprocal  = (HtmlGenericControl)rpt.FindControl("hdReciprocal");

                                //if (hdReciprocal.InnerHtml.ToString().Trim() != "")
                                //{
                                //    spViewOurLink.InnerHtml = "<a href=" + hdReciprocal.InnerHtml + " target=\"_blank\">Our Link</a>";
                                //}
                                //else
                                //{
                                //}
                                if (Status == "2")
                                {
                                    spApproved.Visible = false;
                                }
                                if (Status == "3")
                                {
                                    spApproved.Visible = false;
                                    spReject.Visible   = false;
                                }
                            }
                        }
                        else
                        {
                            rptSubPageWise.Visible = false;
                        }

                        lblPageSubPageWise.Text = strPagination;
                    }
                    hdSubPageId.Value = Convert.ToString(Request.QueryString["SubPageId"]);
                    hdStatus.Value    = Convert.ToString(Request.QueryString["Status"]);
                    hdPagecount.Value = Convert.ToString(intTotalProd);
                    hdFrom.Value      = Convert.ToString(((intPageNo - 1) * 25) + 1);
                    hdTo.Value        = Convert.ToString(intPageNo * 25);

                    this.Page.ClientScript.RegisterStartupScript(this.GetType(), "alert1", "<script>document.getElementById(\"dvRpt\").style.display=\"none\"</script>");
                    this.Page.ClientScript.RegisterStartupScript(this.GetType(), "alert2", "<script>document.getElementById(\"dvSubPageWise\").style.display=\"block\"</script>");
                    lblSiteName.Text = objdata.getSubPageName(Convert.ToString(Request.QueryString["SubPageId"]));
                }
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            populateStateddl();
            Response.Write("Visiotrnmber:" + Convert.ToString(Application["activeVisitors"]));
        }
        string strErr   = "";
        Login  objlogin = new Login();

        objlogin.username = "******";
        objlogin.Address2 = "bb";
        DataManipulationClass objdata = new DataManipulationClass();

        objdata.AddExpert(objlogin, ref strErr);

        ArrayList MyList = new ArrayList();

        MyList.Add(1);
        MyList.Add(2);
        MyList.Add(3);
        MyList.Add(4);
        MyList.Add(5);
        // Create an iEnumerator object
        IEnumerator iEnum = MyList.GetEnumerator();

        // Loop through the data using the iEnumerator
        while (iEnum.MoveNext())
        {
            Response.Write((iEnum.Current.ToString()) + "<br>");
        }



        List <User> users = new List <User>();

        for (int x = 0; x < 5; x++)
        {
            User user = new User();
            user.Name = "Rob" + x;
            user.Age  = x;
            users.Add(user);
        }

        //foreach (User user in users)
        //{
        //    Response.Write(System.String.Format("{0}:{1}", user.Name, user.Age)+"<br>");
        //}
        Response.Write("<br>");
        //  System.Console.ReadLine();

        //for (int x = 0; x < users.Count; x++)
        //{
        //    Response.Write(System.String.Format("{0}:{1}", users[x].Name, users[x].Age));
        //}



        IEnumerator <User> ie = users.GetEnumerator();

        // Loop through the data using the iEnumerator
        while (ie.MoveNext())
        {
            Response.Write(ie.Current.Name.ToString() + ":" + ie.Current.Age.ToString() + "<br>");
        }



        //        List lst = new List();
        //lst.add("Abhishek");
        //lst.add("Abhijit");
        //lst.add("Manimoy");
        //lst.Add("Raj");
        //lst.Add("Ayan");
        //foreach(string x in lst){
        //if(x.length >5)
        //yeild return x;


        //    }
    }