Beispiel #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["New"] != null)
        {
            if (!IsPostBack)
            {
                WelcomeLabel.Text += Session["Email"].ToString();
                DataSet ds = client.GetFlatsLandlord(Session["Email"].ToString().Trim());
                GridViewAllFlats.DataSource = ds.Tables[0];

                GridViewAllFlats.DataBind();
                if (ds.Tables[0].Rows.Count == 0)
                {
                    LabelNoFlats.Visible = true;
                }
                else
                {
                    LabelNoFlats.Visible = false;
                }
            }
            for (int i = 0; i < GridViewAllFlats.Rows.Count; i++)
            {
                if ((GridViewAllFlats.Rows[i].Cells[2].Text.Trim() == "Closed") || (GridViewAllFlats.Rows[i].Cells[2].Text.Trim() == "Pending"))
                {
                    GridViewAllFlats.Rows[i].Cells[6].FindControl("ButtonSend").Visible = false;
                }
            }
        }
        else
        {
            Response.Redirect("Register.aspx");
        }
    }
Beispiel #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["New"] != null)
     {
         if (!IsPostBack)
         {
             WelcomeLabel.Text += Session["Email"].ToString();
             DataSet ds = client.GetConfirmedFlats(Session["Email"].ToString().Trim());
             GridViewAllFlats.DataSource = ds.Tables[0];
             GridViewAllFlats.DataBind();
         }
     }
     else
     {
         Response.Redirect("Register.aspx");
     }
 }
Beispiel #3
0
    protected void ButtonSearchFlats_Click(object sender, EventArgs e)
    {
        try
        {
            if (TextBoxMinDeposit.Text == "")
            {
                TextBoxMinDeposit.Text = "0";
            }
            if (TextBoxMaxDeposit.Text == "")
            {
                TextBoxMaxDeposit.Text = "50000";
            }
            if (TextBoxMinRent.Text == "")
            {
                TextBoxMinRent.Text = "0";
            }
            if (TextBoxMaxRent.Text == "")
            {
                TextBoxMaxRent.Text = "10000";
            }

            DataSet   ds = client.SearchFlats(TextBoxCity.Text.Trim(), Convert.ToInt32(TextBoxMinRent.Text), Convert.ToInt32(TextBoxMaxRent.Text), Convert.ToInt32(TextBoxMinDeposit.Text), Convert.ToInt32(TextBoxMaxDeposit.Text));
            DataTable dt = ds.Tables[0];

            GridViewAllFlats.DataSource = dt;
            GridViewAllFlats.DataBind();

            LabelFlats.Visible       = false;
            GridViewAllFlats.Visible = true;

            Tab1.Visible = true;
            Tab2.Visible = true;
            Tab3.Visible = true;
            ButtonVisibilityAll();
        }

        catch
        {
            LabelFlats.Visible       = true;
            GridViewAllFlats.Visible = false;
            Tab1.Visible             = false;
            Tab2.Visible             = false;
            Tab3.Visible             = false;
        }
    }
Beispiel #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["New"] != null)
     {
         if (!IsPostBack)
         {
             WelcomeLabel.Text += Session["Email"].ToString();
             DataSet ds = client.GetConfirmedFlats(Session["Email"].ToString().Trim());
             GridViewAllFlats.DataSource = ds.Tables[0];
             GridViewAllFlats.DataBind();
         }
     }
     else
     {
         WelcomeLabel.Visible = false;
         LogOut.Visible       = false;
     }
 }
Beispiel #5
0
    private void BindFlatsDataAll()
    {
        DataSet   ds  = client.GetAllFlats();
        DataTable dt2 = new DataTable();

        dt2.Columns.Add("Id");
        dt2.Columns.Add("LandlordEmail");
        dt2.Columns.Add("Type");
        dt2.Columns.Add("Address");
        dt2.Columns.Add("PostCode");
        dt2.Columns.Add("City");
        dt2.Columns.Add("Rent");
        dt2.Columns.Add("Deposit");
        dt2.Columns.Add("AvailableFrom");
        dt2.Columns.Add("DateOfCreation");
        dt2.Columns.Add("Description");
        dt2.Columns.Add("Status");
        dt2.Columns.Add("Date_of_offer");

        ds.Tables.Add(dt2);

        GridViewAllFlats.DataSource = ds.Tables[0];
        GridViewAllFlats.DataBind();
    }