private void GetAllWitnesses(int caseID) { try { ATTWitnessSearch obj = new ATTWitnessSearch(); obj.CaseID = caseID; List <ATTWitnessSearch> lst = BLLWitnessSearch.SearchWitnessPerson(obj); TameliWitPersonLST = lst; } catch (Exception ex) { lblStatusMessage.Text = ex.Message.ToString(); this.programmaticModalPopup.Show(); } }
protected void btnAddPerson_Click(object sender, EventArgs e) { if (txtFromDate_RQD.Text == "____/__/__") { this.lblStatusMessage.Text = "Enter From Date First"; this.programmaticModalPopup.Show(); return; } if (grdWitnesses.SelectedIndex == -1) { this.lblStatusMessage.Text = "Select Witness Person First"; this.programmaticModalPopup.Show(); return; } foreach (GridViewRow row in grdWitnesses.Rows) { if (int.Parse(row.Cells[2].Text) == int.Parse(grdPerson.SelectedRow.Cells[0].Text)) { this.lblStatusMessage.Text = "Witness Already Exits.."; this.programmaticModalPopup.Show(); return; } } List <ATTWitnessSearch> WSearchLST = (List <ATTWitnessSearch>)Session["WSearch"]; ATTWitnessSearch obj = new ATTWitnessSearch(); obj.CaseID = int.Parse(grdLitigants.SelectedRow.Cells[0].Text); obj.LItigantID = int.Parse(grdLitigants.SelectedRow.Cells[1].Text); obj.PersonID = int.Parse(grdPerson.SelectedRow.Cells[0].Text); obj.WitnessID = 0; obj.WitnessName = grdPerson.SelectedRow.Cells[4].Text.Trim(); obj.FromDate = txtFromDate_RQD.Text; obj.WitnessGender = grdPerson.SelectedRow.Cells[5].Text; obj.WitnessDOB = grdPerson.SelectedRow.Cells[6].Text; obj.Action = "A"; WSearchLST.Add(obj); Session["WSearch"] = WSearchLST; grdWitnesses.DataSource = WSearchLST; grdWitnesses.DataBind(); this.txtFromDate_RQD.Text = ""; this.grdPerson.SelectedIndex = -1; }
public static List <ATTWitnessSearch> SearchWitnessPerson(ATTWitnessSearch objWitnessSearch) { List <ATTWitnessSearch> lstWitnessPerson = new List <ATTWitnessSearch>(); foreach (DataRow row in DLLWitnessSearch.SearchWitnessPerson(objWitnessSearch).Rows) { ATTWitnessSearch obj = new ATTWitnessSearch(); obj.CaseID = int.Parse(row["CASE_ID"].ToString()); obj.LItigantID = int.Parse(row["LITIGANT_ID"].ToString()); obj.PersonID = int.Parse(row["PERSON_ID"].ToString()); obj.WitnessID = int.Parse(row["WITNESS_ID"].ToString()); obj.WitnessName = row["WITNESSNAME"].ToString(); obj.FromDate = row["FROM_DATE"].ToString(); obj.WitnessGender = row["WIT_GENDER"].ToString(); obj.WitnessDOB = row["WIT_DOB"].ToString(); lstWitnessPerson.Add(obj); } return(lstWitnessPerson); }
protected void grdLitigants_SelectedIndexChanged(object sender, EventArgs e) { try { ATTWitnessSearch objWP = new ATTWitnessSearch(); objWP.CaseID = int.Parse(grdLitigants.SelectedRow.Cells[0].Text); objWP.LItigantID = int.Parse(grdLitigants.SelectedRow.Cells[1].Text); objWP.LitigantName = grdLitigants.SelectedRow.Cells[3].Text.Trim(); List <ATTWitnessSearch> WitnessList = BLLWitnessSearch.SearchWitnessPerson(objWP); Session["WSearch"] = WitnessList; //WitPersonList = WitnessList; grdWitnesses.DataSource = WitnessList; grdWitnesses.DataBind(); } catch (Exception ex) { this.lblStatusMessage.Text = ex.Message; this.programmaticModalPopup.Show(); } }
public static DataTable SearchWitnessPerson(ATTWitnessSearch objWitnessSearch) { try { string strSelectSQL = ""; strSelectSQL = "SELECT CASE_ID,LITIGANT_ID,PERSON_ID,WITNESS_ID,WITNESSNAME,FROM_DATE,WIT_GENDER,WIT_DOB FROM VW_LITIGANTS_WITNESS WHERE 1=1"; int i = 0; if (objWitnessSearch.CaseID != null) { i++; } if (objWitnessSearch.LItigantID != null) { i++; } if (objWitnessSearch.LitigantName != null) { i++; } if (objWitnessSearch.Gender != null) { i++; } OracleParameter[] ParamArray = new OracleParameter[i]; int j = 0; if (objWitnessSearch.CaseID != null) { strSelectSQL += " AND CASE_ID = :CASETID "; ParamArray[j] = Utilities.GetOraParam(":CASETID", objWitnessSearch.CaseID, OracleDbType.Int32, ParameterDirection.Input); j++; } if (objWitnessSearch.LItigantID != null) { strSelectSQL += " AND LITIGANT_ID = :LITIGANTID "; ParamArray[j] = Utilities.GetOraParam(":LITIGANTID", objWitnessSearch.LItigantID, OracleDbType.Int32, ParameterDirection.Input); j++; } if (objWitnessSearch.LitigantName != null) { strSelectSQL += " AND LITIGANTNAME LIKE :LITIGANAME ||'%'"; ParamArray[j] = Utilities.GetOraParam(":LITIGANAME", objWitnessSearch.LitigantName, OracleDbType.Varchar2, ParameterDirection.Input); j++; } if (objWitnessSearch.Gender != null) { strSelectSQL += " AND GENTER =:GENTER ||'%'"; ParamArray[j] = Utilities.GetOraParam(":GENTER", objWitnessSearch.Gender, OracleDbType.Varchar2, ParameterDirection.Input); j++; } DataSet ds = SqlHelper.ExecuteDataset(CommandType.Text, strSelectSQL, Module.CMS, ParamArray); return((DataTable)ds.Tables[0]); } catch (OracleException oex) { PCS.COREDL.OracleError oe = new PCS.COREDL.OracleError(); throw new ArgumentException(oe.GetOraError(oex.Number, oex.Message)); } catch (Exception ex) { throw ex; } }
protected void btnAddPerson_Click(object sender, EventArgs e) { if (txtFromDate_RQD.Text == "") { this.lblStatusMessage.Text = "Enter From Date First"; this.programmaticModalPopup.Show(); return; } int iniUnit = 3; double empID = 0; int iniType = 9; int? intCountryId = null; int? intBirthDistrict = null; int? intReligion = null; ATTPerson objPerson = new ATTPerson(); if (this.txtPersonID.Text.Trim() != "") { empID = double.Parse(this.txtPersonID.Text.Trim()); } if (this.ddlCountry.SelectedIndex > 0) { intCountryId = int.Parse(this.ddlCountry.SelectedValue.ToString()); } if (this.ddlBirthDistrict.SelectedIndex > 0) { intBirthDistrict = int.Parse(this.ddlBirthDistrict.SelectedValue.ToString()); } if (this.ddlReligion.SelectedIndex > 0) { intReligion = int.Parse(this.ddlReligion.SelectedValue.ToString()); } #region "PERSONTABLE" objPerson = new ATTPerson(empID, this.txtFName_Rqd.Text.Trim(), this.txtMName.Text.Trim(), this.txtSurName_Rqd.Text.Trim(), this.txtDOB_DT.Text.Trim(), ((this.ddlGender.SelectedIndex <= 0) ? "" : (this.ddlGender.SelectedValue)), ((this.ddlMarStatus.SelectedIndex <= 0) ? "" : (this.ddlMarStatus.SelectedValue)), "", "", intCountryId, intBirthDistrict, intReligion, iniUnit, iniType, strUser, DateTime.Now, new byte[0]); //objPerson.FullName = this.txtFName_Rqd.Text.Trim() + " " + this.txtMName.Text.Trim() + " " + this.txtSurName_Rqd.Text.Trim(); objPerson.EntityType = "P"; #endregion #region "ADDRESS" int? intDistrictAddress = null; int? intVDCAddress = null; int? intWardAddress = null; string strAddressAction = ""; ATTPersonAddress PersonAddressATT = null; if (this.ddlDistrict.SelectedIndex > 0) { intDistrictAddress = int.Parse(this.ddlDistrict.SelectedValue); } if (this.ddlVDC.SelectedIndex > 0) { intVDCAddress = int.Parse(this.ddlVDC.SelectedValue); } if (this.ddlWard.SelectedIndex > 0) { intWardAddress = int.Parse(this.ddlWard.SelectedValue); } PersonAddressATT = new ATTPersonAddress ( 0, "P", 1, intDistrictAddress, intVDCAddress, intWardAddress, this.txtTole.Text.Trim(), "Y", strUser, DateTime.Now ); if (((this.ddlDistrict.SelectedIndex > 0) || (this.txtTole.Text.Trim() != "")) && (hdnPerAddress.Value != "0")) { strAddressAction = "E"; } if (((this.ddlDistrict.SelectedIndex > 0) || (this.txtTole.Text.Trim() != "")) && (hdnPerAddress.Value == "0")) { strAddressAction = "A"; } // if (((this.ddlDistrict.SelectedIndex <= 0) && (this.txtTole.Text.Trim() == "")) && (hdnPerAddress.Value != "0")) strAddressAction = "D"; if (strAddressAction != "") { PersonAddressATT.Action = strAddressAction; strAddressAction = ""; objPerson.LstPersonAddress.Add(PersonAddressATT); } strAddressAction = ""; intDistrictAddress = null; intVDCAddress = null; intWardAddress = null; if (this.ddlDistrictTemp.SelectedIndex > 0) { intDistrictAddress = int.Parse(this.ddlDistrictTemp.SelectedValue); } if (this.ddlVDCTemp.SelectedIndex > 0) { intVDCAddress = int.Parse(this.ddlVDCTemp.SelectedValue); } if (this.ddlWardTemp.SelectedIndex > 0) { intWardAddress = int.Parse(this.ddlWardTemp.SelectedValue); } PersonAddressATT = new ATTPersonAddress ( 0, "T", 1, intDistrictAddress, intVDCAddress, intWardAddress, this.txtToleTemp.Text.Trim(), "Y", strUser, DateTime.Now ); if (((this.ddlDistrictTemp.SelectedIndex > 0) || (this.txtToleTemp.Text.Trim() != "")) && (hdnTempAddress.Value != "0")) { strAddressAction = "E"; } if (((this.ddlDistrictTemp.SelectedIndex > 0) || (this.txtToleTemp.Text.Trim() != "")) && (hdnTempAddress.Value == "0")) { strAddressAction = "A"; } //if (((this.ddlDistrictTemp.SelectedIndex <= 0) && (this.txtToleTemp.Text.Trim() == "")) && (hdnTempAddress.Value != "0")) strAddressAction = "D"; if (strAddressAction != "") { PersonAddressATT.Action = strAddressAction; strAddressAction = ""; objPerson.LstPersonAddress.Add(PersonAddressATT); } #endregion #region "PHONE" foreach (GridViewRow row in this.grdPhone.Rows) { if (CheckNull.NullString(row.Cells[7].Text.ToString()) != "") { ATTPersonPhone PersonPhoneATT = new ATTPersonPhone(0, row.Cells[1].Text, int.Parse(row.Cells[3].Text.ToString()), CheckNull.NullString(row.Cells[4].Text.ToString()), CheckNull.NullString(row.Cells[5].Text.ToString()), CheckNull.NullString(row.Cells[6].Text.ToString()), strUser, DateTime.Now); PersonPhoneATT.Action = CheckNull.NullString(row.Cells[7].Text.ToString()); objPerson.LstPersonPhone.Add(PersonPhoneATT); } } #endregion #region "EMAIL" foreach (GridViewRow row in this.grdEMail.Rows) { if (CheckNull.NullString(row.Cells[7].Text.ToString()) != "") { ATTPersonEMail PersonEMailATT = new ATTPersonEMail(0, row.Cells[1].Text, int.Parse(row.Cells[3].Text.ToString()), CheckNull.NullString(row.Cells[4].Text.ToString()), CheckNull.NullString(row.Cells[5].Text.ToString()), CheckNull.NullString(row.Cells[6].Text.ToString()), strUser, DateTime.Now); PersonEMailATT.Action = CheckNull.NullString(row.Cells[7].Text.ToString()); objPerson.LstPersonEMail.Add(PersonEMailATT); } } #endregion #region "RELATIVES AND BENEFICIARIES" //foreach (GridViewRow row in this.grdEmpRelatives.Rows) //{ // int? countryID = null; // int? birthDistrict = null; // int? religionID = null; // if ( CheckNull.NullString(row.Cells[11].Text) != "") // birthDistrict = int.Parse(row.Cells[11].Text); // byte[] RelativeImageData = new byte[0]; // ATTPerson objRelativePerson = new ATTPerson // (double.Parse(row.Cells[1].Text), row.Cells[2].Text, CheckNull.NullString(row.Cells[3].Text), CheckNull.NullString(row.Cells[4].Text), // CheckNull.NullString(row.Cells[8].Text), CheckNull.NullString(row.Cells[6].Text), CheckNull.NullString(row.Cells[9].Text), "", "", // countryID, birthDistrict, religionID, iniUnit, iniType, strUser, DateTime.Now, RelativeImageData); // CheckBox cb = (CheckBox)row.Cells[17].FindControl("chkRelativeActive"); // CheckBox cbIsBen = (CheckBox)row.Cells[16].FindControl("chkIsBeneficiary"); // CheckBox cbWasBen = (CheckBox)row.Cells[20].FindControl("chkWasBeneficiary"); // ATTEmployeeBeneficiary EmpBeneficiaryATT = new ATTEmployeeBeneficiary(0, 0, null, null); // if ((cbIsBen.Checked) && (!cbWasBen.Checked)) // EmpBeneficiaryATT.Action = "A"; // else if ((!cbIsBen.Checked) && (cbWasBen.Checked)) // { // EmpBeneficiaryATT.Action = "E"; // EmpBeneficiaryATT.ToDate = DateTime.Now.Date.ToString("dd/MM/yyyy"); // } // EmpBeneficiaryATT.EntryBy = strUser; // ATTRelatives RelativesATT = new ATTRelatives(0, 0, int.Parse(row.Cells[13].Text), (cb.Checked ? "Y" : "N")); // RelativesATT.Occupation = CheckNull.NullString(row.Cells[15].Text); // RelativesATT.EntryBy = strUser; // if ( CheckNull.NullString(row.Cells[18].Text) == "A") // RelativesATT.Action = "A"; // else // RelativesATT.Action = "E"; // RelativesATT.ObjPerson = objRelativePerson; // EmpBeneficiaryATT.ObjRelatives = RelativesATT; // objEmployee.LstEmployeeBeneficiary.Add(EmpBeneficiaryATT); //} #endregion List <ATTWitnessSearch> WSearchLST = (List <ATTWitnessSearch>)Session["WSearch"]; ATTWitnessSearch objWSearch = new ATTWitnessSearch(); ATTWitnessPerson objCaesAndlitigant = (ATTWitnessPerson)Session["CaseAndLitigant"];//brought from witness person form caseID and litigantId List <ATTWitnessSearch> PersonList = new List <ATTWitnessSearch>(); objWSearch.CaseID = objCaesAndlitigant.CaseID; objWSearch.LItigantID = objCaesAndlitigant.LitigantID; objWSearch.PersonID = 0; objWSearch.WitnessID = 0; objWSearch.WitnessName = this.txtFName_Rqd.Text.Trim() + " " + this.txtMName.Text.Trim() + " " + this.txtSurName_Rqd.Text.Trim(); objWSearch.FromDate = this.txtFromDate_RQD.Text; objWSearch.Action = "A"; objWSearch.ObjPerson = objPerson; WSearchLST.Add(objWSearch); PersonList.Add(objWSearch); Session["WSearch"] = WSearchLST; this.grdPerson.DataSource = PersonList; this.grdPerson.DataBind(); ClearControls(); }