public void grdEstimateMaterials_EditCommand(object sender, DataGridCommandEventArgs e)
 {
     contingency _wc = new contingency();
     grdEstimateMaterials.ShowFooter = false;
     grdEstimateMaterials.EditItemIndex = Convert.ToInt32(e.Item.ItemIndex);
     DataSet dsGridResults = _wc.FetchContingencyData();
     PopulateDataGrid(dsGridResults, grdEstimateMaterials);
 }
 public void grdEstimateMaterials_CancelCommand(object sender, DataGridCommandEventArgs e)
 {
     contingency _wc = new contingency();
     grdEstimateMaterials.ShowFooter = true;
     grdEstimateMaterials.EditItemIndex = -1;
     DataSet dsGridResults = _wc.FetchContingencyData();
     PopulateDataGrid(dsGridResults, grdEstimateMaterials);
 }
 public void grdEstimateMaterials_DeleteCommand(object sender, DataGridCommandEventArgs e)
 {
     contingency _wc = new contingency();
     String DetailId = "";
     DetailId = grdEstimateMaterials.DataKeys[Convert.ToInt32(e.Item.ItemIndex)].ToString();
     Whitfieldcore _dbClass = new Whitfieldcore();
     _wc.DeleteContingency(Convert.ToInt32(DetailId));
     _wc.DeleteSubContingencyForContingency(Convert.ToInt32(DetailId));
     DataSet dsGridResults = _wc.FetchContingencyData();
     PopulateDataGrid(dsGridResults, grdEstimateMaterials);
 }
 public void PageResultGrid1(object sender, DataGridPageChangedEventArgs e)
 {
     contingency mm = new contingency();
     DataSet dsGridResults;
     grd1.CurrentPageIndex = e.NewPageIndex;
     dsGridResults = mm.FetchContingencyData();
     PopulateDataGrid(dsGridResults, grd1);
 }
 public void grdEstimateMaterials_UpdateCommand(object sender, DataGridCommandEventArgs e)
 {
     String DetailId = grdEstimateMaterials.DataKeys[Convert.ToInt32(e.Item.ItemIndex)].ToString();
     contingency _wc = new contingency();
     _wc.UpdateContingency(Convert.ToInt32(DetailId), ((TextBox)(e.Item.FindControl("txtdesc"))).Text);
     grdEstimateMaterials.EditItemIndex = -1;
     grdEstimateMaterials.ShowFooter = true;
     DataSet dsGridResults = _wc.FetchContingencyData();
     PopulateDataGrid(dsGridResults, grdEstimateMaterials);
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        contingency _wc = new contingency();
        if (!Page.IsPostBack)
        {

            try
            {
                grdEstimateMaterials.PageSize = _DEFAULTPAGESIZE;
                DataSet dsGridResults = _wc.FetchContingencyData();
                PopulateDataGrid(dsGridResults, grdEstimateMaterials);

            }
            catch (Exception exp)
            {
                Response.Write(exp.Message.ToString());
            }
        }
    }