Ejemplo n.º 1
0
        //protected void Textbox1_TextChanged(object sender, EventArgs e)
        //{
        //    Int32 val1 = Convert.ToInt32(Textbox_rtsqft.Text);
        //    Int32 val2 = Convert.ToInt32(Textbox_totsqft.Text);
        //    Int32 val3 = val1 * val2;
        //    Textbox_totrate.Text = val3.ToString();
        //}



        //protected void PropertyState_SelectedIndexChanged(object sender, EventArgs e)
        //{

        //}

        protected void PropertyCity_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                Int64          CityId = Convert.ToInt64(PropertyCity.SelectedValue.ToString() == "" ? "0" : PropertyCity.SelectedValue.ToString());
                SqlDataAdapter da     = new SqlDataAdapter();
                SqlCommand     cmd    = new SqlCommand("SP_Area", cn);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@Mode", "SelectAreaByCityId");
                cmd.Parameters.AddWithValue("@CityId", CityId);
                da.SelectCommand = cmd;
                da.Fill(ds);
                if (ds.Tables.Count > 0)
                {
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        PropertyArea.DataTextField  = "AreaTitle";
                        PropertyArea.DataValueField = "AreaId";
                        PropertyArea.DataSource     = ds;
                        PropertyArea.DataBind();
                        PropertyArea.Items.Insert(0, new ListItem("---Select Area---"));
                    }
                    else
                    {
                        PropertyArea.DataSource = null;
                        PropertyArea.DataBind();
                        PropertyArea.Items.Insert(0, new ListItem("---Select Area---"));
                    }
                }
                else
                {
                    PropertyArea.DataSource = null;
                    PropertyArea.DataBind();
                    PropertyArea.Items.Insert(0, new ListItem("---Select Area---"));
                }
            }
            catch (Exception e2)
            {
                Response.Write("Error occured : " + e2.Message.ToString());
            }
        }
Ejemplo n.º 2
0
        private void PropertyAreaBind()
        {
            try
            {
                ds = objInteraction.AreaSelectAll();
                if (ds.Tables.Count > 0)
                {
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        PropertyArea.DataTextField  = "AreaTitle";
                        PropertyArea.DataValueField = "AreaId";
                        PropertyArea.DataSource     = ds.Tables[0];
                        PropertyArea.DataBind();
                        PropertyArea.Items.Insert(0, new ListItem("---Select Area---"));
                    }
                    else
                    {
                        PropertyArea.DataSource = null;
                        PropertyArea.DataBind();
                        PropertyArea.Items.Insert(0, new ListItem("---Select Area---"));
                    }
                }

                else
                {
                    PropertyArea.DataSource = null;
                    PropertyArea.DataBind();
                    PropertyArea.Items.Insert(0, new ListItem("---Select Area---"));
                }
            }


            catch (Exception ex)
            {
            }
        }