public static bool ChangeUserJobApplicantStatus(int JobApplicantID, PIKCV.COM.EnumDB.JobApplicationStates JobApplicantStates) { PIKCV.DAO.TransactionMgr Tran = PIKCV.DAO.TransactionMgr.ThreadTransactionMgr(); try { PIKCV.DAL.JobApplicants objStatus = new PIKCV.DAL.JobApplicants(); PIKCV.DAL.JobApplicationStatusChanges objStatusChanges = new PIKCV.DAL.JobApplicationStatusChanges(); Tran.BeginTransaction(); objStatus.LoadByPrimaryKey(JobApplicantID); objStatus.ApplicationStatusID = (int)JobApplicantStates; objStatus.Save(); objStatusChanges.AddNew(); objStatusChanges.JobApplicantID = JobApplicantID; objStatusChanges.ApplicationDate = DateTime.Now; objStatusChanges.ApplicationStatusID = (int)JobApplicantStates; objStatusChanges.ApplicationTitle = PIKCV.COM.Util.ReturnEmptyString(""); objStatusChanges.Save(); Tran.CommitTransaction(); return(true); } catch (Exception) { Tran.RollbackTransaction(); PIKCV.DAO.TransactionMgr.ThreadTransactionMgrReset(); return(false); } }
public bool SaveUserDriverLicenses(int UserID, ArrayList arrDriverLicenses) { PIKCV.DAO.TransactionMgr Tran = PIKCV.DAO.TransactionMgr.ThreadTransactionMgr(); try { Tran.BeginTransaction(); PIKCV.DAL.UserDriverLicense obj = new PIKCV.DAL.UserDriverLicense(); obj.Where.UserID.Value = UserID; obj.Query.Load(); obj.DeleteAll(); obj.Save(); for (int i = 0; i < arrDriverLicenses.Count; i++) { obj.AddNew(); obj.UserID = UserID; obj.DriverLicenseTypeID = Convert.ToInt32(arrDriverLicenses[i]); obj.Save(); } Tran.CommitTransaction(); return(true); } catch (Exception) { Tran.RollbackTransaction(); PIKCV.DAO.TransactionMgr.ThreadTransactionMgrReset(); return(false); } }
public bool SaveUserComputerKnowledge(int UserID, ArrayList arrComputerKnowledge) { PIKCV.DAO.TransactionMgr Tran = PIKCV.DAO.TransactionMgr.ThreadTransactionMgr(); try { PIKCV.DAL.UserComputerKnowledge obj = new PIKCV.DAL.UserComputerKnowledge(); obj.Where.UserID.Value = UserID; obj.Query.Load(); Tran.BeginTransaction(); obj.DeleteAll(); obj.Save(); obj = new PIKCV.DAL.UserComputerKnowledge(); string ComputerKnowledgeTypeID = String.Empty; for (int i = 0; i < arrComputerKnowledge.Count; i++) { obj.AddNew(); obj.UserID = UserID; if (Util.Left(arrComputerKnowledge[i].ToString(), 2) == "__") { obj.OtherComputerKnowledge = arrComputerKnowledge[i].ToString().Replace("__", ""); obj.ComputerKnowledgeTypeID = 0; } else { obj.OtherComputerKnowledge = " "; obj.ComputerKnowledgeTypeID = Convert.ToInt32(arrComputerKnowledge[i]); } obj.Save(); } PIKCV.DAL.UserCVs ObjCV = new PIKCV.DAL.UserCVs(); ObjCV.Where.UserID.Value = UserID; ObjCV.Query.Load(); ObjCV.ModifyDate = DateTime.Now; if (ObjCV.CvFocusCode < (int)PIKCV.COM.EnumDB.CVFocusCode.ComputerKnowledge) { ObjCV.CvFocusCode = (int)PIKCV.COM.EnumDB.CVFocusCode.ComputerKnowledge; } ObjCV.Save(); Tran.CommitTransaction(); return(true); } catch (Exception) { Tran.RollbackTransaction(); PIKCV.DAO.TransactionMgr.ThreadTransactionMgrReset(); return(false); } }
public int ChangeJobStatus(int CompanyID, int JobID, PIKCV.COM.EnumDB.JobStatus NewJobStatus, int CreditsToDecrease, int JobListType, DateTime EndDate, PIKCV.COM.EnumDB.JobStatus CurrentJobStatus) { PIKCV.DAO.TransactionMgr Tran = PIKCV.DAO.TransactionMgr.ThreadTransactionMgr(); try { Tran.BeginTransaction(); PIKCV.DAL.Jobs obj = new PIKCV.DAL.Jobs(); obj.LoadByPrimaryKey(JobID); if ((CurrentJobStatus == PIKCV.COM.EnumDB.JobStatus.Draft) || (EndDate < DateTime.Now)) { PIKCV.DAL.Orders objOrders = new PIKCV.DAL.Orders(); objOrders.AddNew(); objOrders.CompanyID = CompanyID; objOrders.OrderDate = DateTime.Now; objOrders.OrderTypeID = JobListType; objOrders.ProcessTypeCode = (int)PIKCV.COM.EnumDB.OrderProcessTypeCode.paid; objOrders.IsConfirmed = true; objOrders.Price = 0; objOrders.TotalCreditsUsed = CreditsToDecrease; objOrders.Save(); int LastOrderID = objOrders.OrderID; PIKCV.DAL.OrderLineItems objOL = new PIKCV.DAL.OrderLineItems(); objOL.AddNew(); objOL.CreditUsed = CreditsToDecrease; objOL.JobID = JobID; objOL.OrderID = LastOrderID; objOL.Price = 0; objOL.UserID = 0; objOL.Save(); PIKCV.DAL.Companies objCompany = new PIKCV.DAL.Companies(); objCompany.LoadByPrimaryKey(CompanyID); objCompany.Credits = objCompany.Credits - CreditsToDecrease; objCompany.Save(); obj.StartDate = DateTime.Now; obj.EndDate = DateTime.Now.AddDays(30); } obj.JobStatus = (int)NewJobStatus; obj.Save(); Tran.CommitTransaction(); return(obj.JobID); } catch (Exception) { Tran.RollbackTransaction(); PIKCV.DAO.TransactionMgr.ThreadTransactionMgrReset(); return(0); } }
public bool SaveUserReference(int UserReferenceID, int UserID, string ReferenceName, string Company, string Phone, string Position) { PIKCV.DAO.TransactionMgr Tran = PIKCV.DAO.TransactionMgr.ThreadTransactionMgr(); try { PIKCV.DAL.UserReferences obj = new PIKCV.DAL.UserReferences(); if (UserReferenceID > 0) { obj.LoadByPrimaryKey(UserReferenceID); } else { obj.AddNew(); } obj.UserID = UserID; obj.ReferenceName = PIKCV.COM.Util.ReturnEmptyString(Util.ReplaceStrForDB(ReferenceName)); obj.Company = PIKCV.COM.Util.ReturnEmptyString(Util.ReplaceStrForDB(Company)); obj.Phone = PIKCV.COM.Util.ReturnEmptyString(Util.ReplaceStrForDB(Phone.Trim())); obj.Position = PIKCV.COM.Util.ReturnEmptyString(Util.ReplaceStrForDB(Position)); PIKCV.DAL.UserCVs ObjCV = new PIKCV.DAL.UserCVs(); ObjCV.Where.UserID.Value = UserID; ObjCV.Query.Load(); if (ObjCV.RowCount < 1) { return(false); } ObjCV.ModifyDate = DateTime.Now; if (ObjCV.CvFocusCode < (int)PIKCV.COM.EnumDB.CVFocusCode.OtherChoices) { ObjCV.CvFocusCode = (int)PIKCV.COM.EnumDB.CVFocusCode.OtherChoices; } Tran.BeginTransaction(); ObjCV.Save(); obj.Save(); Tran.CommitTransaction(); return(true); } catch (Exception) { Tran.RollbackTransaction(); PIKCV.DAO.TransactionMgr.ThreadTransactionMgrReset(); return(false); } }
public bool SaveUserProhibitedCompanies(int UserID, ArrayList arrSelectedCompanies) { PIKCV.DAO.TransactionMgr Tran = PIKCV.DAO.TransactionMgr.ThreadTransactionMgr(); try { PIKCV.DAL.UserCVs ObjCV = new PIKCV.DAL.UserCVs(); PIKCV.DAL.UserProhibitedCompanies objUserProhibites = new PIKCV.DAL.UserProhibitedCompanies(); objUserProhibites.Where.UserID.Value = UserID; objUserProhibites.Query.Load(); Tran.BeginTransaction(); objUserProhibites.DeleteAll(); objUserProhibites.Save(); objUserProhibites = new PIKCV.DAL.UserProhibitedCompanies(); for (int i = 0; i < arrSelectedCompanies.Count; i++) { objUserProhibites.AddNew(); objUserProhibites.UserID = UserID; objUserProhibites.CompanyID = Convert.ToInt32(arrSelectedCompanies[i]); objUserProhibites.Save(); } ObjCV.Where.UserID.Value = UserID; ObjCV.Query.Load(); if (ObjCV.CvFocusCode < (int)PIKCV.COM.EnumDB.CVFocusCode.References) { ObjCV.CvFocusCode = (int)PIKCV.COM.EnumDB.CVFocusCode.References; } ObjCV.ModifyDate = DateTime.Now; ObjCV.Save(); Tran.CommitTransaction(); return(true); } catch (Exception) { Tran.RollbackTransaction(); PIKCV.DAO.TransactionMgr.ThreadTransactionMgrReset(); return(false); } }
public static bool JobToApply(int UserID, int JobID) { PIKCV.DAO.TransactionMgr Tran = PIKCV.DAO.TransactionMgr.ThreadTransactionMgr(); PIKCV.DAL.JobApplicants obj; PIKCV.DAL.JobApplicationStatusChanges objLog = new PIKCV.DAL.JobApplicationStatusChanges(); try { obj = new PIKCV.DAL.JobApplicants(); objLog = new PIKCV.DAL.JobApplicationStatusChanges(); Tran.BeginTransaction(); obj.Where.UserID.Value = UserID; obj.Where.JobID.Value = JobID; obj.Query.Load(); if (obj.RowCount < 1) { obj.AddNew(); } obj.ApplicationDate = DateTime.Now; obj.UserID = UserID; obj.ApplicationStatusID = (int)PIKCV.COM.EnumDB.JobApplicationStates.NotExaminet; obj.JobID = JobID; obj.Save(); int m_Identity = obj.JobApplicantID; objLog.AddNew(); objLog.ApplicationDate = DateTime.Now; objLog.ApplicationStatusID = (int)PIKCV.COM.EnumDB.JobApplicationStates.NotExaminet; objLog.ApplicationTitle = " "; objLog.JobApplicantID = m_Identity; objLog.Save(); Tran.CommitTransaction(); return(true); } catch (Exception) { Tran.RollbackTransaction(); PIKCV.DAO.TransactionMgr.ThreadTransactionMgrReset(); return(false); } }
public static bool SaveUserTestResults(int UserID, PIKCV.COM.EnumDB.TestTypeCode TestTypeCode, DataTable dtResults) { PIKCV.DAO.TransactionMgr Tran = PIKCV.DAO.TransactionMgr.ThreadTransactionMgr(); PIKCV.DAL.UserTestResults obj = new PIKCV.DAL.UserTestResults(); obj.Where.UserID.Value = UserID; obj.Query.Load(); if (!obj.EOF) { return(false); } try { Tran.BeginTransaction(); obj = new PIKCV.DAL.UserTestResults(); PIKCV.DAL.UserCVs objUserCV = new PIKCV.DAL.UserCVs(); objUserCV.Where.UserID.Value = UserID; objUserCV.Query.Load(); objUserCV.TestMatDate = DateTime.Now; objUserCV.Save(); foreach (DataRow dr in dtResults.Rows) { obj.AddNew(); obj.TestTypeCode = (int)TestTypeCode; obj.UserID = UserID; obj.QuestionNo = Convert.ToInt32(dr["QuestionNo"]); obj.TestQuestionID = Convert.ToInt32(dr["TestQuestionID"]); obj.TestAnswerID = Convert.ToInt32(dr["TestAnswerID"]); obj.Save(); } Tran.CommitTransaction(); return(true); } catch (Exception) { Tran.RollbackTransaction(); PIKCV.DAO.TransactionMgr.ThreadTransactionMgrReset(); return(false); } }
public static bool SaveUserTestPerfection(int UserID, DataTable dtResults) { PIKCV.DAO.TransactionMgr Tran = PIKCV.DAO.TransactionMgr.ThreadTransactionMgr(); PIKCV.DAL.UserTestPerfectionResults obj = new PIKCV.DAL.UserTestPerfectionResults(); obj.Where.UserID.Value = UserID; obj.Query.Load(); if (!obj.EOF) { return(false); } try { obj = new PIKCV.DAL.UserTestPerfectionResults(); Tran.BeginTransaction(); obj = new PIKCV.DAL.UserTestPerfectionResults(); PIKCV.DAL.UserCVs objUserCV = new PIKCV.DAL.UserCVs(); objUserCV.Where.UserID.Value = UserID; objUserCV.Query.Load(); objUserCV.TestYetDate = DateTime.Now; objUserCV.Save(); foreach (DataRow dr in dtResults.Rows) { obj.AddNew(); obj.UserID = UserID; obj.TestPerfectionID = Convert.ToInt32(dr["TestPerfectionID"]); obj.AnswerPoint = Convert.ToInt32(dr["AnswerPoint"]); obj.Save(); } Tran.CommitTransaction(); return(true); } catch (Exception) { Tran.RollbackTransaction(); PIKCV.DAO.TransactionMgr.ThreadTransactionMgrReset(); return(false); } }
public bool SavePlacementPreferences(int UserID, ArrayList arrSelectedCities, ArrayList arrSelectedCountries, bool HasTravelDifficulty, ArrayList arrLabouringTypes, bool IsSmoking) { PIKCV.DAO.TransactionMgr Tran = PIKCV.DAO.TransactionMgr.ThreadTransactionMgr(); try { PIKCV.DAL.UserPlacementPreferences objPlacementPreferences = new PIKCV.DAL.UserPlacementPreferences(); PIKCV.DAL.UserCVs ObjCV = new PIKCV.DAL.UserCVs(); PIKCV.DAL.UserLabouringTypes objLabouringTypes = new PIKCV.DAL.UserLabouringTypes(); objPlacementPreferences.Where.UserID.Value = UserID; objPlacementPreferences.Query.Load(); objLabouringTypes.Where.UserID.Value = UserID; objLabouringTypes.Query.Load(); Tran.BeginTransaction(); objPlacementPreferences.DeleteAll(); objPlacementPreferences.Save(); objLabouringTypes.DeleteAll(); objLabouringTypes.Save(); objLabouringTypes = new PIKCV.DAL.UserLabouringTypes(); for (int i = 0; i < arrLabouringTypes.Count; i++) { objLabouringTypes.AddNew(); objLabouringTypes.UserID = UserID; objLabouringTypes.LabouringTypeID = Convert.ToInt32(arrLabouringTypes[i]); objLabouringTypes.Save(); } for (int i = 0; i < arrSelectedCities.Count; i++) { objPlacementPreferences.AddNew(); objPlacementPreferences.UserID = UserID; objPlacementPreferences.PlaceTypeCode = (int)PIKCV.COM.EnumDB.PlaceTypes.TurkeyCity; if (Util.Left(arrSelectedCities[i].ToString(), 2) == "__") { objPlacementPreferences.OtherPlace = arrSelectedCities[i].ToString().Replace("__", ""); objPlacementPreferences.PlaceID = 0; } else { objPlacementPreferences.OtherPlace = " "; objPlacementPreferences.PlaceID = Convert.ToInt32(arrSelectedCities[i]); } objPlacementPreferences.Save(); } for (int i = 0; i < arrSelectedCountries.Count; i++) { objPlacementPreferences.AddNew(); objPlacementPreferences.UserID = UserID; objPlacementPreferences.PlaceTypeCode = (int)PIKCV.COM.EnumDB.PlaceTypes.Country; objPlacementPreferences.PlaceID = Convert.ToInt32(arrSelectedCountries[i]); objPlacementPreferences.OtherPlace = " "; objPlacementPreferences.Save(); } ObjCV.Where.UserID.Value = UserID; ObjCV.Query.Load(); if (ObjCV.CvFocusCode < (int)PIKCV.COM.EnumDB.CVFocusCode.ProhibitedCompanies) { ObjCV.CvFocusCode = (int)PIKCV.COM.EnumDB.CVFocusCode.ProhibitedCompanies; } ObjCV.ModifyDate = DateTime.Now; ObjCV.HasTravelDifficulty = HasTravelDifficulty; ObjCV.IsSmoking = IsSmoking; ObjCV.Save(); Tran.CommitTransaction(); return(true); } catch (Exception) { Tran.RollbackTransaction(); PIKCV.DAO.TransactionMgr.ThreadTransactionMgrReset(); return(false); } }
public bool SaveEmploymentChooices(int UserID, ArrayList arrSelectedSectors, ArrayList arrSelectedPositions, PIKCV.COM.EnumDB.EmployeeTypes EmployeeType) { PIKCV.DAO.TransactionMgr Tran = PIKCV.DAO.TransactionMgr.ThreadTransactionMgr(); try { PIKCV.DAL.UserSectors objSectors = new PIKCV.DAL.UserSectors(); PIKCV.DAL.UserPositions objPositions = new PIKCV.DAL.UserPositions(); PIKCV.DAL.UserCVs ObjCV = new PIKCV.DAL.UserCVs(); PIKCV.DAL.User ObjUser = new PIKCV.DAL.User(); objSectors.Where.UserID.Value = UserID; objPositions.Where.UserID.Value = UserID; objSectors.Query.Load(); objPositions.Query.Load(); Tran.BeginTransaction(); objSectors.DeleteAll(); objSectors.Save(); objPositions.DeleteAll(); objPositions.Save(); for (int i = 0; i < arrSelectedPositions.Count; i++) { objPositions.AddNew(); objPositions.UserID = UserID; objPositions.PositionID = Convert.ToInt32(arrSelectedPositions[i]); objPositions.Save(); } for (int i = 0; i < arrSelectedSectors.Count; i++) { objSectors.AddNew(); objSectors.UserID = UserID; objSectors.SectorID = Convert.ToInt32(arrSelectedSectors[i]); objSectors.Save(); } ObjCV.Where.UserID.Value = UserID; ObjCV.Query.Load(); ObjCV.ModifyDate = DateTime.Now; if (ObjCV.CvFocusCode < (int)PIKCV.COM.EnumDB.CVFocusCode.PlacementPreferences) { ObjCV.CvFocusCode = (int)PIKCV.COM.EnumDB.CVFocusCode.PlacementPreferences; } ObjCV.Save(); ObjUser.LoadByPrimaryKey(UserID); ObjUser.EmployeeTypeCode = (int)EmployeeType; ObjUser.Save(); Tran.CommitTransaction(); return(true); } catch (Exception) { Tran.RollbackTransaction(); PIKCV.DAO.TransactionMgr.ThreadTransactionMgrReset(); return(false); } }
public bool SaveEducation(int UserEducationID, int UserID, PIKCV.COM.EnumDB.EducationTypes EducationTypeCode, int SchoolID, int EducationStatusID, DateTime StartDate, DateTime EndDate, string OtherSchool, int DepartmentID, string OtherDepartment, int CountryID, int CityID, string OtherCity, string Degree, bool IsDeleted) { PIKCV.DAO.TransactionMgr Tran = PIKCV.DAO.TransactionMgr.ThreadTransactionMgr(); try { PIKCV.DAL.UserEducation obj = new PIKCV.DAL.UserEducation(); if (UserEducationID > 0) { obj.LoadByPrimaryKey(UserEducationID); } else { obj.AddNew(); } obj.CityID = CityID; obj.CountryID = CountryID; string mDegree = Util.ReplaceStrForDB(Degree.Trim()); if (mDegree == "") { mDegree = "0"; } obj.Degree = float.Parse(mDegree); obj.DepartmentID = DepartmentID; obj.EducationStatusID = EducationStatusID; obj.EducationTypeCode = (int)EducationTypeCode; if (EducationStatusID.ToString() == ((int)PIKCV.COM.EnumDB.EducationStates.Graduate).ToString()) { obj.EndDate = EndDate; } else { obj.EndDate = StartDate.AddYears(-1); } obj.IsDeleted = IsDeleted; obj.OtherCity = PIKCV.COM.Util.ReturnEmptyString(Util.ReplaceStrForDB(OtherCity)); obj.OtherDepartment = PIKCV.COM.Util.ReturnEmptyString(Util.ReplaceStrForDB(OtherDepartment)); obj.OtherSchool = PIKCV.COM.Util.ReturnEmptyString(Util.ReplaceStrForDB(OtherSchool)); obj.SchoolID = SchoolID; obj.StartDate = StartDate; obj.UserID = UserID; PIKCV.DAL.UserCVs ObjCV = new PIKCV.DAL.UserCVs(); ObjCV.Where.UserID.Value = UserID; ObjCV.Query.Load(); if (ObjCV.RowCount < 1) { return(false); } ObjCV.ModifyDate = DateTime.Now; if (ObjCV.CvFocusCode < (int)PIKCV.COM.EnumDB.CVFocusCode.Education) { ObjCV.CvFocusCode = (int)PIKCV.COM.EnumDB.CVFocusCode.Education; } Tran.BeginTransaction(); ObjCV.Save(); obj.Save(); Tran.CommitTransaction(); return(true); } catch (Exception) { Tran.RollbackTransaction(); PIKCV.DAO.TransactionMgr.ThreadTransactionMgrReset(); return(false); } }
public bool SaveUserLanguage(int UserLanguageID, int UserID, int ForeignLanguageID, int ReadLevelID, int WriteLevelID, int SpeakLevelID, string PlaceLearned, int ForeignLanguageExamID, string ExamDegree) { PIKCV.DAO.TransactionMgr Tran = PIKCV.DAO.TransactionMgr.ThreadTransactionMgr(); try { PIKCV.DAL.UserLanguages obj = new PIKCV.DAL.UserLanguages(); if (UserLanguageID > 0) { obj.LoadByPrimaryKey(UserLanguageID); } else { obj.AddNew(); } obj.ForeignLanguageID = ForeignLanguageID; obj.PlaceLearned = PIKCV.COM.Util.ReturnEmptyString(Util.ReplaceStrForDB(PlaceLearned)); obj.WriteLevelID = WriteLevelID; obj.SpeakLevelID = SpeakLevelID; obj.ReadLevelID = ReadLevelID; obj.UserID = UserID; obj.ForeignLanguageExamID = ForeignLanguageExamID; string mExamDegree = Util.ReplaceStrForDB(ExamDegree.Trim()); if (mExamDegree == "") { mExamDegree = "0"; } obj.ExamDegree = float.Parse(mExamDegree); PIKCV.DAL.UserCVs ObjCV = new PIKCV.DAL.UserCVs(); ObjCV.Where.UserID.Value = UserID; ObjCV.Query.Load(); if (ObjCV.RowCount < 1) { return(false); } ObjCV.ModifyDate = DateTime.Now; if (ObjCV.CvFocusCode < (int)PIKCV.COM.EnumDB.CVFocusCode.ComputerKnowledge) { ObjCV.CvFocusCode = (int)PIKCV.COM.EnumDB.CVFocusCode.ComputerKnowledge; } Tran.BeginTransaction(); ObjCV.Save(); obj.Save(); Tran.CommitTransaction(); return(true); } catch (Exception) { Tran.RollbackTransaction(); PIKCV.DAO.TransactionMgr.ThreadTransactionMgrReset(); return(false); } }
public bool InsertInterview(int CompanyID, int CompanyAdvisorID, DateTime InterviewDate, DateTime InterviewEndTime, PIKCV.COM.EnumDB.MemberTypes InterviewerTypeCode, string InterviewPlace, DateTime InterviewStartTime, int PositionID, int UpdatedBy, ArrayList arrSelectedUsers, string CompanyAdvisorName) { PIKCV.DAO.TransactionMgr Tran = PIKCV.DAO.TransactionMgr.ThreadTransactionMgr(); try { PIKCV.DAL.Interviews objInterview = new PIKCV.DAL.Interviews(); PIKCV.DAL.Messages objMessage = new PIKCV.DAL.Messages(); PIKCV.DAL.User objUser = new PIKCV.DAL.User(); PIKCV.DAL.Companies objCompany = new PIKCV.DAL.Companies(); string MessageBody = ""; Tran.BeginTransaction(); for (int i = 0; i < arrSelectedUsers.Count; i++) { objInterview.AddNew(); objInterview.CompanyAdvisorID = CompanyAdvisorID; objInterview.CreateDate = DateTime.Now; objInterview.InterviewDate = InterviewDate; objInterview.InterviewEndTime = InterviewEndTime; objInterview.InterviewerID = CompanyID; objInterview.InterviewerTypeCode = (int)InterviewerTypeCode; objInterview.InterviewNotes = PIKCV.COM.Util.ReturnEmptyString(String.Empty); objInterview.InterviewPlace = InterviewPlace; objInterview.InterviewRating = 0; objInterview.InterviewStartTime = InterviewStartTime; objInterview.InterviewStatusID = 1; objInterview.JobID = 0; objInterview.PositionID = PositionID; objInterview.ModifyDate = DateTime.Now; objInterview.UpdatedBy = UpdatedBy; objInterview.UserID = Convert.ToInt32(arrSelectedUsers[i]); objInterview.Save(); objUser.LoadByPrimaryKey(Convert.ToInt32(arrSelectedUsers[i])); objCompany.LoadByPrimaryKey(CompanyID); MessageBody = objCompany.CompanyName + " þirketi tarafýndan mülakata çaðrýldýnýz" + "<br><br>Tarih: " + InterviewDate.ToShortDateString() + "<br><br>Saat: " + InterviewStartTime.Hour.ToString() + ":" + InterviewStartTime.Minute.ToString() + "-" + InterviewEndTime.Hour.ToString() + ":" + InterviewEndTime.Minute.ToString() + "<br><br>Yer: " + InterviewPlace + "<br><br>Danýþman: " + CompanyAdvisorName; objMessage.AddNew(); objMessage.CreateDate = DateTime.Now; objMessage.IsDeleted = false; objMessage.IsRead = false; objMessage.JobID = 0; objMessage.MessageOwnerID = Convert.ToInt32(arrSelectedUsers[i]); objMessage.MessageOwnerTypeCode = (int)PIKCV.COM.EnumDB.MemberTypes.Employee; objMessage.MessageTitle = "Mülakat Daveti"; objMessage.MessageBody = MessageBody; objMessage.MessageTypeCode = (int)PIKCV.COM.EnumDB.MessageTypeCode.Interview; objMessage.SenderID = CompanyID; objMessage.SenderTypeCode = (int)PIKCV.COM.EnumDB.MemberTypes.Company; objMessage.Save(); } Tran.CommitTransaction(); return(true); } catch (Exception) { Tran.RollbackTransaction(); PIKCV.DAO.TransactionMgr.ThreadTransactionMgrReset(); return(false); } }
public bool SaveUserEmployment(int UserEmploymentID, int UserID, string CompanyName, string CompanyPhone, bool CanReference, int CityID, string OtherCityName, int CountryID, bool IsWorking, DateTime StartDate, DateTime EndDate, string JobDefiniton, int LabouringTypeID, int PositionID, string ReasonOfResignation, int SectorID) { PIKCV.DAO.TransactionMgr Tran = PIKCV.DAO.TransactionMgr.ThreadTransactionMgr(); try { PIKCV.DAL.UserEmployment obj = new PIKCV.DAL.UserEmployment(); if (UserEmploymentID > 0) { obj.LoadByPrimaryKey(UserEmploymentID); } else { obj.AddNew(); } obj.CompanyName = PIKCV.COM.Util.ReturnEmptyString(Util.ReplaceStrForDB(CompanyName)); obj.CompanyPhone = PIKCV.COM.Util.ReturnEmptyString(Util.ReplaceStrForDB(CompanyPhone)); obj.CanReference = CanReference; obj.CityID = CityID; obj.OtherCityName = PIKCV.COM.Util.ReturnEmptyString(Util.ReplaceStrForDB(OtherCityName)); obj.IsWorking = IsWorking; obj.CountryID = CountryID; obj.StartDate = StartDate; if (StartDate < EndDate) { obj.EndDate = EndDate; } obj.JobDescription = PIKCV.COM.Util.ReturnEmptyString(Util.ReplaceStrForDB(JobDefiniton)); obj.LabouringTypeID = LabouringTypeID; obj.PositionID = PositionID; obj.ReasonOfResignation = PIKCV.COM.Util.ReturnEmptyString(Util.ReplaceStrForDB(ReasonOfResignation)); obj.SectorID = SectorID; obj.UserID = UserID; PIKCV.DAL.UserCVs ObjCV = new PIKCV.DAL.UserCVs(); ObjCV.Where.UserID.Value = UserID; ObjCV.Query.Load(); if (ObjCV.RowCount < 1) { return(false); } ObjCV.ModifyDate = DateTime.Now; if (ObjCV.CvFocusCode < (int)PIKCV.COM.EnumDB.CVFocusCode.DriverLicense) { ObjCV.CvFocusCode = (int)PIKCV.COM.EnumDB.CVFocusCode.DriverLicense; } Tran.BeginTransaction(); ObjCV.Save(); obj.Save(); Tran.CommitTransaction(); return(true); } catch (Exception) { Tran.RollbackTransaction(); PIKCV.DAO.TransactionMgr.ThreadTransactionMgrReset(); return(false); } }
public int InsertCreditOrders(int CompanyID, int CreditPackageID, int CreditQuantity, double ItemPrice, int OtherPackageQuantity , double OtherPackagePrice, PIKCV.COM.EnumDB.OrderTypeCode OrderTypeCode, PIKCV.COM.EnumDB.PaymentType PaymentType, bool IsOtherPackage) { PIKCV.DAO.TransactionMgr Tran = PIKCV.DAO.TransactionMgr.ThreadTransactionMgr(); Tran.BeginTransaction(); int TakenCredit = 0; try { if (PaymentType == PIKCV.COM.EnumDB.PaymentType.Loan) { double TotalMoney = 0; if (CreditPackageID > 0) { TotalMoney = CreditQuantity * ItemPrice; TakenCredit = CreditQuantity; } else { TotalMoney = OtherPackageQuantity * OtherPackagePrice; TakenCredit = OtherPackageQuantity; } PIKCV.DAL.Companies objCompany = new PIKCV.DAL.Companies(); objCompany.LoadByPrimaryKey(CompanyID); objCompany.MaxLoan = objCompany.MaxLoan - TotalMoney; objCompany.Credits = objCompany.Credits + TakenCredit; objCompany.Save(); } PIKCV.DAL.CreditOrders objCreditOrders = new PIKCV.DAL.CreditOrders(); objCreditOrders.AddNew(); objCreditOrders.CompanyID = CompanyID; objCreditOrders.CreditPackageID = CreditPackageID; objCreditOrders.Quantity = CreditQuantity; objCreditOrders.ItemPrice = ItemPrice; objCreditOrders.OtherPackageQuantity = OtherPackageQuantity; objCreditOrders.OtherPackagePrice = OtherPackagePrice; objCreditOrders.OrderDate = DateTime.Now; objCreditOrders.OrderCode = Util.CreateRandomNumber(12); objCreditOrders.OrderTypeID = (int)OrderTypeCode; objCreditOrders.PaymentType = (int)PaymentType; objCreditOrders.Save(); PIKCV.DAL.Orders objOrder = new PIKCV.DAL.Orders(); objOrder.AddNew(); objOrder.CompanyID = CompanyID; if (PaymentType == PIKCV.COM.EnumDB.PaymentType.Transfer) { objOrder.IsConfirmed = false; objOrder.ProcessTypeCode = (int)PIKCV.COM.EnumDB.OrderProcessTypeCode.non_invoiced; } else { objOrder.IsConfirmed = true; objOrder.ProcessTypeCode = (int)PIKCV.COM.EnumDB.OrderProcessTypeCode.unpaid; } objOrder.OrderDate = DateTime.Now; objOrder.OrderTypeID = (int)OrderTypeCode; if (IsOtherPackage) { objOrder.Price = OtherPackageQuantity * OtherPackagePrice; objOrder.TotalCreditsUsed = OtherPackageQuantity; } else { objOrder.Price = CreditQuantity * ItemPrice; objOrder.TotalCreditsUsed = CreditQuantity; } objOrder.Save(); Tran.CommitTransaction(); return(objCreditOrders.CreditOrderID); } catch (Exception) { Tran.RollbackTransaction(); PIKCV.DAO.TransactionMgr.ThreadTransactionMgrReset(); return(0); } }
public int SaveApproval(int CompanyID, int JobID, int JobStatus, bool IsCompanyNameHidden, ref int NewCredit) { PIKCV.DAO.TransactionMgr Tran = PIKCV.DAO.TransactionMgr.ThreadTransactionMgr(); try { Tran.BeginTransaction(); PIKCV.DAL.Jobs obj = new PIKCV.DAL.Jobs(); obj.LoadByPrimaryKey(JobID); if (JobStatus != (int)PIKCV.COM.EnumDB.JobStatus.Draft) { //ilanýn pik kredisini þirketten düþelim PIKCV.DAL.OrderTypes objOrderType = new PIKCV.DAL.OrderTypes(); objOrderType.LoadByPrimaryKey(obj.JobListType); int CreditsSpend = 0; PIKCV.COM.EnumDB.EmployeeTypes EmployeeTypes = (PIKCV.COM.EnumDB.EmployeeTypes)(obj.UserTypeID); switch (EmployeeTypes) { case PIKCV.COM.EnumDB.EmployeeTypes.Pikpool: CreditsSpend = objOrderType.PikPoolCredit; break; case PIKCV.COM.EnumDB.EmployeeTypes.Goodpik: CreditsSpend = objOrderType.GoodPikCredit; break; } PIKCV.DAL.Companies objCompany = new PIKCV.DAL.Companies(); objCompany.LoadByPrimaryKey(CompanyID); NewCredit = objCompany.Credits - CreditsSpend; objCompany.Credits = NewCredit; objCompany.Save(); PIKCV.DAL.Orders objOrders = new PIKCV.DAL.Orders(); objOrders.AddNew(); objOrders.CompanyID = CompanyID; objOrders.OrderDate = DateTime.Now; objOrders.OrderTypeID = obj.JobListType; objOrders.ProcessTypeCode = (int)PIKCV.COM.EnumDB.OrderProcessTypeCode.paid; objOrders.IsConfirmed = true; objOrders.Price = 0; objOrders.TotalCreditsUsed = CreditsSpend; objOrders.Save(); int LastOrderID = objOrders.OrderID; PIKCV.DAL.OrderLineItems objOL = new PIKCV.DAL.OrderLineItems(); objOL.AddNew(); objOL.CreditUsed = CreditsSpend; objOL.JobID = JobID; objOL.OrderID = LastOrderID; objOL.Price = 0; objOL.UserID = 0; objOL.Save(); //ilanýn pik kredisi düþürüldü þimdi ilaný kaydedelim } obj.JobStatus = JobStatus; obj.IsCompanyNameHidden = IsCompanyNameHidden; obj.ModifyDate = DateTime.Now; obj.Save(); Tran.CommitTransaction(); return(obj.JobID); } catch (Exception) { Tran.RollbackTransaction(); PIKCV.DAO.TransactionMgr.ThreadTransactionMgrReset(); return(0); } }