public void BindStateList() { DataSet dsStateMasterList = CStateMasterServices.BindgvStateList(); gvstateList.DataSource = dsStateMasterList; gvstateList.DataBind(); }
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 = ""; } }
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 = ""; } }
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 = ""; } }