public static List<EvidencesPerCase> GetAllByCaseID(int CaseID) { List<EvidencesPerCase> lstEvidencesPerCase = new List<EvidencesPerCase>(); DataView objDataView = new BaseDAO().Select("*", "tbl_evidences_per_case", "CaseID=" + CaseID); foreach (DataRowView drv in objDataView) { EvidencesPerCase objEvidencesPerCase = new EvidencesPerCase(); objEvidencesPerCase.EvidencesPerCaseID = (int)drv["EvidencesPerCaseID"]; objEvidencesPerCase.EvidenceTypeID = (int)drv["EvidenceTypeID"]; objEvidencesPerCase.CaseID = (int)drv["CaseID"]; lstEvidencesPerCase.Add(objEvidencesPerCase); } return lstEvidencesPerCase; }
protected List<EvidencesPerCase> MapEvidencesPerCaseDTOList() { List<EvidencesPerCase> lstEvidencesPerCase = new List<EvidencesPerCase>(); if (cblEvidenceTypes.Items.Count > 0) { for (int j = 0; j < cblEvidenceTypes.Items.Count; j++) { if (cblEvidenceTypes.Items[j].Selected == true) { EvidencesPerCase objEvidencesPerCase = new EvidencesPerCase(); objEvidencesPerCase.EvidenceTypeID = Convert.ToInt32(cblEvidenceTypes.Items[j].Value); lstEvidencesPerCase.Add(objEvidencesPerCase); } } } return lstEvidencesPerCase; }
protected void btnAddOtherCase_Click(object sender, EventArgs e) { Cases objCases = new Cases(); objCases.CaseProfileID = Convert.ToInt32(Request.QueryString.Get("ID")); objCases.CaseTypeID = Convert.ToInt32(ddlTypeOfCase.SelectedValue); objCases.Description = txtCaseDesc.Text; objCases.CaseNumber = txtCaseNumber.Text.Trim(); objCases.NameOfOpponent = txtNameOfOpponent.Text.Trim(); objCases.CaseRegistrarID = Convert.ToInt32(ddlCaseRegistrar.SelectedValue); objCases.ResponsibleStaff = txtResponsibleStaff.Text.Trim(); objCases.CaseRegisteredDate = Convert.ToDateTime(txtCaseRegisteredDate.Text); objCases.CaseStatusTypeID = Convert.ToInt32(ddlCaseStatusType.SelectedValue); objCases.PartnerID = Convert.ToInt32(ddlStackeHolder.SelectedValue); List<EvidencesPerCase> lstEvidencesPerCase = new List<EvidencesPerCase>(); if (cblEvidenceTypes.Items.Count > 0) { for (int j = 0; j < cblEvidenceTypes.Items.Count; j++) { if (cblEvidenceTypes.Items[j].Selected == true) { EvidencesPerCase objEvidencesPerCase = new EvidencesPerCase(); objEvidencesPerCase.EvidenceTypeID = Convert.ToInt32(cblEvidenceTypes.Items[j].Value); lstEvidencesPerCase.Add(objEvidencesPerCase); } } } if (!string.IsNullOrEmpty(hfCaseID.Value)) { if (rbCompensationYes.Checked) { objCases.CompensationAmount = Convert.ToInt32(txtCompensationAmount.Text.Trim()); } else objCases.CompensationAmount = 0; objCases.OutputDetails = txtOutputDetails.Text; objCases.UpdatedBy = UserAuthentication.GetUserId(this.Page); objCases.UpdatedDate = DateTime.Now; objCases.CaseID = Convert.ToInt32(hfCaseID.Value); CaseBO.UpdateCase(objCases, lstEvidencesPerCase); } else { objCases.CreatedBy = UserAuthentication.GetUserId(this.Page); objCases.CreatedDate = DateTime.Now; CaseBO.InsertCase(objCases, lstEvidencesPerCase); } ClearCase(); LoadCasesAndFollowUp(Convert.ToInt32(hfCaseProfileID.Value)); }