//public Guid createEmployeeType(EmployeeType EmployeeType) //{ // context.EmployeeTypes.Add(EmployeeType); // context.SaveChanges(); // return EmployeeType.Id; //} //public IList<EmployeeType> GetEmployeeTypes() //{ // return context.EmployeeTypes.ToList(); //} //public EmployeeType GetEmployeType(Guid id) //{ // return context.EmployeeTypes.Include("Person").Where(ps => ps.Id == id).FirstOrDefault(); //} //Employment public Guid createEmploymentHistory(EmploymentHistory EmploymentHistory) { context.EmploymentHistorys.Add(EmploymentHistory); context.SaveChanges(); return(EmploymentHistory.Id); }
public JsonResult DeleteEmploymentHistory(EmploymentHistory employmentHistory) { var isSuccess = true; var message = string.Empty; const string url = "/EmploymentHistory/Index"; permission = (RoleSubModuleItem)cacheProvider.Get(cacheKey) ?? roleSubModuleItemService.GetRoleSubModuleItemBySubModuleIdandRole(url, Helpers.UserSession.GetUserFromSession().RoleId); if (permission.DeleteOperation == true) { isSuccess = this.employmentHistoryService.DeleteEmploymentHistory(employmentHistory.Id); if (isSuccess) { message = "EmploymentHistory deleted successfully!"; } else { message = "EmploymentHistory can't be deleted!"; } } else { message = Resources.ResourceCommon.MsgNoPermissionToDelete; } return(Json(new { isSuccess = isSuccess, message = message }, JsonRequestBehavior.AllowGet)); }
public void AddEmploymentHistory(EmploymentHistory employmentHistory) { HumanResourcesDBEntities db = new HumanResourcesDBEntities(); db.EmploymentHistory.Add(employmentHistory); db.SaveChanges(); }
public bool UpdateEmploymentHistory(EmploymentHistory employmentHistory, int profileID) { if (!String.IsNullOrEmpty(employmentHistory.Position) && !String.IsNullOrEmpty(employmentHistory.Company)) { if (employmentHistory.EmploymentHistoryID == -2) { return(false); } else if (employmentHistory.EmploymentHistoryID == -1) { // Add new employmentHistory.ProfileID = profileID; employmentHistory.IsDeleted = false; this.EmploymentHistoryRepository.Insert(employmentHistory); this.Save(); } else { // Update employmentHistory.ProfileID = profileID; employmentHistory.IsDeleted = false; this.EmploymentHistoryRepository.Update(employmentHistory); this.Save(); } return(true); } return(false); }
public ActionResult CreateEmployment(EmployeeVM viewModel, int id) { try { EmploymentHistory hist = new EmploymentHistory(); hist.EmployeeId = id; hist.CompanyName = viewModel.CompanyName; hist.CompanyLocation = viewModel.CompanyLocation; hist.Designation = viewModel.Designation; hist.From = viewModel.From; hist.To = viewModel.To; db.EmploymentHistory.Add(hist); db.SaveChanges(); return(RedirectToAction("Details", new { id = id })); } catch (Exception ex) { //TempData["Toastr"] = Toastr.DbError(ex.Message); } return(RedirectToAction("Details", new { id = id })); }
/// <summary> /// Saves the employment history information. /// </summary> /// <param name="employmentHistoryInfo">The employment history information.</param> /// <returns></returns> /// <exception cref="ArgumentNullException">employmentHistoryInfo</exception> public string SaveEmploymentHistoryInfo(IEmploymentHistoryView employmentHistoryInfo) { if (employmentHistoryInfo == null) throw new ArgumentNullException(nameof(employmentHistoryInfo)); var result = string.Empty; var newRecord = new EmploymentHistory { EmployeeId = employmentHistoryInfo.EmployeeId, CompanyName = employmentHistoryInfo.CompanyName, StartDate = employmentHistoryInfo.StartDate, EndDate = employmentHistoryInfo.EndDate, ReasonExit = employmentHistoryInfo.ReasonExit, LevelOnExit = employmentHistoryInfo.LevelOnExit, JobFunction = employmentHistoryInfo.JobFunction, DateCreated = employmentHistoryInfo.DateCreated, IsActive = true }; try { using ( var dbContext = (HRMSEntities) this.dbContextFactory.GetDbContext(ObjectContextType.HRMS)) { dbContext.EmploymentHistories.Add(newRecord); dbContext.SaveChanges(); } } catch (Exception e) { result = string.Format("SaveEmploymentHistoryInfo - {0} , {1}", e.Message, e.InnerException != null ? e.InnerException.Message : ""); } return result; }
public IActionResult assignStudentCompany(employmentViewModel model) { int studentId = int.Parse(model.selectedStudent); var studentcomp = _employRepo.GetAllEmploymentHistory().Where(sc => sc.CompID == model.compy_id && sc.ID == studentId).FirstOrDefault(); if (studentcomp == null) { EmploymentHistory employment = new EmploymentHistory() { CompID = model.compy_id, StudentId = studentId, StartDate = model.StartDate, //EndDate = model.EndDate }; _employRepo.AddEmploymentHistory(employment); return(RedirectToAction("index")); } else { ModelState.AddModelError("duplicate", "Error in key vale"); List <Student> studentlist = _student.GetAllStudent().ToList(); employmentViewModel employmentView = new employmentViewModel() { studentlist = studentlist }; return(View(employmentView)); } }
public EmploymentHistoryDtl(EmploymentHistory emp) { if (emp != null) { emp.Convert <EmploymentHistoryDtl>(this); } }
// DELETE: api/EmploymentHistory/5 public IHttpActionResult Delete(int id) { EmploymentHistory result = employmentHistoryList.Where(p => p.ID == id).FirstOrDefault(); var resultflag = employmentHistoryList.Remove(result); return(Ok(resultflag)); }
internal static Profile Create() { var profile = new Profile() { PersonName = "Sudhanshu Mishra", Summary = "Sudhanshu is a pragmatic, passionate and result oriented developer par excellence." }; var school1 = new School() { Name = "Visveswaraiah Technological University", Certificate = CertificateType.Degree, Headline = "Bachelor of Engineering", Description = "Major in Telecommunication", StartMonth = 7, StartYear = 1999, EndMonth = 5, EndYear = 2003 }; var school2 = new School() { Name = "St. Xavier's", Certificate = CertificateType.HighSchool, Headline = "High School", Description = "Physics, Chemistry, Matchs and English", StartMonth = 4, StartYear = 1996, EndMonth = 4, EndYear = 1997 }; Education education = new Education() { school1, school2 }; profile.Education = education; var position1 = new Position() { Title = "Senior Developer", IsCurrent = true, Tenure = "2011 - 2015", Employer = "Saxo Bank A/S", Role = "Senior Developer, Lead", Responsibilities = "Leading the Open API team in India", Achievements = "Super cool", Technologies = ".NET, C#, ASP.NET MVC, Web API, MSSQL 2014" }; EmploymentHistory employmentHistory = new EmploymentHistory() { position1 }; profile.EmploymentHistory = employmentHistory; return(profile); }
public async Task <IActionResult> Edit(int id, [Bind("ID,EmployeeID,CompanyId,CertificateID,InstituteID,JobStarttDate,JobEndDate")] EmploymentHistory employmentHistory) { if (id != employmentHistory.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(employmentHistory); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EmploymentHistoryExists(employmentHistory.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["CertificateID"] = new SelectList(_context.Certificate, "CertificateID", "CertificateName", employmentHistory.CertificateID); ViewData["CompanyId"] = new SelectList(_context.Company, "CompanyId", "Branch_Name", employmentHistory.CompanyId); ViewData["EmployeeID"] = new SelectList(_context.Employee, "EmployeeID", "FirstName", employmentHistory.EmployeeID); ViewData["InstituteID"] = new SelectList(_context.Set <Institute>(), "InstituteID", "InstituteName", employmentHistory.InstituteID); return(View(employmentHistory)); }
public async Task <int> InsertEmploymentHistory(EmploymentHistory employmentHistory) { StringBuilder query = new StringBuilder(); query.Append("INSERT INTO "); query.Append(TableName); query.Append(" ("); query.Append("[CompanyName]"); query.Append(",[Position]"); query.Append(",[CityOfEmployment]"); query.Append(",[StartDate]"); query.Append(",[EndDate]"); query.Append(",[CurrentPlaceOfEmployment]"); query.Append(",[ShowInCv]"); query.Append(") "); query.Append(" OUTPUT INSERTED.EmploymentHistoryId "); query.Append(" VALUES "); query.Append("("); query.Append("@CompanyName"); query.Append(", @Position"); query.Append(", @CityOfEmployment"); query.Append(", @StartDate"); query.Append(", @EndDate"); query.Append(", @CurrentPlaceOfEmployment"); query.Append(", @ShowInCv"); query.Append(")"); try { using (IDbConnection connection = _manager.GetSqlConnection()) { var employmentHistoryId = await connection.QueryFirstAsync <int>(query.ToString(), new { employmentHistory.CompanyName, employmentHistory.Position, employmentHistory.CityOfEmployment, employmentHistory.StartDate, employmentHistory.EndDate, employmentHistory.CurrentPlaceOfEmployment, employmentHistory.ShowInCv }); string updateQuery = $"UPDATE {TableName} SET [PositionInCv] = {employmentHistoryId} WHERE [EmploymentHistoryId] = {employmentHistoryId}"; await connection.ExecuteAsync(updateQuery); return(employmentHistoryId); } } catch (Exception e) { Logger.Log(e); } return(-1); }
/// <summary> /// Imports data from the given character sheet informations. /// </summary> /// <param name="serial">The serialized character sheet</param> private void Import(SerializableCharacterSheetBase serial) { // Bio m_name = serial.Name; homeStation = serial.HomeStationID; Birthday = serial.Birthday; Race = serial.Race; Bloodline = serial.BloodLine; Ancestry = serial.Ancestry; Gender = serial.Gender; CorporationName = serial.CorporationName; CorporationID = serial.CorporationID; AllianceName = serial.AllianceName; AllianceID = serial.AllianceID; FreeSkillPoints = serial.FreeSkillPoints; AvailableReMaps = serial.FreeRespecs; JumpCloneLastJumpDate = serial.CloneJumpDate; LastReMapDate = serial.LastRespecDate; LastReMapTimed = serial.LastTimedRespec; RemoteStationDate = serial.RemoteStationDate; JumpActivationDate = serial.JumpActivationDate; JumpFatigueDate = serial.JumpFatigueDate; JumpLastUpdateDate = serial.JumpLastUpdateDate; Balance = serial.Balance; // Read clone status override, or "Auto" AccountStatusMode cloneState; if (Enum.TryParse(serial.CloneState ?? "", out cloneState)) { AccountStatusSettings = cloneState; } var settingsChar = serial as SerializableSettingsCharacter; if (settingsChar != null) { // Info m_label = settingsChar.Label ?? string.Empty; ShipName = settingsChar.ShipName; ShipTypeName = settingsChar.ShipTypeName; SecurityStatus = settingsChar.SecurityStatus; LastKnownLocation = settingsChar.LastKnownLocation; // Employment History EmploymentHistory.Import(settingsChar.EmploymentHistory); } // Attributes m_attributes[(int)EveAttribute.Intelligence].Base = serial.Attributes.Intelligence; m_attributes[(int)EveAttribute.Perception].Base = serial.Attributes.Perception; m_attributes[(int)EveAttribute.Willpower].Base = serial.Attributes.Willpower; m_attributes[(int)EveAttribute.Charisma].Base = serial.Attributes.Charisma; m_attributes[(int)EveAttribute.Memory].Base = serial.Attributes.Memory; // Skills Skills.Import(serial.Skills, serial is SerializableAPICharacterSheet); UpdateMasteries(); }
/// <summary> /// Binds EmploymentHistory Info Requested through Query Strings /// </summary> protected void BindEmploymentHistoryInfo() { OMMDataContext context = new OMMDataContext(); if (context.Contacts.FirstOrDefault(P => P.ID == _ContactID) == null) { //pnlEmpHistory.Visible = true; ShowNotFoundMessage(); } else { //pnlEmpHistory.Visible = false; if (_IsEditMode) { EmploymentHistory entity = context.EmploymentHistories.FirstOrDefault(P => P.ID == _ID && P.ContactID == _ContactID);//dao.GetByID(_ID); if (entity == null) { //pnlEmpHistory.Visible = false; ShowNotFoundMessage(); } else { } } } }
public async Task <IActionResult> PutEmploymentHistory(int id, EmploymentHistory employmentHistory) { if (id != employmentHistory.Id) { return(BadRequest()); } _context.Entry(employmentHistory).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EmploymentHistoryExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <EmploymentHistory> > PostEmploymentHistory(EmploymentHistory employmentHistory) { _context.employmentHistories.Add(employmentHistory); await _context.SaveChangesAsync(); return(CreatedAtAction("GetEmploymentHistory", new { id = employmentHistory.Id }, employmentHistory)); }
public ActionResult DeleteConfirmed(int id) { EmploymentHistory employmentHistory = db.EmploymentHistory.Find(id); db.EmploymentHistory.Remove(employmentHistory); db.SaveChanges(); return(RedirectToAction("Details", "Employe", new { Id = employmentHistory.EmployeeId })); }
public ActionResult Remove(int id) { EmploymentHistory employmentHistory = _repository.Get(id); _repository.Remove(employmentHistory); return(RedirectToAction("EmploymentHistoryManagement")); }
public ActionResult DeleteConfirmed(int id) { EmploymentHistory employmenthistory = db.EmploymentHistories.Find(id); db.EmploymentHistories.Remove(employmenthistory); db.SaveChanges(); return(RedirectToAction("Index")); }
/// <summary> /// The get pfr statistic. /// </summary> /// <param name="batches"> /// The batches. /// </param> /// <returns> /// The <see cref="PfrStatisticInfo"/> . /// </returns> private PfrStatisticInfo GetPfrStatistic(IEnumerable <Batch> batches) { var session = ObjectFactory.GetInstance <ISessionFactory>().GetCurrentSession(); var result = new PfrStatisticInfo(); foreach (var batch in batches) { var message = batch.Messages.FirstOrDefault(); if (message != null) { var countQr = session.QueryOver <QueryResponse>().Where(x => x.Message.Id == message.Id).RowCount(); result.TotalRecordCount += countQr; EmploymentHistory employmentHistory = null; InsuredPerson person = null; var foundRecordCount = session.QueryOver <QueryResponse>() .JoinAlias(x => x.EmploymentHistories, () => employmentHistory) .Where(x => x.Message.Id == message.Id) .RowCount(); var insuredRecordCount = session.QueryOver <QueryResponse>() .JoinAlias(x => x.EmploymentHistories, () => employmentHistory) .JoinAlias(x => employmentHistory.InsuredPerson, () => person) .Where(x => x.Message.Id == message.Id) .And(x => person.Status.Id == StatusPerson.Active) .RowCount(); var employedRecordCount = session.QueryOver <QueryResponse>() .JoinAlias(x => x.EmploymentHistories, () => employmentHistory) .JoinAlias(x => employmentHistory.InsuredPerson, () => person) .Where(x => x.Message.Id == message.Id) .And(x => person.Status.Id == StatusPerson.Active) .And(x => employmentHistory.Employment) .RowCount(); result.NotFoundRecordCount += countQr - foundRecordCount; result.InsuredRecordCount += insuredRecordCount; result.EmployedRecordCount += employedRecordCount; switch (batch.Type.Id) { case ExchangeFileType.PfrData: result.FoundByDataRecordCount += foundRecordCount; break; case ExchangeFileType.PfrSnils: result.FoundBySnilsRecordCount += foundRecordCount; break; } } } return(result); }
public IActionResult EmploymentHistory(EmploymentHistory employmentHistory) { if (ModelState.IsValid) { HttpContext.Session.SetString("EmploymentHistory", JsonConvert.SerializeObject(employmentHistory)); return(RedirectToAction("Availability")); } return(View()); }
// // GET: /EmploymentHistory/Details/5 public ActionResult Details(int id = 0) { EmploymentHistory employmenthistory = db.EmploymentHistories.Find(id); if (employmenthistory == null) { return(HttpNotFound()); } return(View(employmenthistory)); }
public ActionResult Update(EmploymentHistory employmentHistory) { if (ModelState.IsValid) { _repository.Update(employmentHistory); return(JavaScript("reload();")); } return(PartialView("_EditEmploymentHistoryPartialView", employmentHistory)); }
// // GET: /EmploymentHistory/Edit/5 public ActionResult Edit(int id = 0) { EmploymentHistory employmenthistory = db.EmploymentHistories.Find(id); if (employmenthistory == null) { return(HttpNotFound()); } ViewBag.PersonalInfoId = new SelectList(db.PersonalInformations, "Id", "FathersName", employmenthistory.PersonalInfoId); return(View(employmenthistory)); }
public ActionResult Edit(EmploymentHistory employmentHistory) { if (ModelState.IsValid) { db.Entry(employmentHistory).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Details", "Employe", new { Id = employmentHistory.EmployeeId })); } ViewBag.EmployeeId = new SelectList(db.Employee, "Id", "Name", employmentHistory.EmployeeId); return(View(employmentHistory)); }
public ActionResult UpdateEmploymentHistroy(EmploymentHistoryViewModel employmentHistoryViewModel) { _db = new ApplicationDbContext(); EmploymentHistory employmentHistory = Mapper.Map <EmploymentHistoryViewModel, EmploymentHistory>(employmentHistoryViewModel); _db.Entry(employmentHistory).State = System.Data.Entity.EntityState.Modified; _db.SaveChanges(); return(RedirectToAction("EmploymentHistoryMgtView")); }
public ActionResult Edit([Bind(Include = "Id_EmploymentHistory,EmploymentDate,DateOfDismissal,Id_Employee,Experience")] EmploymentHistory employmentHistory) { if (ModelState.IsValid) { db.Entry(employmentHistory).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Id_Employee = new SelectList(db.Employees, "Id_Employee", "FullName", employmentHistory.Id_Employee); return(View(employmentHistory)); }
public ActionResult AddEmploymentHistory(EmploymentHistoryViewModel employmentHistoryViewModel) { EmploymentHistory employmentHistory = Mapper.Map <EmploymentHistoryViewModel, EmploymentHistory>(employmentHistoryViewModel); ApplicationDbContext db = new ApplicationDbContext(); db.EmploymentHistories.Add(employmentHistory); db.SaveChanges(); return(RedirectToAction("EmploymentHistoryMgtView")); }
public ActionResult Edit(EmploymentHistory employmenthistory) { if (ModelState.IsValid) { db.Entry(employmenthistory).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.PersonalInfoId = new SelectList(db.PersonalInformations, "Id", "FathersName", employmenthistory.PersonalInfoId); return(View(employmenthistory)); }
/// <summary> /// Imports data from the given character info. /// </summary> /// <param name="serial">The serialized character info</param> internal void Import(SerializableAPICharacterInfo serial) { ShipName = serial.ShipName; ShipTypeName = serial.ShipTypeName; SecurityStatus = serial.SecurityStatus; LastKnownLocation = serial.LastKnownLocation; EmploymentHistory.Import(serial.EmploymentHistory); EveMonClient.OnCharacterInfoUpdated(this); }
public bool UpdateEmploymentHistory(EmploymentHistory employmentHistory, int profileID) { if (!String.IsNullOrEmpty(employmentHistory.Position) && !String.IsNullOrEmpty(employmentHistory.Company)) { if (employmentHistory.EmploymentHistoryID == -2) { return false; } else if (employmentHistory.EmploymentHistoryID == -1) { // Add new employmentHistory.ProfileID = profileID; employmentHistory.IsDeleted = false; this.EmploymentHistoryRepository.Insert(employmentHistory); this.Save(); } else { // Update employmentHistory.ProfileID = profileID; employmentHistory.IsDeleted = false; this.EmploymentHistoryRepository.Update(employmentHistory); this.Save(); } return true; } return false; }