public static List <ATTWitnessPerson> GetWitness(double?caseID, double?litigantID, double?personID, double?witnessID) { List <ATTWitnessPerson> WPLST = new List <ATTWitnessPerson>(); try { foreach (DataRow row in DLLWitnessPerson.getWitnessPerson(caseID, litigantID, personID, witnessID).Rows) { ATTWitnessPerson objWP = new ATTWitnessPerson(); objWP.CaseID = double.Parse(row["CASE_ID"].ToString()); objWP.LitigantType = row["LITIGANT_TYPE"].ToString(); objWP.LitigantID = double.Parse(row["LITIGANT_ID"].ToString()); objWP.LitigantName = row["LITIGANTNAME"].ToString(); objWP.PersonID = double.Parse(row["Person_ID"].ToString()); objWP.FromDate = row["FROM_DATE"] == System.DBNull.Value ? "" : row["FROM_DATE"].ToString(); objWP.WitnessName = row["WITNESSNAME"].ToString(); objWP.ToDate = ""; objWP.WitnessID = int.Parse(row["WITNESS_ID"].ToString()); objWP.Action = ""; objWP.PersonOBJ = BLLPerson.GetPersons(objWP.PersonID, null); WPLST.Add(objWP); } return(WPLST); } catch (Exception ex) { throw ex; } }
protected void btnSubmit_Click(object sender, EventArgs e) { List <ATTWitnessSearch> WSList = (List <ATTWitnessSearch>)Session["WSearch"]; List <ATTWitnessPerson> WPList = new List <ATTWitnessPerson>(); foreach (ATTWitnessSearch obj in WSList) { if (obj.Action == null || obj.Action == "") { continue; } ATTWitnessPerson objWP = new ATTWitnessPerson(); objWP.CaseID = obj.CaseID; objWP.LitigantID = obj.LItigantID; objWP.PersonID = obj.PersonID; objWP.WitnessID = obj.WitnessID; objWP.FromDate = obj.FromDate; objWP.EntryBy = entryBy; objWP.PersonOBJ = obj.ObjPerson; objWP.Action = obj.Action; WPList.Add(objWP); } Session["WPerson"] = WPList; try { if (BLLWitnessPerson.SaveWitnessPerson(WPList)) { ClearControls(); this.lblStatusMessage.Text = "Saved Successfully"; this.programmaticModalPopup.Show(); } } catch (Exception ex) { this.lblStatusMessage.Text = ex.Message; this.programmaticModalPopup.Show(); } }
protected void btnAddWitness_Click(object sender, EventArgs e) { if (grdLitigants.SelectedIndex == -1) { this.lblStatusMessage.Text = "Select Litigant First."; this.programmaticModalPopup.Show(); return; } ATTWitnessPerson att = new ATTWitnessPerson(); att.CaseID = int.Parse(grdLitigants.SelectedRow.Cells[0].Text); att.LitigantID = int.Parse(grdLitigants.SelectedRow.Cells[1].Text); Session["CaseAndLitigant"] = att; string script = ""; if (att != null) { script += "<script language='javascript' type='text/javascript'>"; script += "var win=window.open('WitnessInfo.aspx', 'popup','width=802,height=500,directories=no,location=no,menubar=no,resizable=1,scrollbars=1,status=no,toolbar=no');"; script += "</script>"; } this.ClientScript.RegisterClientScriptBlock(this.GetType(), "PCS", script); }
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(); }