protected void SaveGapSummary() { bool retVal = false; if (!ValidateGapSummary()) { return; } GapSummaryDAO gapSummary = new GapSummaryDAO(); gapSummary.DeleteGapSummary(caseID); foreach (GridViewRow gvr in grdGapSummary.Rows) { Label lblNeedId = (Label)gvr.FindControl("lblNeedId"); Label lblGapSummaryTypeID = (Label)gvr.FindControl("lblGapSummaryTypeID"); Label lblMyPriorities = (Label)gvr.FindControl("lblMyPriorities"); int iNeedId = Convert.ToInt32(lblNeedId.Text); int iNeedTypeId = Convert.ToInt32(lblGapSummaryTypeID.Text); string strMyPriorities = lblMyPriorities.Text; if (strMyPriorities != null && strMyPriorities != "") { retVal = gapSummary.SaveGapSummary(caseID, iNeedId, iNeedTypeId, strMyPriorities); } } if (!retVal) { lblGapSummarySaveSuccess.Visible = false; lblGapSummarySaveFailed.Visible = true; } else { lblGapSummarySaveSuccess.Visible = true; lblGapSummarySaveFailed.Visible = false; } }
protected void LoadGapSummary() { GapSummaryDAO gapDAO = new GapSummaryDAO(); DataTable dtGapSummary = gapDAO.GetGapSummary(caseID); if (dtGapSummary != null && dtGapSummary.Rows.Count > 0) { int cnt = 0; foreach (DataRow dr in dtGapSummary.Rows) { if (dr["Title"] != null && dr["Title"].ToString() == "SAVINGS") { cnt = cnt + 1; } if (cnt > 1) { dr["Title"] = string.Empty; } if (dr["AmountRequired"] != null && dr["AmountRequired"].ToString() == "0.00") { dr["AmountRequired"] = string.Empty; } if (dr["ExistingArrangements"] != null && dr["ExistingArrangements"].ToString() == "0.00") { dr["ExistingArrangements"] = string.Empty; } if (dr["CurrentShortfall"] != null && dr["CurrentShortfall"].ToString() == "0.00") { dr["CurrentShortfall"] = string.Empty; } } grdGapSummary.DataSource = dtGapSummary; grdGapSummary.DataBind(); MergeRows(grdGapSummary); } }