Beispiel #1
0
 protected void Button8_Click(object sender, EventArgs e)
 {
     HDT = HAdapter.Select_BY_SNAME(drpsocietyy.SelectedItem.Text);
     GridView1.DataSource = HDT;
     GridView1.DataBind();
     lblmsg.Text = GridView1.Rows.Count + " - Record Found";
 }
Beispiel #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Page.IsPostBack == false)
        {
            UDT = UAdapter.Select_By_UID(Convert.ToInt32(Session["uid"].ToString()));
            HDT = HAdapter.Select_By_SNAME_BLOCKNO(UDT.Rows[0]["societyname"].ToString(), Convert.ToInt32(UDT.Rows[0]["Houseid"].ToString()));

            Image3.ImageUrl      = HDT.Rows[0]["image"].ToString();
            lblsname.Text        = HDT.Rows[0]["sname"].ToString();
            lblbno.Text          = HDT.Rows[0]["blockno"].ToString();
            lbltype.Text         = HDT.Rows[0]["type"].ToString();
            ViewState["HID"]     = HDT.Rows[0]["HID"].ToString();
            SellDT               = SellAdapter.Select_By_UID(Convert.ToInt32(Session["uid"].ToString()));
            GridView2.DataSource = SellDT;
            GridView2.DataBind();
            if (SellDT.Rows.Count == 1)
            {
                lblrent.Text = SellDT.Rows[0]["sell"].ToString();
            }
            else
            {
                lblrent.Text = "--";
            }
        }
    }
Beispiel #3
0
 protected void GridView1_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
 {
     GridView1.PageIndex = e.NewSelectedIndex;
     HDT = HAdapter.Select_BY_SNAME(drpsocietyy.SelectedItem.Text);
     GridView1.DataSource = HDT;
     GridView1.DataBind();
 }
    protected void drpsociety_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (drpsociety.SelectedIndex == 0)
        {
            lblhome.Text     = "";
            lblallocate.Text = "";
            lblrem.Text      = "";
        }
        else
        {
            SDT               = SAdapter.Select_By_SID(Convert.ToInt32(drpsociety.SelectedValue));
            lblhome.Text      = "Total House - " + SDT.Rows[0]["nohouse"].ToString();
            ViewState["home"] = SDT.Rows[0]["nohouse"].ToString();

            HDT = HAdapter.Select_BY_SNAME(drpsociety.SelectedItem.Text);
            if (HDT.Rows.Count == 0)
            {
                lblallocate.Text = "Allocated House - 0";
                lblrem.Text      = "Remaining House - " + SDT.Rows[0]["nohouse"].ToString();
            }
            else
            {
                int rem = Convert.ToInt32(SDT.Rows[0]["nohouse"].ToString()) - HDT.Rows.Count;
                lblrem.Text      = "Remaining House - " + rem.ToString();
                lblallocate.Text = "Allocated House - " + HDT.Rows.Count.ToString();
            }
        }
    }
    protected void btnadd_Click(object sender, EventArgs e)
    {
        if (Convert.ToInt32(txtblockname.Text) > Convert.ToInt32(ViewState["home"].ToString()))
        {
            lblmsg.Text      = "BlockNo must be less than total no of house";
            lblmsg.ForeColor = System.Drawing.Color.Red;
        }
        else
        {
            SDT = SAdapter.Select_By_SID(Convert.ToInt32(drpsociety.SelectedValue));

            HAdapter.Insert(Convert.ToInt32(txtblockname.Text), drptype.SelectedItem.Text, txtdetai.Text, drpsociety.SelectedItem.Text, SDT.Rows[0]["image"].ToString());
            lblmsg.Text           = "House Added Successfully";
            lblmsg.ForeColor      = System.Drawing.Color.Green;
            txtblockname.Text     = "";
            txtdetai.Text         = "";
            drptype.SelectedIndex = 0;


            SDT          = SAdapter.Select_By_SID(Convert.ToInt32(drpsociety.SelectedValue));
            lblhome.Text = "Total House - " + SDT.Rows[0]["nohouse"].ToString();

            HDT = HAdapter.Select_BY_SNAME(drpsociety.SelectedItem.Text);
            if (HDT.Rows.Count == 0)
            {
                lblallocate.Text = "Allocated House - 0"; lblrem.Text = "Remaining House - " + SDT.Rows[0]["nohouse"].ToString();
            }
            else
            {
                int rem = Convert.ToInt32(SDT.Rows[0]["nohouse"].ToString()) - HDT.Rows.Count;
                lblrem.Text      = "Remaining House - " + rem.ToString();
                lblallocate.Text = "Allocated House - " + HDT.Rows.Count.ToString();
            }
        }
    }
Beispiel #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Page.IsPostBack == false)
     {
         HDT = HAdapter.Select_BY_SNAME(Session["sname"].ToString());
         GridView1.DataSource = HDT;
         GridView1.DataBind();
         lblsname.Text = Session["sname"].ToString() + " - " + GridView1.Rows.Count;
     }
 }
    protected void drpsociety_SelectedIndexChanged(object sender, EventArgs e)
    {
        HDT = HAdapter.Seelct_By_SNAME_FOR_NEW_HOUSE(drpsociety.SelectedItem.Text);
        drpno.DataSource     = HDT;
        drpno.DataTextField  = "BlockNo";
        drpno.DataValueField = "HID";
        drpno.DataBind();

        drpno.Items.Insert(0, "SELECT");
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        lblsell.Text = "";
        UDT          = UAdapter.Select_By_UID(Convert.ToInt32(Session["uid"].ToString()));
        HDT          = HAdapter.Select_By_SNAME_BLOCKNO(UDT.Rows[0]["societyname"].ToString(), Convert.ToInt32(UDT.Rows[0]["Houseid"].ToString()));

        Image3.ImageUrl  = HDT.Rows[0]["image"].ToString();
        lblsname.Text    = HDT.Rows[0]["sname"].ToString();
        lblbno.Text      = HDT.Rows[0]["blockno"].ToString();
        lbltype.Text     = HDT.Rows[0]["type"].ToString();
        ViewState["HID"] = HDT.Rows[0]["HID"].ToString();
    }
Beispiel #9
0
 protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
 {
     UDT = UAdapter.Select_BY_HID(Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Value));
     if (UDT.Rows.Count > 0)
     {
         lblmsg.Text = "Please, Delete first member of this house";
     }
     else
     {
         HAdapter.Delete(Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Value));
         HDT = HAdapter.Select_BY_SNAME(drpsocietyy.SelectedItem.Text);
         GridView1.DataSource = HDT;
         GridView1.DataBind();
         lblmsg.Text = "House Deleted Successsfully";
     }
 }
Beispiel #10
0
    protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        SDT = SAdapter.Select_By_SID(Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Value));
        HDT = HAdapter.Select_BY_SNAME(SDT.Rows[0]["sname"].ToString());

        if (HDT.Rows.Count > 0)
        {
            lblmg.Text = "Please, delete first all houses of this society";
        }
        else
        {
            SAdapter.Delete(Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Value));
            SDT = SAdapter.Select_Society();

            GridView1.DataSource = SDT;
            GridView1.DataBind();
            lblmg.Text = "Society  Deleted";
        }
    }