示例#1
0
    public void BindgvCity()
    {
        DataSet dsCityMasterList = CCityMasterServices.CityMasterList();

        gvcity.DataSource = dsCityMasterList;
        gvcity.DataBind();
    }
示例#2
0
    public void BindState()
    {
        DataSet dsStateMasterList = CCityMasterServices.BindStateMasterList();

        DropSate.DataSource     = dsStateMasterList;
        DropSate.DataTextField  = "Statename";
        DropSate.DataValueField = "StateId";
        DropSate.DataBind();
    }
示例#3
0
    public void BindCity()
    {
        DataSet dsCityMasterList = CCityMasterServices.CityMasterList();

        DropCity.DataSource     = dsCityMasterList;
        DropCity.DataTextField  = "Cityname";
        DropCity.DataValueField = "CityId";
        DropCity.DataBind();
    }
示例#4
0
    protected void ButUpdate_Click(object sender, EventArgs e)
    {
        int intReturnValues = CCityMasterServices.CityMasterUpdate(Convert.ToInt32(TxtCityId.Text), TxtCityname.Text, Convert.ToInt32(DropSate.SelectedValue));

        if (intReturnValues > 0)
        {
            Lblmsg.Text = "City UpDate";
            BindgvCity();
            TxtCityId.Text     = "";
            TxtCityname.Text   = "";
            TblAddEdit.Visible = false;
        }
    }
示例#5
0
    protected void gvcity_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        int intCityId = Convert.ToInt32(gvcity.DataKeys[e.RowIndex].Value);

        CCityMaster ObjCity = new CCityMaster(intCityId);

        if (ObjCity.IsExit == true)
        {
            Lblmsg.Text            = "";
            TxtCityId.Text         = ObjCity.CityId.ToString();
            TxtCityname.Text       = ObjCity.Cityname.ToString();
            DropSate.SelectedValue = ObjCity.StateId.ToString();
        }

        int intReturnValues = CCityMasterServices.CityMasterDelete(Convert.ToInt32(TxtCityId.Text));

        if (intReturnValues > 0)
        {
            Lblmsg.Text = "City Delete";
            BindgvCity();
            TxtCityId.Text   = "";
            TxtCityname.Text = "";
        }
    }