Как исправить ошибку "не удается неявно преобразовать тип 'int' в 'string'" в ' qual.employee_id = recruitment.employee_id; '? мой код выглядит следующим образом
public class QualificationService { public void SaveQualificationDetails(RecruitmentViewModel recruitment) { Qualification qual = new Qualification(); qual.Employee_Id = recruitment.Employee_Id; qual.University = recruitment.University; qual.Highest_Qualification = recruitment.Highest_Qualification; qual.Specialization = recruitment.Specialization; qual.GradeResult = recruitment.GradeResult; qual.CV = recruitment.CV; qual.Application_Later = recruitment.Application_Later; qual.Recomendation_Later = recruitment.Recomendation_Later; using (HRMSEntities qualContext = new HRMSEntities()) { qualContext.Qualification.Add(qual); qualContext.SaveChanges(); } } } }
Что я уже пробовал:
я новичок в этом деле asp.net mvc5. но меня пробовали больше в зависимости от этого образца
[HttpPost] public ActionResult Login(LoginModel model, string returnUrl = "") { if (ModelState.IsValid) { int modelID = int.Parse(model.EMP_ID); var user = db.EMPLOYEEs.Where(u => u.EMP_ID == modelID && u.EMP_PASSWORD == model.EMP_PASSWORD).FirstOrDefault(); if ( user !=null) { var roles = db.EMPLOYEEs.Select(m => m.RoleROLE_ID).ToArray(); CustomPrincipalSerializeModel serializeModel = new CustomPrincipalSerializeModel(); serializeModel.UserId = user.EMP_ID; serializeModel.FirstName = user.EMP_FIRST_NAME; serializeModel.LastName = user.EMP_LAST_NAME; serializeModel.roles = user.RoleROLE_ID;