public static List <ATTOrgCaseRegistrationType> GetOrgCaseRegType(int OrgID, int CaseTypeID, int?RegTypeID, string active, int CaseRegTypeDV) { List <ATTOrgCaseRegistrationType> LstOrgCaseType = new List <ATTOrgCaseRegistrationType>(); try { foreach (DataRow row in DLLOrgCaseRegistrationType.GetOrgCaseRegType(OrgID, CaseTypeID, RegTypeID, active).Rows) { ATTOrgCaseRegistrationType attOCRT = new ATTOrgCaseRegistrationType ( int.Parse(row["ORG_ID"].ToString()), int.Parse(row["CASE_TYPE_ID"].ToString()), int.Parse(row["REG_TYPE_ID"].ToString()), row["REG_TYPE_NAME"].ToString(), row["ACTIVE"].ToString(), "" ); attOCRT.OrgCaseRegTypeCheckListLST = BLLOrgCaseRegTypeCheckList.GetOrgCaseRegTypeCheckList(int.Parse(row["ORG_ID"].ToString()), int.Parse(row["CASE_TYPE_ID"].ToString()), int.Parse(row["REG_TYPE_ID"].ToString()), null, "Y"); LstOrgCaseType.Add(attOCRT); } if (CaseRegTypeDV != 0) { LstOrgCaseType.Insert(0, new ATTOrgCaseRegistrationType(0, 0, 0, "छान्नुहोस", "", "")); } return(LstOrgCaseType); } catch (Exception ex) { throw ex; } }
protected void btnSubmit_Click(object sender, EventArgs e) { if (lstOrganization.SelectedIndex == -1) { this.lblStatusMessage.Text = "कृपया कार्यालय छान्नुहोस. "; this.programmaticModalPopup.Show(); return; } if (lstCaseType.SelectedIndex == -1) { this.lblStatusMessage.Text = "कृपया दर्ता किताब छान्नुहोस. "; this.programmaticModalPopup.Show(); return; } List <ATTOrgCaseRegistrationType> OrgCaseRegTypeList = new List <ATTOrgCaseRegistrationType>(); ATTOrgCaseRegistrationType objOrgCaseRegType = new ATTOrgCaseRegistrationType(); foreach (GridViewRow row in grdRegType.Rows) { CheckBox cbSelect = (CheckBox)(row.Cells[0].FindControl("chkSelect")); if (cbSelect.Checked == true && row.Cells[3].Text == "") { objOrgCaseRegType = new ATTOrgCaseRegistrationType(int.Parse(lstOrganization.SelectedValue), int.Parse(lstCaseType.SelectedValue), int.Parse(row.Cells[1].Text), "", "Y", "A"); } else if (cbSelect.Checked == false && row.Cells[3].Text == "Y") { objOrgCaseRegType = new ATTOrgCaseRegistrationType(int.Parse(lstOrganization.SelectedValue), int.Parse(lstCaseType.SelectedValue), int.Parse(row.Cells[1].Text), "", "N", "E"); } else if (cbSelect.Checked == true && row.Cells[3].Text == "N") { objOrgCaseRegType = new ATTOrgCaseRegistrationType(int.Parse(lstOrganization.SelectedValue), int.Parse(lstCaseType.SelectedValue), int.Parse(row.Cells[1].Text), "", "Y", "E"); } else { continue; } objOrgCaseRegType.EntryBy = strUser; OrgCaseRegTypeList.Add(objOrgCaseRegType); if (OrgCaseRegTypeList.Count == 0) { return; } } try { if (BLLOrgCaseRegistrationType.SaveOrgCaseRegType(OrgCaseRegTypeList)) { this.lblStatusMessage.Text = "Successfully Saved. "; this.programmaticModalPopup.Show(); ClearControls(); lstCaseType.SelectedIndex = -1; } } catch (Exception ex) { this.lblStatusMessage.Text = ex.Message; this.programmaticModalPopup.Show(); } }