protected void Page_Load(object sender, EventArgs e) { string Query = string.Empty; string Filter = Request.QueryString.Get("Filter"); string Year1 = Request.QueryString.Get("Year1"); hdnLookupName.Value = Request.QueryString.Get("Lookup"); string conn = System.Configuration.ConfigurationManager.ConnectionStrings["constr"].ConnectionString; DBEngineType _eDBType = new DBEngineType(); clsDBAccess obj_clsDBAccess = new clsDBAccess(conn, _eDBType); switch (hdnLookupName.Value) { case "Item": DataTable dt_Items = obj_GeneralFunction.GetAllItems(); this.Title = "Item Lookup"; //grid_Lookup.DataSource = ObjDB_MLTNT.GetDataTable(Query); grid_Lookup.DataSource = dt_Items; break; default: break; } obj_clsDBAccess.DisposeConnection(); }
protected void grid_ItemDetail_ItemCreated(object sender, GridItemEventArgs e) { string conn = System.Configuration.ConfigurationManager.ConnectionStrings["constr"].ConnectionString; DBEngineType _eDBType = new DBEngineType(); clsDBAccess obj_clsDBAccess = new clsDBAccess(conn, _eDBType); if (e.Item is GridEditableItem && e.Item.IsInEditMode) { int RowID = e.Item.DataSetIndex; GridEditableItem edititem = (GridEditableItem)e.Item; DataTable dt_ItemLines = (DataTable)Session["dt_ItemLines"]; RadTextBox tbItemCode = (RadTextBox)edititem["ItemCode"].FindControl("tbItemCode"); tbItemCode.AutoPostBack = true; tbItemCode.TextChanged += new System.EventHandler(this.tbItemCode_TextChanged); RadNumericTextBox tbQuantity = (RadNumericTextBox)edititem["Quantity"].FindControl("tbQuantity"); tbQuantity.AutoPostBack = true; tbQuantity.TextChanged += new System.EventHandler(this.tbQuantity_TextChanged); RadNumericTextBox tbAmount = (RadNumericTextBox)edititem["Amount"].FindControl("tbAmount"); tbAmount.AutoPostBack = true; tbAmount.TextChanged += new System.EventHandler(this.tbAmount_TextChanged); if (RowID > -1) { if (dt_ItemLines.Rows[RowID]["ItemCode"].ToString() != "") { tbItemCode.ShowButton = false; tbItemCode.Enabled = false; } } } obj_clsDBAccess.DisposeConnection(); }