public void grd1_EditCommand(object sender, DataGridCommandEventArgs e) { contingency _wc = new contingency(); grd1.ShowFooter = false; grd1.EditItemIndex = Convert.ToInt32(e.Item.ItemIndex); DataSet dsGridResults = _wc.FetchSubQualData(Convert.ToInt32(ViewState["cont_id"].ToString())); PopulateDataGrid(dsGridResults, grd1); }
public void grd1_UpdateCommand(object sender, DataGridCommandEventArgs e) { String DetailId = grd1.DataKeys[Convert.ToInt32(e.Item.ItemIndex)].ToString(); contingency _wc = new contingency(); _wc.UpdateSubQuals(Convert.ToInt32(DetailId), ((TextBox)(e.Item.FindControl("txtdesc"))).Text, ((RadioButtonList)(e.Item.FindControl("chkis_default"))).SelectedItem.Value); grd1.EditItemIndex = -1; grd1.ShowFooter = true; DataSet dsGridResults = _wc.FetchSubQualData(Convert.ToInt32(ViewState["cont_id"].ToString())); PopulateDataGrid(dsGridResults, grd1); }
public void grd1_DeleteCommand(object sender, DataGridCommandEventArgs e) { contingency _wc = new contingency(); String DetailId = ""; DetailId = grd1.DataKeys[Convert.ToInt32(e.Item.ItemIndex)].ToString(); Whitfieldcore _dbClass = new Whitfieldcore(); _wc.DeleteSubQuals(Convert.ToInt32(DetailId)); DataSet dsGridResults = _wc.FetchSubQualData(Convert.ToInt32(ViewState["cont_id"].ToString())); PopulateDataGrid(dsGridResults, grd1); }
public void grdEstimateMaterials_Itemcommand(Object sender, DataGridCommandEventArgs e) { Int32 qual_id = 0; contingency mm = new contingency(); switch (e.CommandName) { case "Expand": { qual_id = Convert.ToInt32(grdEstimateMaterials.DataKeys[Convert.ToInt32(e.Item.ItemIndex)]); qual_id = Convert.ToInt32(grdEstimateMaterials.DataKeys[e.Item.ItemIndex]); DataSet dsExpand = mm.FetchSubQualData(qual_id); PlaceHolder exp = new PlaceHolder(); exp = (System.Web.UI.WebControls.PlaceHolder)e.Item.Cells[6].FindControl("ExpandedContent"); ImageButton img = new ImageButton(); img = (System.Web.UI.WebControls.ImageButton)e.Item.Cells[0].FindControl("btnExpand"); // if (dsExpand.HasRows()) // { if (img.ImageUrl == "assets/img/Plus.gif") { img.ImageUrl = "assets/img/Minus.gif"; exp.Visible = true; ((master_quals1)(e.Item.FindControl("DynamicTable1"))).Visible = true; ((master_quals1)(e.Item.FindControl("DynamicTable1"))).qual_id = qual_id; ((master_quals1)(e.Item.FindControl("DynamicTable1"))).LoadDetails(dsExpand); } else { exp.Visible = false; ((master_quals1)(e.Item.FindControl("DynamicTable1"))).Visible = false; img.ImageUrl = "assets/img/Plus.gif"; } //} break; } default: { break; } } }
public void PageResultGrid1(object sender, DataGridPageChangedEventArgs e) { contingency mm = new contingency(); grd1.CurrentPageIndex = e.NewPageIndex; DataSet dsGridResults = mm.FetchSubQualData(Convert.ToInt32(ViewState["cont_id"].ToString())); PopulateDataGrid(dsGridResults, grd1); }
protected void btnSave_Click(object sender, EventArgs e) { try { contingency mm = new contingency(); Int32 IsValidInsert = mm.PopulateSubQuals(Convert.ToInt32(ViewState["cont_id"].ToString()), "dummy", txtdesc.Text.Trim(), ddldefault.SelectedItem.Value); DataSet dsGridResults = mm.FetchSubQualData(Convert.ToInt32(ViewState["cont_id"].ToString())); PopulateDataGrid(dsGridResults, grd1); } catch (Exception) { throw; } }