Beispiel #1
0
 private void fillGrid()
 {
     try
     {
         clsCategory objCategory = new clsCategory();
         DataSet     ds          = new DataSet();
         objCategory.Action = "SELECT";
         ds = objCategory.fnCategory();
         gvCategory.DataSource = ds;
         gvCategory.DataBind();
         ViewState["dt"] = ds.Tables[0];
     }
     catch (Exception ex)
     { }
 }
Beispiel #2
0
        private void Parameters(string Action, int CategoryId)
        {
            try
            {
                if (txtCategoryName.Text != "")
                {
                    clsCategory objCategory = new clsCategory();
                    DataSet     ds          = new DataSet();
                    objCategory.Action       = Action;
                    objCategory.CategoryId   = CategoryId;
                    objCategory.CategoryName = txtCategoryName.Text;
                    objCategory.Description  = txtDescription.Text;

                    ds = objCategory.fnCategory();
                    if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                    {
                        divAlert.Visible   = true;
                        divAlert.InnerHtml = ds.Tables[0].Rows[0]["MSG"].ToString();
                    }
                    else
                    {
                        divAlert.Visible   = true;
                        divAlert.InnerHtml = "Something went wrong";
                    }
                    fillGrid();
                    clear();
                }
                else
                {
                    divAlert.Visible   = true;
                    divAlert.InnerHtml = "Enter all required fileds";
                }
            }
            catch
            {
            }
        }