protected void GvFabricList_RowDeleting(object sender, GridViewDeleteEventArgs e) { int intFabricId = Convert.ToInt32(GvFabricList.DataKeys[e.RowIndex].Value); CFabricMaster ObjFabric = new CFabricMaster(intFabricId); if (ObjFabric.IsExit == true) { TxtFabicId.Text = ObjFabric.FabricId.ToString(); TxtFabricname.Text = ObjFabric.Fabricname.ToString(); DropStatus.SelectedValue = ObjFabric.Status.ToString(); } int intReturnValue = CFabricMasterServices.FabricMasterDelete(Convert.ToInt32(TxtFabicId.Text)); if (intReturnValue > 0) { Lblmsg.Text = "Delete Fabric"; BindGVFabricList(); TxtFabicId.Text = ""; TxtFabricname.Text = ""; } else { Lblmsg.Text = "Error occured while Delete Data"; } }
protected void GvFabricList_RowEditing(object sender, GridViewEditEventArgs e) { //int intCategoryId = Convert.ToInt32(gvCategorylist.DataKeys[e.NewEditIndex].Value); int intFabricId = Convert.ToInt32(GvFabricList.DataKeys[e.NewEditIndex].Value); CFabricMaster ObjFabric = new CFabricMaster(intFabricId); if (ObjFabric.IsExit == true) { TxtFabicId.Text = ObjFabric.FabricId.ToString(); TxtFabricname.Text = ObjFabric.Fabricname.ToString(); DropStatus.SelectedValue = ObjFabric.Status.ToString(); } }