public static bool SaveLawyerPerson(ATTLawyerPerson objLawyerPerson) { GetConnection GetConn = new GetConnection(); OracleTransaction Tran = GetConn.GetDbConn(Module.LJMS).BeginTransaction(); double pID = 0; try { pID = DLLPerson.AddPersonnelDetails(objLawyerPerson, Tran); DLLLawyer.SaveLawyerDetails(pID, objLawyerPerson.LstLawyer, Tran); Tran.Commit(); return(true); } catch (Exception ex) { Tran.Rollback(); throw ex; } finally { GetConn.CloseDbConn(); } }
public static bool AddEditLitigants(List <ATTLitigants> LitigantLST, OracleTransaction Tran, double caseID) { string InsertUpdateSQL = ""; List <OracleParameter> paramArray; try { foreach (ATTLitigants obj in LitigantLST) { double litigantID = 0; if (obj.Action == "A") { InsertUpdateSQL = "SP_ADD_LITIGANTS"; } else if (obj.Action == "E") { InsertUpdateSQL = "SP_EDIT_LITIGANTS"; } if (obj.PersonOBJ != null) { litigantID = DLLPerson.AddPersonnelDetails(obj.PersonOBJ, Tran); } paramArray = new List <OracleParameter>(); paramArray.Add(Utilities.GetOraParam("P_CASE_ID", caseID, OracleDbType.Double, ParameterDirection.Input)); paramArray.Add(Utilities.GetOraParam("P_LITIGANT_ID", litigantID, OracleDbType.Double, ParameterDirection.Input)); paramArray.Add(Utilities.GetOraParam("P_LITIGANT_TYPE", obj.LitigantType, OracleDbType.Varchar2, ParameterDirection.Input)); paramArray.Add(Utilities.GetOraParam("P_LITIGANT_SUB_TYPE_ID", obj.LitigantSubTypeID, OracleDbType.Int32, ParameterDirection.Input)); paramArray.Add(Utilities.GetOraParam("P_DISPLAY_NAME", obj.DisplayName, OracleDbType.Varchar2, ParameterDirection.Input)); paramArray.Add(Utilities.GetOraParam("P_S_NO", obj.SNo, OracleDbType.Varchar2, ParameterDirection.Input)); paramArray.Add(Utilities.GetOraParam("P_IS_PRISONED", obj.IsPrisoned, OracleDbType.Varchar2, ParameterDirection.Input)); paramArray.Add(Utilities.GetOraParam("P_ENTRY_BY", obj.EntryBy, OracleDbType.Varchar2, ParameterDirection.Input)); SqlHelper.ExecuteNonQuery(Tran, CommandType.StoredProcedure, InsertUpdateSQL, paramArray.ToArray()); obj.CaseID = caseID; obj.LitigantID = litigantID; if (obj.LitigantPrisonDetailsLST.Count > 0) { DLLLitigantPrisonDetails.AddEditLitigantsPrisonDetails(obj.LitigantPrisonDetailsLST, caseID, litigantID, Tran); } } return(true); } catch (Exception ex) { Tran.Rollback(); throw ex; } }
public static bool SaveFacultyMember(ATTFacultyMember objFacultyMember) { GetConnection GetConn = new GetConnection(); OracleTransaction Tran = GetConn.GetDbConn(Module.DLPDS).BeginTransaction(); double personID; string InsertUpdatePostSql = ""; try { personID = DLLPerson.AddPersonnelDetails(objFacultyMember.ObjPerson, Tran); if (objFacultyMember.LstParticipantPost.Count > 0) { DLLParticipantPost.SaveParticipantPost(objFacultyMember.LstParticipantPost, Tran, personID); } OracleParameter[] ParamArray = new OracleParameter[5]; ParamArray[0] = Utilities.GetOraParam(":p_ORG_ID", objFacultyMember.OrgID, OracleDbType.Int32, ParameterDirection.Input); ParamArray[1] = Utilities.GetOraParam(":p_FACULTY_ID", objFacultyMember.FacultyID, OracleDbType.Int32, ParameterDirection.Input); ParamArray[2] = Utilities.GetOraParam(":p_P_ID", personID, OracleDbType.Double, ParameterDirection.Input); ParamArray[3] = Utilities.GetOraParam(":p_FROM_DATE", objFacultyMember.FromDate, OracleDbType.Varchar2, ParameterDirection.Input); ParamArray[4] = Utilities.GetOraParam(":p_TO_DATE", objFacultyMember.ToDate, OracleDbType.Varchar2, ParameterDirection.Input); if (objFacultyMember.PID == 0) { InsertUpdatePostSql = "SP_ADD_FACULTY_MEMBER"; } else if (objFacultyMember.PID > 0) { InsertUpdatePostSql = "SP_EDIT_FACULTY_MEMBER"; } SqlHelper.ExecuteNonQuery(Tran, CommandType.StoredProcedure, InsertUpdatePostSql, ParamArray); objFacultyMember.PID = personID; Tran.Commit(); return(true); } catch (OracleException oex) { PCS.COREDL.OracleError oe = new PCS.COREDL.OracleError(); throw new ArgumentException(oe.GetOraError(oex.Number, oex.Message)); } catch (Exception ex) { Tran.Rollback(); throw ex; } finally { GetConn.CloseDbConn(); } }
public static bool SaveParticipant(ATTParticipant ObjParticipant) { GetConnection GetConn = new GetConnection(); OracleTransaction Tran = GetConn.GetDbConn(Module.DLPDS).BeginTransaction(); double personID; string InsertUpdatePostSql = ""; try { personID = DLLPerson.AddPersonnelDetails(ObjParticipant.ObjPerson, Tran); if (ObjParticipant.LstParticipantPost.Count > 0) { DLLParticipantPost.SaveParticipantPost(ObjParticipant.LstParticipantPost, Tran, personID); } OracleParameter[] ParamArray = new OracleParameter[4]; ParamArray[0] = Utilities.GetOraParam(":p_ORG_ID", ObjParticipant.OrgID, OracleDbType.Int64, ParameterDirection.Input); ParamArray[1] = Utilities.GetOraParam(":p_PROGRAM_ID", ObjParticipant.ProgramID, OracleDbType.Int64, ParameterDirection.Input); ParamArray[2] = Utilities.GetOraParam(":p_P_ID", personID, OracleDbType.Double, ParameterDirection.Input); ParamArray[3] = Utilities.GetOraParam(":p_JOINING_DATE", ObjParticipant.JoiningDate, OracleDbType.Varchar2, ParameterDirection.Input); if (ObjParticipant.PID == 0) { InsertUpdatePostSql = "SP_ADD_PARTICIPANT"; } else if (ObjParticipant.PID > 0) { InsertUpdatePostSql = "SP_EDIT_PARTICIPANT"; } SqlHelper.ExecuteNonQuery(Tran, CommandType.StoredProcedure, InsertUpdatePostSql, ParamArray); ObjParticipant.PID = personID; Tran.Commit(); return(true); } catch (OracleException oex) { PCS.COREDL.OracleError oe = new PCS.COREDL.OracleError(); throw new ArgumentException(oe.GetOraError(oex.Number, oex.Message)); } catch (Exception ex) { Tran.Rollback(); throw ex; } finally { GetConn.CloseDbConn(); } }
public static ATTPerson GetPersonWithPersonnelAttributeByID(double personID) { object conn; try { conn = DLLPerson.GetConnection(); } catch (Exception ex) { throw ex; return(null); } try { DataRow row = DLLPerson.GetPersonWithPersonnelAttributeByID(conn, personID).Rows[0]; ATTPerson person = new ATTPerson(); person.PId = double.Parse(row["P_ID"].ToString()); person.FirstName = row["FIRST_NAME"].ToString(); person.MidName = row["MID_NAME"].ToString(); person.SurName = row["SUR_NAME"].ToString(); person.Gender = row["GENDER"].ToString(); person.DOB = row["DOB"].ToString(); person.MaritalStatus = row["MARTIAL_STATUS"].ToString(); person.CountryId = row["country_id"] == System.DBNull.Value ? (int?)null : int.Parse(row["country_id"].ToString()); person.BirthDistrict = row["birth_district"] == System.DBNull.Value ? (int?)null : int.Parse(row["birth_district"].ToString()); person.ReligionId = row["religion_id"] == System.DBNull.Value ? (int?)null : int.Parse(row["religion_id"].ToString()); person.Photo = row["p_photo"] as byte[]; person.LstPersonAddress = BLLPersonAddress.GetPersonAddress(conn, personID); person.LstPersonPhone = BLLPersonPhone.GetPersonPhone(conn, personID); person.LstPersonEMail = BLLPersonEMail.GetPersonEMail(conn, personID); person.LstPersonQualification = BLLPersonQualification.GetPersonQualification(conn, personID); //person.ls return(person); } catch (Exception ex) { throw ex; } finally { DLLPerson.CloseConnection(conn); } }
public static bool SaveParticipantPost(List <ATTParticipantPost> lstParticipantPost) { GetConnection GetConn = new GetConnection(); OracleTransaction Tran = GetConn.GetDbConn(Module.DLPDS).BeginTransaction(); double personID; string InsertUpdatePostSql = ""; try { personID = DLLPerson.AddPersonnelDetails(lstParticipantPost[0].ObjPerson, Tran); foreach (ATTParticipantPost lst in lstParticipantPost) { OracleParameter[] ParamArray = new OracleParameter[4]; ParamArray[0] = Utilities.GetOraParam(":P_P_ID", personID, OracleDbType.Double, ParameterDirection.Input); ParamArray[1] = Utilities.GetOraParam(":P_POST_ID", lst.PostID, OracleDbType.Int32, ParameterDirection.Input); ParamArray[2] = Utilities.GetOraParam(":P_LEVEL_ID", lst.LevelID, OracleDbType.Int32, ParameterDirection.Input); ParamArray[3] = Utilities.GetOraParam(":P_FROM_DATE", lst.FromDate, OracleDbType.Varchar2, ParameterDirection.Input); if (lst.Action == "A") { InsertUpdatePostSql = "SP_ADD_PARTICIPANT_POST"; } else if (lst.Action == "E") { InsertUpdatePostSql = "SP_EDIT_PARTICIPANT_POST"; } SqlHelper.ExecuteNonQuery(Tran, CommandType.StoredProcedure, InsertUpdatePostSql, ParamArray); } Tran.Commit(); return(true); } catch (OracleException oex) { PCS.COREDL.OracleError oe = new PCS.COREDL.OracleError(); throw new ArgumentException(oe.GetOraError(oex.Number, oex.Message)); } catch (Exception ex) { Tran.Rollback(); throw ex; } finally { GetConn.CloseDbConn(); } }
public static ATTPerson GetPersons(double personID, string personDocActive) { //List<ATTVDC> lstVDCs = new List<ATTVDC>(); ATTPerson obj = new ATTPerson(); foreach (DataRow row in DLLPerson.GetPersonDetails(personID).Rows) { obj.PId = double.Parse(row["P_ID"].ToString()); obj.FirstName = row["FIRST_NAME"].ToString(); obj.MidName = (row["MID_NAME"] == System.DBNull.Value) ? "" : row["MID_NAME"].ToString(); obj.SurName = row["SUR_NAME"].ToString(); obj.DOB = row["DOB"] == System.DBNull.Value ? "" : row["DOB"].ToString(); obj.Gender = row["GENDER"] == System.DBNull.Value ? "" : row["GENDER"].ToString(); obj.MaritalStatus = row["MARTIAL_STATUS"] == System.DBNull.Value ? "" : row["MARTIAL_STATUS"].ToString(); //this.ddlCountry.SelectedValue if (row["BIRTH_DISTRICT"] == System.DBNull.Value) { obj.BirthDistrict = null; } else { obj.BirthDistrict = int.Parse(row["BIRTH_DISTRICT"].ToString()); } //obj.BirthDistrict = row["BIRTH_DISTRICT"] == System.DBNull.Value ? 0 :int.Parse( row["BIRTH_DISTRICT"].ToString()); obj.ReligionId = row["RELIGION_ID"] == System.DBNull.Value ? 0 : int.Parse(row["RELIGION_ID"].ToString()); //this.txtIdentityMark.Text=objPerson.i obj.IniType = int.Parse(row["INI_TYPE"].ToString()); obj.IniUnit = int.Parse(row["INI_UNIT"].ToString()); obj.EntityType = row["ENTITY_TYPE"].ToString(); obj.LstPersonAddress = BLLPersonAddress.GetPersonAddress(null, obj.PId); obj.LstPersonPhone = BLLPersonPhone.GetPersonPhone(null, obj.PId); obj.LstPersonEMail = BLLPersonEMail.GetPersonEMail(null, obj.PId); obj.LstRelatives = BLLRelatives.GetRelatives(null, obj.PId); obj.LstPersonDocuments = BLLPersonDocuments.GetPersonDocuments(null, obj.PId, personDocActive); } return(obj); }
public static bool SaveLawyerDetails(ATTLawyer objLawyer) { GetConnection GetConn = new GetConnection(); OracleTransaction Tran = GetConn.GetDbConn(Module.LJMS).BeginTransaction(); double pID; try { pID = DLLPerson.AddPersonnelDetails(objLawyer.ObjPerson, Tran); objLawyer.PID = pID; if (pID > 0) { string sp = "SP_ADD_LAWYER_INFO "; OracleParameter[] paramArray = new OracleParameter[6]; paramArray[0] = Utilities.GetOraParam(":p_P_ID", pID, OracleDbType.Double, ParameterDirection.Input); paramArray[1] = Utilities.GetOraParam(":P_LAWYER_TYPE_ID", objLawyer.LawyerTypeID, OracleDbType.Int16, ParameterDirection.Input); paramArray[2] = Utilities.GetOraParam(":P_LICENSE_NO", objLawyer.LicenseNo, OracleDbType.Varchar2, ParameterDirection.Input); paramArray[3] = Utilities.GetOraParam(":P_FROM_DATE", objLawyer.FromDate, OracleDbType.Varchar2, ParameterDirection.Input); paramArray[4] = Utilities.GetOraParam(":P_TO_DATE", "", OracleDbType.Varchar2, ParameterDirection.Input); paramArray[5] = Utilities.GetOraParam(":p_ENTRY_BY", objLawyer.EntryBy, OracleDbType.Varchar2, ParameterDirection.Input); SqlHelper.ExecuteNonQuery(Tran, CommandType.StoredProcedure, sp, paramArray); if (objLawyer.LstLawyerRenewal.Count > 0) { //DLLLawyerRenewal.SaveLawyerRenewalDetails(objLawyer, Tran); DLLLawyer.SaveLawyerDetails(objLawyer); } //if (objLawyer.LstPrivateLawyer.Count > 0) //{ // DLLLawyer.SaveLawyerDetails(objLawyer); //} Tran.Commit(); return(true); } else { Tran.Rollback(); return(false); } } catch (OracleException oex) { PCS.COREDL.OracleError oe = new PCS.COREDL.OracleError(); throw new ArgumentException(oe.GetOraError(oex.Number, oex.Message)); } catch (Exception ex) { Tran.Rollback(); throw ex; } finally { GetConn.CloseDbConn(); } }
public static bool SaveEmployeeDetails(ATTEmployee objEmployee) { GetConnection GetConn = new GetConnection(); OracleTransaction Tran = GetConn.GetDbConn(Module.PMS).BeginTransaction(); double employeeID; //double relativeID = 0; try { employeeID = DLLPerson.AddPersonnelDetails(objEmployee.ObjPerson, Tran); OracleParameter[] paramArray = new OracleParameter[7]; paramArray[0] = Utilities.GetOraParam(":p_EMP_ID", employeeID, OracleDbType.Double, ParameterDirection.Input); paramArray[1] = Utilities.GetOraParam(":p_SYMBOL_NO", objEmployee.SymbolNo, OracleDbType.Varchar2, ParameterDirection.Input); paramArray[2] = Utilities.GetOraParam(":p_ORG_EMP_NO", objEmployee.OrgEmpNo, OracleDbType.Varchar2, ParameterDirection.Input); paramArray[3] = Utilities.GetOraParam(":p_IDENTITY_MARK", objEmployee.IdentityMark, OracleDbType.Varchar2, ParameterDirection.Input); paramArray[4] = Utilities.GetOraParam(":p_ENTRY_BY", objEmployee.EntryBy, OracleDbType.Varchar2, ParameterDirection.Input); paramArray[5] = Utilities.GetOraParam(":p_PF_NO", objEmployee.PFNo, OracleDbType.Varchar2, ParameterDirection.Input); paramArray[6] = Utilities.GetOraParam(":p_CIT_NO", objEmployee.CitznNo, OracleDbType.Varchar2, ParameterDirection.Input); if (objEmployee.EmpID == 0) { SqlHelper.ExecuteNonQuery(Tran, CommandType.StoredProcedure, "SP_ADD_EMPLOYEES", paramArray[0], paramArray); } else if (objEmployee.EmpID > 0) { SqlHelper.ExecuteNonQuery(Tran, CommandType.StoredProcedure, "SP_EDIT_EMPLOYEES", paramArray[0], paramArray); } if (objEmployee.LstEmployeeVisits.Count > 0) { DLLEmployeeVisits.AddEmployeeVisits(objEmployee.LstEmployeeVisits, Tran, employeeID); } if (objEmployee.LstEmployeeExperience.Count > 0) { DLLEmployeeExperience.AddEmployeeExperiences(objEmployee.LstEmployeeExperience, Tran, employeeID); } if (objEmployee.LstEmployeePosting.Count > 0) { DLLEmployeePosting.SaveEmployeePosting(objEmployee.LstEmployeePosting, Tran, employeeID); } if (objEmployee.LstEmployeePublication.Count > 0) { DLLEmployeePublication.AddEmployeePublication(objEmployee.LstEmployeePublication, Tran, employeeID); } if (objEmployee.LstEmployeeBeneficiary.Count > 0) { DLLEmployeeBeneficiary.SaveBeneficiary(objEmployee.LstEmployeeBeneficiary, Tran, employeeID); } if (objEmployee.LstInsurance.Count > 0) { DLLInsurance.SaveEmpInsurance(objEmployee.LstInsurance, Tran, employeeID); } if (objEmployee.LSTAttachments.Count > 0) { DLLPersonAttachments.SaveAttachments(objEmployee.LSTAttachments, Tran, employeeID); } if (objEmployee.ObjUser.Username != "" && objEmployee.ObjUser.Password != "") { DLLUsers.SaveUsers(objEmployee.ObjUser, Tran, employeeID); } if (objEmployee.OrgUser.Username != "") { DLLOrganizationUSers.SaveOrganizationUsers(objEmployee.OrgUser, Tran, employeeID); } if (objEmployee.LSTEmpDeputation != null) { DLLEmployeeDeputation.SaveEmpployeeDeputation(objEmployee.LSTEmpDeputation, Tran, employeeID); } if (objEmployee.LstManonayan.Count > 0) { DLLManonayan.SaveManonayan(objEmployee.LstManonayan, Tran, employeeID); } objEmployee.EmpID = employeeID; Tran.Commit(); return(true); } catch (OracleException oex) { PCS.COREDL.OracleError oe = new PCS.COREDL.OracleError(); throw new ArgumentException(oe.GetOraError(oex.Number, oex.Message)); } catch (Exception ex) { Tran.Rollback(); throw ex; } finally { GetConn.CloseDbConn(); } }
public static bool SaveMelMilaapKartaa(List <ATTMelMilaapKartaa> MMKLst, List <ATTPerson> PersonList) { GetConnection GetConn = new GetConnection(); OracleTransaction Tran = GetConn.GetDbConn(Module.CMS).BeginTransaction(); string InsertUpdateSQL = ""; try { double PID = 0; if (PersonList != null) { PID = DLLPerson.AddPersonnelDetails(PersonList, Tran); } foreach (ATTMelMilaapKartaa attMMK in MMKLst) { if (PID > 0) { attMMK.PID = PID; } if (attMMK.Action == "") { continue; } if (attMMK.Action == "A") { InsertUpdateSQL = "SP_ADD_MM_KARTAA"; } else if (attMMK.Action == "D") { InsertUpdateSQL = "SP_DEL_MM_KARTAA"; } else { InsertUpdateSQL = "SP_EDIT_MM_KARTAA"; } List <OracleParameter> paramArray = new List <OracleParameter>(); paramArray.Add(Utilities.GetOraParam(":P_ORG_ID", attMMK.OrgID, OracleDbType.Int64, ParameterDirection.Input)); paramArray.Add(Utilities.GetOraParam(":P_PERSON_ID", attMMK.PID, OracleDbType.Double, ParameterDirection.Input)); paramArray.Add(Utilities.GetOraParam(":P_FROM_DATE", attMMK.FromDate, OracleDbType.Varchar2, ParameterDirection.Input)); paramArray.Add(Utilities.GetOraParam(":P_POST", attMMK.Post, OracleDbType.Varchar2, ParameterDirection.Input)); paramArray.Add(Utilities.GetOraParam(":P_EXPERIENCE", attMMK.Experience, OracleDbType.Varchar2, ParameterDirection.Input)); paramArray.Add(Utilities.GetOraParam(":P_ENTRY_BY", attMMK.EntryBy, OracleDbType.Varchar2, ParameterDirection.Input)); SqlHelper.ExecuteNonQuery(Tran, CommandType.StoredProcedure, InsertUpdateSQL, paramArray.ToArray()); if (attMMK.OathLst != null) { foreach (ATTMelMilapKartaOath obj in attMMK.OathLst) { obj.PersonID = attMMK.PID; } DLLMelMilapKartaOath.SaveMelMilaapKartaaOath(attMMK.OathLst, Tran); } } Tran.Commit(); return(true); } catch (Exception ex) { throw ex; } finally { GetConn.CloseDbConn(); } }
public static bool SaveWitnessPerson(List <ATTWitnessPerson> LstWP) { GetConnection GetConn = new GetConnection(); OracleTransaction Tran = GetConn.GetDbConn(Module.CMS).BeginTransaction(); try { foreach (ATTWitnessPerson objWP in LstWP) { if (objWP.Action == "D" && objWP.WitnessID > 0) { string DelSql = "SP_DEL_WITNESS_PERSON"; List <OracleParameter> paramArray = new List <OracleParameter>(); paramArray.Add(Utilities.GetOraParam(":P_WITNESS_ID", objWP.WitnessID, OracleDbType.Int64, ParameterDirection.InputOutput)); SqlHelper.ExecuteNonQuery(Tran, System.Data.CommandType.StoredProcedure, DelSql, paramArray.ToArray()); } else if (objWP.Action == "A" || objWP.Action == "E") { double personID = objWP.PersonID; objWP.PersonOBJ.PId = personID; if (personID == 0) { personID = int.Parse(DLLPerson.AddPersonnelDetails(objWP.PersonOBJ, Tran).ToString()); } string InsertUpdateSQL = ""; List <OracleParameter> paramArray = new List <OracleParameter>(); paramArray.Add(Utilities.GetOraParam(":P_CASE_ID", objWP.CaseID, OracleDbType.Int64, ParameterDirection.Input)); paramArray.Add(Utilities.GetOraParam(":P_LITIGANT_ID", objWP.LitigantID, OracleDbType.Int64, ParameterDirection.Input)); paramArray.Add(Utilities.GetOraParam(":P_PERSON_ID", personID, OracleDbType.Int64, ParameterDirection.Input)); paramArray.Add(Utilities.GetOraParam(":P_FROM_DATE", objWP.FromDate, OracleDbType.Varchar2, ParameterDirection.Input)); paramArray.Add(Utilities.GetOraParam(":P_WITNESS_ID", objWP.WitnessID, OracleDbType.Int32, ParameterDirection.InputOutput)); paramArray.Add(Utilities.GetOraParam(":P_ENTRY_BY", objWP.EntryBy, OracleDbType.Varchar2, ParameterDirection.Input)); if (objWP.Action == "A") { InsertUpdateSQL = "SP_ADD_CASE_WITNESS"; } else { InsertUpdateSQL = "SP_EDIT_CASE_WITNESS"; } SqlHelper.ExecuteNonQuery(Tran, System.Data.CommandType.StoredProcedure, InsertUpdateSQL, paramArray.ToArray()); objWP.WitnessID = int.Parse(paramArray[4].Value.ToString()); } else { continue; } } Tran.Commit(); return(true); } catch (OracleException oex) { PCS.COREDL.OracleError oe = new PCS.COREDL.OracleError(); throw new ArgumentException(oe.GetOraError(oex.Number, oex.Message)); } catch (Exception ex) { Tran.Rollback(); throw ex; } finally { GetConn.CloseDbConn(); } }