Ejemplo n.º 1
0
 public int Insert(UserForeignLanguage uf)
 {
     try
     {
         db.UserForeignLanguages.Add(uf);
         db.SaveChanges();
         return uf.ID;
     }
     catch
     {
         return -1;
     }
 }
 public int Insert(JobMajor ins)
 {
     try
     {
         db.JobMajors.Add(ins);
         db.SaveChanges();
         return(ins.JobID);
     }
     catch (Exception e)
     {
         return(-1);
     }
 }
 public int Insert(UserExperience us)
 {
     try
     {
         db.UserExperiences.Add(us);
         db.SaveChanges();
         return(us.ID);
     }
     catch (Exception e)
     {
         return(-1);
     }
 }
 public bool Insert(ProjectMember pm)
 {
     try
     {
         db.ProjectMembers.Add(pm);
         db.SaveChanges();
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
 public bool Insert(OfferJob of)
 {
     try
     {
         db.OfferJobs.Add(of);
         db.SaveChanges();
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
 public bool InsertCandidate(SavedCandidate savedCandidate)
 {
     try
     {
         db.SavedCandidates.Add(savedCandidate);
         db.SaveChanges();
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
 public bool InsertWorkInvitation(WorkInvitation workInvitation)
 {
     try
     {
         db.WorkInvitations.Add(workInvitation);
         db.SaveChanges();
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
 public bool InsertUserMajor(UserMajor userMajor)
 {
     try
     {
         db.UserMajors.Add(userMajor);
         db.SaveChanges();
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
 public int Insert(Project pr)
 {
     try
     {
         db.Projects.Add(pr);
         db.SaveChanges();
         return(pr.ProjectID);
     }
     catch (Exception e)
     {
         return(-1);
     }
 }
 public bool Insert(Enterprise ins)
 {
     try
     {
         db.Enterprises.Add(ins);
         db.SaveChanges();
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
 public bool InsertEmployee(Employee employee)
 {
     try
     {
         db.Employees.Add(employee);
         db.SaveChanges();
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
 public int Insert(UserCertificate uc)
 {
     try
     {
         db.UserCertificates.Add(uc);
         db.SaveChanges();
         return(uc.ID);
     }
     catch
     {
         return(-1);
     }
 }
 public bool Insert(Article ac)
 {
     try
     {
         db.Articles.Add(ac);
         db.SaveChanges();
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
Ejemplo n.º 14
0
 public bool InsertInterview(Interview interview)
 {
     try
     {
         db.Interviews.Add(interview);
         db.SaveChanges();
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
Ejemplo n.º 15
0
 public bool Insert(ProjectSkill ps)
 {
     try
     {
         db.ProjectSkills.Add(ps);
         db.SaveChanges();
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
Ejemplo n.º 16
0
 public bool InsertUniversity(University university)
 {
     try
     {
         university.UniversityID = Guid.NewGuid();
         db.Universities.Add(university);
         db.SaveChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Ejemplo n.º 17
0
 public bool Delete(Guid id)
 {
     try
     {
         var user = db.Users.Find(id);
         db.Users.Remove(user);
         db.SaveChanges();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
 public bool UpdateStatus(Guid userId, Guid offerId, String status)
 {
     try
     {
         var candidate = findCandidate(userId, offerId);
         candidate.Status = status;
         db.SaveChanges();
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
 public bool IncreaseAmount(int categoryID)
 {
     try
     {
         var cg = db.CategoryArticles.Find(categoryID);
         cg.Amount += 1;
         db.SaveChanges();
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
 public bool SendMessage(int accID, int projectID, string message)
 {
     try
     {
         var mes = new Message();
         mes.ToProject = projectID;
         mes.FromUser  = accID;
         mes.Message1  = message;
         mes.Date      = DateTime.Now;
         db.Messages.Add(mes);
         db.SaveChanges();
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
Ejemplo n.º 21
0
        public Guid createAccount(string email, string pass, string typeOfAccount)
        {
            var newAccount = new Account();

            newAccount.AccountName     = email;
            newAccount.AccountPassword = pass;
            newAccount.CreateDate      = DateTime.Now;
            newAccount.UserId          = Guid.NewGuid();
            newAccount.VisitFirstTime  = true;
            newAccount.TypeOfAccount   = typeOfAccount;
            if (typeOfAccount == "User" || typeOfAccount == "Employee")
            {
                newAccount.Status = "Complete";
            }
            else
            {
                newAccount.Status = "Request";
            }
            db.Accounts.Add(newAccount);
            db.SaveChanges();
            return(newAccount.UserId);
        }