Пример #1
0
    public void loaddata()
    {
        try
        {
            strConnection.Open();
            SqlCommand cmd = new SqlCommand();
            cmd.Connection  = strConnection;
            cmd.CommandText = "SELECT  * FROM dbo.CategoryMaster ";
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            DataSet        ds = new DataSet();
            da.Fill(ds);
            GridCategory.DataSource = ds;

            GridCategory.DataBind();
            cmd.Dispose();
            strConnection.Close();
        }
        catch
        {
        }
        finally
        {
            strConnection.Close();
        }
    }
Пример #2
0
    public MultiGridData(MultiGridData other, bool withValues = true) : base(other)
    {
        if (other.categories != null)
        {
            int count = other.categories.Length;
            categories = new GridCategory[other.categories.Length];
            for (int i = 0; i < count; i++)
            {
                var c        = other.categories[i];
                var category = new GridCategory(c.name, new GridData(c.grid, withValues), c.color);
                category.grid.patch = patch;
                categories[i]       = category;
            }
        }

        gridFilter = other.gridFilter;
        coloring   = other.coloring;
    }
Пример #3
0
        private void BindData()
        {
            var           conString = ConfigurationManager.ConnectionStrings["ProductsCatalogConn"];
            SqlConnection con       = new SqlConnection(conString.ConnectionString);

            //SqlCommand cmd = new SqlCommand("SELECT CategoryId, CatName FROM tblCategories", con);

            SqlCommand cmd = new SqlCommand("dbo.getOrderedCategoryList", con);

            cmd.CommandType = CommandType.StoredProcedure;

            SqlDataAdapter da = new SqlDataAdapter(cmd);
            DataSet        ds = new DataSet();

            da.Fill(ds);

            GridCategory.DataSource = ds;
            GridCategory.DataBind();
        }
Пример #4
0
    public MultiGridData(GridData other) : base(other)
    {
        coloring = other.coloring;

        if (other.categories != null && other.categories.Length > 0)
        {
            int count = other.categories.Length;
            categories = new GridCategory[count];

            for (int i = 0; i < count; i++)
            {
                var c        = other.categories[i];
                var category = new GridCategory(c.name, new GridData(other, false), c.color);
                category.grid.categories = null;
                category.grid.patch      = patch;
                categories[i]            = category;
            }
        }
    }