private void WebForm1_BubbleClick(object sender, EventArgs e) { //uctl grd selected index changed Session["CaseID"] = int.Parse(((GridView)CaseSearch1.FindControl("grdCase")).SelectedRow.Cells[2].Text); Session["CaseTypeID"] = int.Parse(((GridView)CaseSearch1.FindControl("grdCase")).SelectedRow.Cells[0].Text); try { List <ATTSectionCaseType> OrgUnitList = BLLSectionCaseType.GetSecCaseType(orgID, (int)Session["CaseTypeID"]); Session["UnitList"] = OrgUnitList; lstOrgUnits.DataSource = OrgUnitList; lstOrgUnits.DataTextField = "UnitName"; lstOrgUnits.DataValueField = "UnitID"; lstOrgUnits.DataBind(); } catch (Exception ex) { lblStatusMessage.Text = ex.Message; programmaticModalPopup.Show(); } }
protected void lstCaseTypes_SelectedIndexChanged(object sender, EventArgs e) { if (lstOrganization.SelectedIndex == -1) { lblStatusMessage.Text = "Please Select Organization First"; programmaticModalPopup.Show(); return; } foreach (GridViewRow row in grdOrgUnits.Rows) { CheckBox cbSelect = (CheckBox)row.Cells[0].FindControl("chkSelect"); cbSelect.Checked = false; } try { List <ATTSectionCaseType> lstSecCaseType = BLLSectionCaseType.GetSectionCaseType(int.Parse(lstOrganization.SelectedValue), int.Parse(lstCaseTypes.SelectedValue), null, null); ATTSectionCaseType attSC = new ATTSectionCaseType(); foreach (GridViewRow row in grdOrgUnits.Rows) { CheckBox cbSelect = (CheckBox)row.Cells[0].FindControl("chkSelect"); attSC = lstSecCaseType.Find(delegate(ATTSectionCaseType att) { return(att.UnitID == int.Parse(row.Cells[1].Text.ToString())); }); if (attSC != null) { cbSelect.Checked = true; row.Cells[3].Text = "U"; } } } catch (Exception ex) { lblStatusMessage.Text = ex.Message; programmaticModalPopup.Show(); } }
protected void btnSubmit_Click(object sender, EventArgs e) { if (lstOrganization.SelectedIndex == -1) { lblStatusMessage.Text = "Please Select Organization First"; programmaticModalPopup.Show(); return; } if (lstCaseTypes.SelectedIndex == -1) { lblStatusMessage.Text = "Please Select Case Type First"; programmaticModalPopup.Show(); return; } if (grdOrgUnits.Rows.Count < 0) { lblStatusMessage.Text = "This Organization hasn't case Types..Choose next Org."; programmaticModalPopup.Show(); return; } if (txtFromDate_RQD.Text == "____/__/__") { lblStatusMessage.Text = "Please Enter from Date First"; programmaticModalPopup.Show(); return; } List <ATTSectionCaseType> SecCaseTypeList = new List <ATTSectionCaseType>(); foreach (GridViewRow row in grdOrgUnits.Rows) { CheckBox cbSelect = (CheckBox)row.Cells[0].FindControl("chkSelect"); if (cbSelect.Checked == true && row.Cells[3].Text == "") { ATTSectionCaseType attSCT = new ATTSectionCaseType(); attSCT.OrgID = orgID; attSCT.CaseTypeID = int.Parse(lstCaseTypes.SelectedValue); attSCT.UnitID = int.Parse(row.Cells[1].Text.ToString()); attSCT.FromDate = txtFromDate_RQD.Text.Trim(); attSCT.EntryBy = strUser; attSCT.Action = "A"; SecCaseTypeList.Add(attSCT); } else if (cbSelect.Checked == false && row.Cells[3].Text == "U") { ATTSectionCaseType attSCT = new ATTSectionCaseType(); attSCT.OrgID = orgID; attSCT.CaseTypeID = int.Parse(lstCaseTypes.SelectedValue); attSCT.UnitID = int.Parse(row.Cells[1].Text.ToString()); attSCT.FromDate = txtFromDate_RQD.Text.Trim(); attSCT.EntryBy = strUser; attSCT.Action = "E"; SecCaseTypeList.Add(attSCT); } } if (BLLSectionCaseType.SaveSectionCaseType(SecCaseTypeList)) { ClearControls(); lblStatusMessage.Text = "Successfully Saved"; programmaticModalPopup.Show(); } }