コード例 #1
0
    public void BindStateList()
    {
        DataSet dsStateMasterList = CStateMasterServices.BindgvStateList();

        gvstateList.DataSource = dsStateMasterList;
        gvstateList.DataBind();
    }
コード例 #2
0
    protected void ButInsert_Click(object sender, EventArgs e)
    {
        int intReturnValue = CStateMasterServices.StateInsert(Convert.ToInt32(TxtStateId.Text), TxtStatename.Text);

        if (intReturnValue > 0)
        {
            Lblmsg.Text = "State Insert";
            BindStateList();
            TxtStateId.Text   = "";
            TxtStatename.Text = "";
        }
    }
コード例 #3
0
    protected void ButUpdate_Click(object sender, EventArgs e)
    {
        ButInsert.Visible  = false;
        ButCancle.Visible  = true;
        TblAddEdit.Visible = false;


        int intReturnValue = CStateMasterServices.StateUpdate(Convert.ToInt32(TxtStateId.Text), TxtStatename.Text);

        if (intReturnValue > 0)
        {
            Lblmsg.Text = "State Update";
            BindStateList();
            TxtStateId.Text   = "";
            TxtStatename.Text = "";
        }
    }
コード例 #4
0
    protected void gvstateList_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        int          intStateId = Convert.ToInt32(gvstateList.DataKeys[e.RowIndex].Value);
        CStateMaster ObjState   = new CStateMaster(intStateId);

        if (ObjState.IdExit == true)
        {
            TxtStateId.Text   = ObjState.StateId.ToString();
            TxtStatename.Text = ObjState.Statename.ToString();
        }

        int intReturnValue = CStateMasterServices.StateDelete(Convert.ToInt32(TxtStateId.Text));

        if (intReturnValue > 0)
        {
            Lblmsg.Text = "State Delete";
            BindStateList();
            TxtStateId.Text   = "";
            TxtStatename.Text = "";
        }
    }