public static List <ATTOrgCaseRegTypeCheckList> GetOrgCaseRegTypeCheckList(int OrgID, int CaseTypeID, int RegTypeID, int?CheckListID, string active) { List <ATTOrgCaseRegTypeCheckList> LstOrgCaseTypeChkLst = new List <ATTOrgCaseRegTypeCheckList>(); try { foreach (DataRow row in DLLOrgCaseRegTypeCheckList.GetOrgCaseRegTypeCheckList(OrgID, CaseTypeID, RegTypeID, CheckListID, active).Rows) { ATTOrgCaseRegTypeCheckList attOCRTC = new ATTOrgCaseRegTypeCheckList ( int.Parse(row["ORG_ID"].ToString()), int.Parse(row["CASE_TYPE_ID"].ToString()), int.Parse(row["REG_TYPE_ID"].ToString()), int.Parse(row["CHECK_LIST_ID"].ToString()), row["CHECK_LIST_NAME"].ToString(), "", row["ACTIVE"].ToString(), "" ); attOCRTC.CheckListType = row["CHECK_LIST_TYPE"].ToString(); LstOrgCaseTypeChkLst.Add(attOCRTC); } return(LstOrgCaseTypeChkLst); } 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; } if (lstRegistrationType.SelectedIndex == -1) { this.lblStatusMessage.Text = "दर्ताको प्रकार छाननुस"; this.programmaticModalPopup.Show(); return; } List <ATTOrgCaseRegTypeCheckList> OrgCaseRegTypeChkLst = new List <ATTOrgCaseRegTypeCheckList>(); ATTOrgCaseRegTypeCheckList ObjOrgCaesregTypeChkLst = new ATTOrgCaseRegTypeCheckList(); foreach (GridViewRow row in grdCheckListType.Rows) { CheckBox cbSelect = (CheckBox)(row.Cells[0].FindControl("chkSelect")); if (cbSelect.Checked == true && row.Cells[3].Text == "N") { ObjOrgCaesregTypeChkLst = new ATTOrgCaseRegTypeCheckList (int.Parse(lstOrganization.SelectedValue), int.Parse(lstCaseType.SelectedValue), int.Parse(lstRegistrationType.SelectedValue), int.Parse(row.Cells[1].Text), "", strUser, "Y", "E" ); } else if (cbSelect.Checked == false && row.Cells[3].Text == "Y") { ObjOrgCaesregTypeChkLst = new ATTOrgCaseRegTypeCheckList (int.Parse(lstOrganization.SelectedValue), int.Parse(lstCaseType.SelectedValue), int.Parse(lstRegistrationType.SelectedValue), int.Parse(row.Cells[1].Text), "", strUser, "N", "E" ); } else if (cbSelect.Checked == true && row.Cells[3].Text == "") { ObjOrgCaesregTypeChkLst = new ATTOrgCaseRegTypeCheckList (int.Parse(lstOrganization.SelectedValue), int.Parse(lstCaseType.SelectedValue), int.Parse(lstRegistrationType.SelectedValue), int.Parse(row.Cells[1].Text), "", strUser, "Y", "A" ); } else { continue; } OrgCaseRegTypeChkLst.Add(ObjOrgCaesregTypeChkLst); } if (OrgCaseRegTypeChkLst.Count == 0) { return; } try { if (BLLOrgCaseRegTypeCheckList.SaveOrgCaseRegTypeCheckList(OrgCaseRegTypeChkLst)) { ClearControls(); lstRegistrationType.SelectedIndex = -1; this.lblStatusMessage.Text = "Successfully Saved"; this.programmaticModalPopup.Show(); return; } } catch (Exception ex) { this.lblStatusMessage.Text = ex.Message; this.programmaticModalPopup.Show(); } }