protected void gvCosubcategoryList_RowDeleting(object sender, GridViewDeleteEventArgs e) { DropCategoryname.ClearSelection(); DropSubCategory.ClearSelection(); int intCosubcategoryId = Convert.ToInt32(gvCosubcategoryList.DataKeys[e.RowIndex].Value); CCoSubCategoryMaster ObjCosubcategory = new CCoSubCategoryMaster(intCosubcategoryId); DropCategoryname.SelectedValue = ObjCosubcategory.CategoryId.ToString(); if (ObjCosubcategory.IsExit == true) { TxtCosubcategory.Text = ObjCosubcategory.CosubcategoryId.ToString(); DropCategoryname.SelectedValue = ObjCosubcategory.CategoryId.ToString(); DropSubCategory.SelectedValue = ObjCosubcategory.SubcategoryId.ToString(); TxtDescription.Text = ObjCosubcategory.Cosubcategorydesc.ToString(); DropStatus.SelectedValue = ObjCosubcategory.Status.ToString(); } int intReturnValue = CCoSubCategoryMasterServices.CosubcategoryDelete(Convert.ToInt32(TxtCosubcategory.Text)); if (intReturnValue > 0) { Lblmsg.Text = "Cosubcategory Delete"; BindGv(); TxtCosubcategory.Text = ""; TxtDescription.Text = ""; } }
public void BindGv() { DataSet dsCosubcategoryMasterList = CCoSubCategoryMasterServices.CosubcategoryList(); gvCosubcategoryList.DataSource = dsCosubcategoryMasterList; gvCosubcategoryList.DataBind(); }
private void BindCosubcategory() { DataSet dsCosubcategoryMasterList = CCoSubCategoryMasterServices.CosubcategoryList(); ListBox1.DataSource = dsCosubcategoryMasterList; ListBox1.DataTextField = "Cosubcategorydesc"; ListBox1.DataValueField = "CosubcategoryId"; ListBox1.DataBind(); }
public void BindCosubcategoryName(int SubCategoryId) { DataSet dsCosubcategoryListbySubcategoryId = CCoSubCategoryMasterServices.CosubcategoryListbySubcategoryId(Convert.ToInt32(droplistsubcategory.SelectedValue)); DropCosubcategoryList.DataSource = dsCosubcategoryListbySubcategoryId; DropCosubcategoryList.DataTextField = "Cosubcategorydesc"; DropCosubcategoryList.DataValueField = "CosubcategoryId"; DropCosubcategoryList.DataBind(); }
protected void ButUpdate_Click(object sender, EventArgs e) { int intReturnValues = CCoSubCategoryMasterServices.CosubcategoryUpdate(Convert.ToInt32(TxtCosubcategory.Text), Convert.ToInt32(DropCategoryname.SelectedValue), Convert.ToInt32(DropSubCategory.SelectedValue), TxtDescription.Text, DropStatus.SelectedValue); if (intReturnValues > 0) { Lblmsg.Text = "Cosubcategory Update"; TxtDescription.Text = ""; BindGv(); } else { Lblmsg.Text = "Error occured while Updateing CosubCategory."; } }