Esempio n. 1
0
 /// <summary>
 /// Bind data to grid
 /// </summary>
 private void BindGridData()
 {
     ZNode.Libraries.Admin.ManufacturerAdmin ManuAdmin = new ZNode.Libraries.Admin.ManufacturerAdmin();
     DataSet ds = ManuAdmin.GetAllByPortalID(ZNode.Libraries.Framework.Business.ZNodeConfigManager.SiteConfig.PortalID).ToDataSet(true);
     DataView dv = new DataView(ds.Tables[0]);
     dv.Sort = "Name";
     uxGrid.DataSource = dv;
     uxGrid.DataBind();
 }
Esempio n. 2
0
    protected void uxGrid_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Page")
        {
        }
        else
        {
            string Id = e.CommandArgument.ToString();

            if (e.CommandName == "Edit")
            {
                AddLink = AddLink + "?itemid=" + Id;
                Response.Redirect(AddLink);
            }
            else if (e.CommandName == "Delete")
            {

                    ZNode.Libraries.Admin.ManufacturerAdmin adminaccess = new ZNode.Libraries.Admin.ManufacturerAdmin();
                    bool Check = false;
                    Check = adminaccess.Delete(int.Parse(Id));
                    if (Check)
                    {
                        this.BindGridData();
                    }
                    else
                    {
                        lblError.Visible = true;
                        lblError.Text = "Delete action could not be completed because the manufacturer is in use.";
                    }

            }

        }
    }