Esempio n. 1
0
    protected void XmlHttpPanel_ServiceRequest(object sender, RadXmlHttpPanelEventArgs e)
    {
        string    val       = e.Value;
        string    getfrndet = @"SELECT   [User].ID,  [User].Email, [User].Name, [User].Country, [User].College, [User].Relationship, [User].BirthDate, [User].School, [User].Company, [User].Gender, [User].City, 
                      [User].Designation, [User].Degree, [User].uname, [User].RegisterDate, [User].Status, Propic.Image, Contact.Website, Networks.Linkedin, Networks.Facebook, 
                      Networks.Twitter, Networks.Plus
FROM         [User] INNER JOIN
                      Propic ON [User].ID = Propic.UID INNER JOIN
                      Contact ON [User].ID = Contact.UID INNER JOIN
                      Networks ON [User].ID = Networks.UID
WHERE     ([User].ID = " + val + ") AND (Propic.[Current] = 1)";
        DataTable table     = new DataTable();

        table = profile.ReturnDT(getfrndet);

        this.Repeater2.DataSource = table;
        this.Repeater2.DataBind();
    }
 protected void copyAddendumXmlHttpPanel_ServiceRequest(object sender, RadXmlHttpPanelEventArgs e)
 {
     int newAddendumID = Base.Classes.Addendum.CopyAddendum(Convert.ToInt32(e.Value));
     if (newAddendumID == 0)
     {
         throw new Exception("Unable to copy Addendum");
     }
 }
Esempio n. 3
0
    protected void XmlHttpPanel_ServiceRequest(object sender, RadXmlHttpPanelEventArgs e)
    {
        string val = e.Value;
        string getfrndet = @"SELECT   [User].ID,  [User].Email, [User].Name, [User].Country, [User].College, [User].Relationship, [User].BirthDate, [User].School, [User].Company, [User].Gender, [User].City, 
                      [User].Designation, [User].Degree, [User].uname, [User].RegisterDate, [User].Status, Propic.Image, Contact.Website, Networks.Linkedin, Networks.Facebook, 
                      Networks.Twitter, Networks.Plus
FROM         [User] INNER JOIN
                      Propic ON [User].ID = Propic.UID INNER JOIN
                      Contact ON [User].ID = Contact.UID INNER JOIN
                      Networks ON [User].ID = Networks.UID
WHERE     ([User].ID = " + val + ") AND (Propic.[Current] = 1)";
        DataTable table = new DataTable();
        table = profile.ReturnDT(getfrndet);
        
            this.Repeater2.DataSource = table;
            this.Repeater2.DataBind();
        
    }
Esempio n. 4
0
    protected void XmlHttpPanel_ServiceRequest(object sender, RadXmlHttpPanelEventArgs e)
    {
        Session["LoadingUserValue"] = e.Value;
        string val = e.Value;
        string myid = Session["UserId"].ToString();

        string getstatus = @"SELECT     MyID, FriendID, FriendStatus
FROM         Friends
WHERE     (MyID = " + myid + @") AND (FriendID = " + val + @") OR
                      (MyID = " + val + @") AND (FriendID = " + myid + @")";
        DataTable dt2 = new DataTable();
        dt2 = profile.ReturnDT(getstatus);

        DataTable dt3 = new DataTable();
        string getboxstat = @"SELECT     MyID, SID, FollowDate, FollowStatus
FROM         Box
WHERE     (MyID = " + myid + ") AND (SID = " + val + ")";
        dt3 = profile.ReturnDT(getboxstat);


         if (dt2.Rows.Count > 0)
        {
            int n = (int)dt2.Rows[0]["FriendStatus"];
            string ida = dt2.Rows[0]["MyID"].ToString();
            string idb = dt2.Rows[0]["FriendID"].ToString();
            switch (n)
            {
                case 0:
                    if (ida == Session["UserId"].ToString())
                    {
                        addasfrnd.Visible = true;
                        addasfrnd.Text = "cancel connect request";
                        Session["friend"] = "ccr";
                        
                        // i sent the request , i can cancel it
                      
                        if (dt3.Rows.Count > 0)
                        {
                            addbox.Visible = true;
                            addbox.Text = "remove from box";
                            Session["box"] = "rfb";
                            //added to box .. remove from box 
                        }
                       
                    }
                    else
                    {
                        addasfrnd.Visible = true;
                        addasfrnd.Text = "accept connect request";
                        Session["friend"] = "acr";
                        // i have the request i can accecpt it
                        if (dt3.Rows.Count > 0)
                        {
                            addbox.Visible = true;
                            addbox.Text = "remove from box";
                            Session["box"] = "rfb";
                            //added to box .. remove from box 
                        }
                        
                    }
                    break;
                case 1:
                    // he is a friend


                    addasfrnd.Visible = true;
                    addasfrnd.Text = "in your connections";
                    addbox.Visible = false;
                    if (dt3.Rows.Count > 0)
                    {
                        addbox.Visible = true;
                        addbox.Text = "remove from box";
                        Session["box"] = "rfb";
                        //added to box .. remove from box 
                    }
                    break;


            }
         
           
            
        }
        else
        {
            if (dt3.Rows.Count > 0)
            {
                addbox.Visible = true;
                addbox.Text = "remove from box";
                Session["box"] = "rfb";
                //added to box .. remove from box 
            }
            addasfrnd.Visible = true;
            addasfrnd.Text = "ask to connect";
            Session["friend"] = "atc";
        // he is random
           
           
        }



         string getfrndet = @"SELECT     [User].ID, [User].[uname], [User].Name, [User].Country, [User].Relationship, [User].BirthDate, [User].Gender, [User].City, Propic.Image, [User].College, [User].School, [User].Company, 
                      [User].[looking for]
FROM         [User] INNER JOIN
                      Propic ON [User].ID = Propic.UID
WHERE     ([User].ID = " + val + ") AND (Propic.[Current] = 1)";
        DataTable table = new DataTable();
        table = profile.ReturnDT(getfrndet);
        Name.Text = table.Rows[0]["Name"].ToString();
        uname.Text = "<a href='profile.aspx?uname="+table.Rows[0]["uname"].ToString()+"'> @ "+ table.Rows[0]["uname"].ToString() + "</a>";
        if (table.Rows[0]["Image"] is DBNull == false)
        {
            RadBinaryImage rbg = new RadBinaryImage();
            rbg.ResizeMode = BinaryImageResizeMode.Crop;
            rbg.Height = 230;
            rbg.Width = 177;
            rbg.DataValue = (byte[])table.Rows[0]["Image"];
            rbg.CssClass = "sidemeyaaar";
            propic.Controls.Add(rbg);
        }
        if (table.Rows[0]["College"] is DBNull == false)
        {
            Label lbl = new Label();
            Label lbl2 = new Label();
            lbl.Text = "college :";
            lbl2.Text = table.Rows[0]["College"].ToString();

            addcontrols.Controls.Add(lbl);
            addcontrols.Controls.Add(lbl2);
        }
        if (table.Rows[0]["School"] is DBNull == false)
        {
            Label lbl = new Label();
            Label lbl2 = new Label();
            lbl.Text = "<br> school :";
            lbl2.Text = table.Rows[0]["School"].ToString();

            addcontrols.Controls.Add(lbl);
            addcontrols.Controls.Add(lbl2);
        }
        if (table.Rows[0]["Company"] is DBNull == false)
        {
            Label lbl = new Label();
            Label lbl2 = new Label();
            lbl.Text = "<br> works at :";
            lbl2.Text = table.Rows[0]["Company"].ToString();

            addcontrols.Controls.Add(lbl);
            addcontrols.Controls.Add(lbl2);
        }
        if (table.Rows[0]["BirthDate"] is DBNull == false)
        {
            Label lbl = new Label();
            Label lbl2 = new Label();
            lbl.Text = "<br> born on :";
            lbl2.Text = table.Rows[0]["BirthDate"].ToString();

            addcontrols.Controls.Add(lbl);
            addcontrols.Controls.Add(lbl2);
        }
        if (table.Rows[0]["Gender"] is DBNull == false)
        {
            Label lbl = new Label();
            Label lbl2 = new Label();
            lbl.Text = "<br> gender :";
            lbl2.Text = table.Rows[0]["Gender"].ToString();

            addcontrols.Controls.Add(lbl);
            addcontrols.Controls.Add(lbl2);
        }
        if (table.Rows[0]["Country"] is DBNull == false)
        {
            Label lbl = new Label();
            Label lbl2 = new Label();
            lbl.Text = "<br>" + "lives in &nbsp; :";
            lbl2.Text = table.Rows[0]["City"].ToString() +  table.Rows[0]["Country"].ToString();

            addcontrols.Controls.Add(lbl);
            addcontrols.Controls.Add(lbl2);
        }
        if (table.Rows[0]["Relationship"] is DBNull == false)
        {
            Label lbl = new Label();
            Label lbl2 = new Label();
            lbl.Text = "<br>" + "relationship :";
            lbl2.Text = table.Rows[0]["Relationship"].ToString();

            addcontrols.Controls.Add(lbl);
            addcontrols.Controls.Add(lbl2);
        }
        if (table.Rows[0]["looking for"] is DBNull == false)
        {
            Label lbl = new Label();
            Label lbl2 = new Label();
            lbl.Text = "<br>" + "looking for :";
            lbl2.Text = table.Rows[0]["looking for"].ToString();

            addcontrols.Controls.Add(lbl);
            addcontrols.Controls.Add(lbl2);
        }


    }
Esempio n. 5
0
 protected void deleteStaffXmlHttpPanel_ServiceRequest(object sender, RadXmlHttpPanelEventArgs e)
 {
     try
     {
         Base.Classes.Staff.DeleteStaff(e.Value);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Esempio n. 6
0
 public void XmlHttp_Request(object sender, RadXmlHttpPanelEventArgs e)
 {
     XmlHttpPanel.Controls.Add(new LiteralControl(taskProgress.ToString()));
 }
Esempio n. 7
0
    protected void XmlHttpPanel_ServiceRequest(object sender, RadXmlHttpPanelEventArgs e)
    {
        Session["LoadingUserValue"] = e.Value;
        string val  = e.Value;
        string myid = Session["UserId"].ToString();

        string    getstatus = @"SELECT     MyID, FriendID, FriendStatus
FROM         Friends
WHERE     (MyID = " + myid + @") AND (FriendID = " + val + @") OR
                      (MyID = " + val + @") AND (FriendID = " + myid + @")";
        DataTable dt2       = new DataTable();

        dt2 = profile.ReturnDT(getstatus);

        DataTable dt3        = new DataTable();
        string    getboxstat = @"SELECT     MyID, SID, FollowDate, FollowStatus
FROM         Box
WHERE     (MyID = " + myid + ") AND (SID = " + val + ")";

        dt3 = profile.ReturnDT(getboxstat);


        if (dt2.Rows.Count > 0)
        {
            int    n   = (int)dt2.Rows[0]["FriendStatus"];
            string ida = dt2.Rows[0]["MyID"].ToString();
            string idb = dt2.Rows[0]["FriendID"].ToString();
            switch (n)
            {
            case 0:
                if (ida == Session["UserId"].ToString())
                {
                    addasfrnd.Visible = true;
                    addasfrnd.Text    = "cancel connect request";
                    Session["friend"] = "ccr";

                    // i sent the request , i can cancel it

                    if (dt3.Rows.Count > 0)
                    {
                        addbox.Visible = true;
                        addbox.Text    = "remove from box";
                        Session["box"] = "rfb";
                        //added to box .. remove from box
                    }
                }
                else
                {
                    addasfrnd.Visible = true;
                    addasfrnd.Text    = "accept connect request";
                    Session["friend"] = "acr";
                    // i have the request i can accecpt it
                    if (dt3.Rows.Count > 0)
                    {
                        addbox.Visible = true;
                        addbox.Text    = "remove from box";
                        Session["box"] = "rfb";
                        //added to box .. remove from box
                    }
                }
                break;

            case 1:
                // he is a friend


                addasfrnd.Visible = true;
                addasfrnd.Text    = "in your connections";
                addbox.Visible    = false;
                if (dt3.Rows.Count > 0)
                {
                    addbox.Visible = true;
                    addbox.Text    = "remove from box";
                    Session["box"] = "rfb";
                    //added to box .. remove from box
                }
                break;
            }
        }
        else
        {
            if (dt3.Rows.Count > 0)
            {
                addbox.Visible = true;
                addbox.Text    = "remove from box";
                Session["box"] = "rfb";
                //added to box .. remove from box
            }
            addasfrnd.Visible = true;
            addasfrnd.Text    = "ask to connect";
            Session["friend"] = "atc";
            // he is random
        }



        string    getfrndet = @"SELECT     [User].ID, [User].[uname], [User].Name, [User].Country, [User].Relationship, [User].BirthDate, [User].Gender, [User].City, Propic.Image, [User].College, [User].School, [User].Company, 
                      [User].[looking for]
FROM         [User] INNER JOIN
                      Propic ON [User].ID = Propic.UID
WHERE     ([User].ID = " + val + ") AND (Propic.[Current] = 1)";
        DataTable table     = new DataTable();

        table      = profile.ReturnDT(getfrndet);
        Name.Text  = table.Rows[0]["Name"].ToString();
        uname.Text = "<a href='profile.aspx?uname=" + table.Rows[0]["uname"].ToString() + "'> @ " + table.Rows[0]["uname"].ToString() + "</a>";
        if (table.Rows[0]["Image"] is DBNull == false)
        {
            RadBinaryImage rbg = new RadBinaryImage();
            rbg.ResizeMode = BinaryImageResizeMode.Crop;
            rbg.Height     = 230;
            rbg.Width      = 177;
            rbg.DataValue  = (byte[])table.Rows[0]["Image"];
            rbg.CssClass   = "sidemeyaaar";
            propic.Controls.Add(rbg);
        }
        if (table.Rows[0]["College"] is DBNull == false)
        {
            Label lbl  = new Label();
            Label lbl2 = new Label();
            lbl.Text  = "college :";
            lbl2.Text = table.Rows[0]["College"].ToString();

            addcontrols.Controls.Add(lbl);
            addcontrols.Controls.Add(lbl2);
        }
        if (table.Rows[0]["School"] is DBNull == false)
        {
            Label lbl  = new Label();
            Label lbl2 = new Label();
            lbl.Text  = "<br> school :";
            lbl2.Text = table.Rows[0]["School"].ToString();

            addcontrols.Controls.Add(lbl);
            addcontrols.Controls.Add(lbl2);
        }
        if (table.Rows[0]["Company"] is DBNull == false)
        {
            Label lbl  = new Label();
            Label lbl2 = new Label();
            lbl.Text  = "<br> works at :";
            lbl2.Text = table.Rows[0]["Company"].ToString();

            addcontrols.Controls.Add(lbl);
            addcontrols.Controls.Add(lbl2);
        }
        if (table.Rows[0]["BirthDate"] is DBNull == false)
        {
            Label lbl  = new Label();
            Label lbl2 = new Label();
            lbl.Text  = "<br> born on :";
            lbl2.Text = table.Rows[0]["BirthDate"].ToString();

            addcontrols.Controls.Add(lbl);
            addcontrols.Controls.Add(lbl2);
        }
        if (table.Rows[0]["Gender"] is DBNull == false)
        {
            Label lbl  = new Label();
            Label lbl2 = new Label();
            lbl.Text  = "<br> gender :";
            lbl2.Text = table.Rows[0]["Gender"].ToString();

            addcontrols.Controls.Add(lbl);
            addcontrols.Controls.Add(lbl2);
        }
        if (table.Rows[0]["Country"] is DBNull == false)
        {
            Label lbl  = new Label();
            Label lbl2 = new Label();
            lbl.Text  = "<br>" + "lives in &nbsp; :";
            lbl2.Text = table.Rows[0]["City"].ToString() + table.Rows[0]["Country"].ToString();

            addcontrols.Controls.Add(lbl);
            addcontrols.Controls.Add(lbl2);
        }
        if (table.Rows[0]["Relationship"] is DBNull == false)
        {
            Label lbl  = new Label();
            Label lbl2 = new Label();
            lbl.Text  = "<br>" + "relationship :";
            lbl2.Text = table.Rows[0]["Relationship"].ToString();

            addcontrols.Controls.Add(lbl);
            addcontrols.Controls.Add(lbl2);
        }
        if (table.Rows[0]["looking for"] is DBNull == false)
        {
            Label lbl  = new Label();
            Label lbl2 = new Label();
            lbl.Text  = "<br>" + "looking for :";
            lbl2.Text = table.Rows[0]["looking for"].ToString();

            addcontrols.Controls.Add(lbl);
            addcontrols.Controls.Add(lbl2);
        }
    }
 protected void copyRubricXmlHttpPanel_ServiceRequest(object sender, RadXmlHttpPanelEventArgs e)
 {
     int newRubricID = Base.Classes.Rubric.CopyRubric(Convert.ToInt32(e.Value));
     if (newRubricID == 0)
     {
         throw new Exception("An error occured while copying the Rubric");
     }
 }