GIF89;a GIF89;a using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class SuppliersCategory : BasePage { protected void Page_Load(object sender, EventArgs e) { this.CurrentPage = Globals.CurrentPageId.Suppliers; Button1.OnClientClick = "if(getelementbyid('" + HiddenField1.ClientID + "').value == '') {alert('" + Resources.Common.LID_MESSAGE + "'); return false;} return true; "; Panel pan_Description = new Panel(); pan_Description.Attributes.Add("id", "Description1"); Label text_Description = new Label(); text_Description.Text = (string)this.GetLocalResourceObject("Description1"); pan_Description.Controls.Add(text_Description); pnSection1.Controls.Add(pan_Description); Int32 m_categoryid = 0; if (Page.Session["ToSuppliersCategory_ID"] != null) { m_categoryid = Convert.ToInt32(Page.Session["ToSuppliersCategory_ID"].ToString()); Page.Session.Remove("ToSuppliersCategory_ID"); } if (this.Request.QueryString["ID"] != null) { m_categoryid = Convert.ToInt32(this.Request.QueryString["ID"]); } BusinessLayer.Controllers.ControllerSuppliers controller = new BusinessLayer.Controllers.ControllerSuppliers(); DataSet ds = controller.GetSuppliersByCategory(m_categoryid); GridView1.DataSource = ds; GridView1.DataBind(); } protected void Button1_Click(object sender, EventArgs e) { string[] aMsg = HiddenField1.Value.Split(','); string m_ids = ""; foreach (string m_msg in aMsg) { if (m_ids != "") { m_ids += ", " + m_msg; } else { m_ids += m_msg; } } Page.Session.Add("ToLid_MSG", m_ids); Go("Lid.aspx"); } protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { Control m_control; m_control = (Control)e.Row.Cells[0].FindControl("supplierdata"); HiddenField m_logo; m_logo = (HiddenField)e.Row.Cells[0].FindControl("logo"); HiddenField m_id; m_id = (HiddenField)e.Row.Cells[0].FindControl("supplierid"); HiddenField m_categoryname; m_categoryname = (HiddenField)e.Row.Cells[0].FindControl("categoryname"); titleData.Text = m_categoryname.Value; if (m_logo.Value != "") { Image m_img = new Image(); m_img.Width = 100; m_img.Height = 70; m_img.ImageUrl = m_logo.Value; Panel m_panelimage; m_panelimage = (Panel)m_control.FindControl("panelImage"); m_panelimage.Controls.Add(m_img); } HtmlInputCheckBox m_checkbox; m_checkbox = (HtmlInputCheckBox)m_control.FindControl("checkboxIds"); HiddenField hidSupplierName = (HiddenField)e.Row.Cells[0].FindControl("hidSupplierName"); m_checkbox.Value = hidSupplierName.Value; m_checkbox.Attributes.Add("onclick", "javascript:Checkbox1_onclick(this,'" + HiddenField1.ClientID + "')"); } } }