private void LoadCaseType() { List <ATTCaseType> caseTypeLST = BLLCaseType.GetCaseType(null, "Y", 1); ddlCaseType.DataSource = caseTypeLST; ddlCaseType.DataBind(); }
void LoadCaseTypes() { try { List <ATTCaseType> CaseTypeList = BLLCaseType.GetCaseType(null, null, 0); Session["OrgCaseType"] = CaseTypeList; this.grdCaseType.DataSource = CaseTypeList; this.grdCaseType.DataBind(); } catch (Exception ex) { this.lblStatusMessage.Text = ex.Message; this.programmaticModalPopup.Show(); } }
void LoadCases() { try { List <ATTCaseType> CaseTypeList = BLLCaseType.GetCaseType(null, "Y", 1); Session["CaseType"] = CaseTypeList; DDLCaseType_RQD.DataSource = CaseTypeList; DDLCaseType_RQD.DataTextField = "CaseTypeName"; DDLCaseType_RQD.DataValueField = "CaseTypeID"; DDLCaseType_RQD.DataBind(); } catch (Exception ex) { this.lblStatusMessage.Text = ex.Message; this.programmaticModalPopup.Show(); } }
protected void btnSubmit_Click(object sender, EventArgs e) { try { ATTCaseType attCT = new ATTCaseType(int.Parse(hdnCaseTypeID.Value), txtCaseTypeName_RQD.Text, txtAppellant.Text, txtRespondant.Text, chkActive.Checked == true ? "Y" : "N"); attCT.EntryBy = strUser; foreach (GridViewRow row in grdOrganization.Rows) { CheckBox cbSelect = (CheckBox)(row.Cells[0].FindControl("chkSelect")); if (cbSelect.Checked == true && row.Cells[3].Text == "") { ATTOrganizationCaseType objOrgCaseType = new ATTOrganizationCaseType( int.Parse(row.Cells[1].Text), int.Parse(hdnCaseTypeID.Value), "Y"); objOrgCaseType.EntryBy = strUser; objOrgCaseType.Action = "A"; attCT.OrganisationCaseTypesLIST.Add(objOrgCaseType); } else if (cbSelect.Checked == false && row.Cells[3].Text == "Y") { ATTOrganizationCaseType objOrgCaseType = new ATTOrganizationCaseType( int.Parse(row.Cells[1].Text), int.Parse(hdnCaseTypeID.Value), "N"); objOrgCaseType.EntryBy = strUser; objOrgCaseType.Action = "E"; attCT.OrganisationCaseTypesLIST.Add(objOrgCaseType); } else if (cbSelect.Checked == true && row.Cells[3].Text == "N") { ATTOrganizationCaseType objOrgCaseType = new ATTOrganizationCaseType( int.Parse(row.Cells[1].Text), int.Parse(hdnCaseTypeID.Value), "Y"); objOrgCaseType.EntryBy = strUser; objOrgCaseType.Action = "E"; attCT.OrganisationCaseTypesLIST.Add(objOrgCaseType); } } List <ATTCaseType> LstCaseType = (List <ATTCaseType>)Session["OrgCaseType"]; BLLCaseType.AddEditDeleteCaseType(attCT); foreach (GridViewRow row in grdOrganization.Rows) { CheckBox cbSelect = (CheckBox)(row.Cells[0].FindControl("chkSelect")); if (cbSelect.Checked == true && row.Cells[3].Text == "Y") { ATTOrganizationCaseType objOrgCaseType = new ATTOrganizationCaseType( int.Parse(row.Cells[1].Text), int.Parse(hdnCaseTypeID.Value), "Y"); objOrgCaseType.EntryBy = strUser; attCT.OrganisationCaseTypesLIST.Add(objOrgCaseType); } } if (grdCaseType.SelectedIndex > -1) { LstCaseType[grdCaseType.SelectedIndex].CaseTypeID = attCT.CaseTypeID; LstCaseType[grdCaseType.SelectedIndex].CaseTypeName = attCT.CaseTypeName; LstCaseType[grdCaseType.SelectedIndex].Appellant = attCT.Appellant; LstCaseType[grdCaseType.SelectedIndex].Respondant = attCT.Respondant; LstCaseType[grdCaseType.SelectedIndex].Active = attCT.Active; LstCaseType[grdCaseType.SelectedIndex].OrganisationCaseTypesLIST = attCT.OrganisationCaseTypesLIST; } else { LstCaseType.Add(attCT); } grdCaseType.DataSource = LstCaseType; grdCaseType.DataBind(); ClearControls(); this.lblStatusMessage.Text = "Successfully Saved"; this.programmaticModalPopup.Show(); Session["OrgCaseType"] = LstCaseType; } catch (Exception ex) { this.lblStatusMessage.Text = ex.Message; this.programmaticModalPopup.Show(); } }