示例#1
0
        public bool SaveRecruitment(Recruitment recr)
        {
            try
            {
                foreach (var ev in recr.Events)
                {
                    if (GetRecruitmentEventById(ev.Id) == null)
                    {
                        SaveRecruitmentEvwnt(ev);
                    }
                    else
                    {
                        UpdatateRecruitmentEvent(ev);
                    }
                }

                db.Recruitments.Add(recr);
                db.SaveChanges();
                return(true);
            }
            catch (Exception)
            {
                //WriteErrorLog("Nieudany zapis rekrutacji");
                return(false);
            }
        }
示例#2
0
 public bool UpdatateRecruitment(Recruitment rec)
 {
     try
     {
         db.Entry(rec).State = EntityState.Modified;
         db.SaveChanges();
         return(true);
     }
     catch (Exception e)
     {
         //WriteErrorLog("Nieudana aktualizacja ogłoszenia " + DateTime.Now);
         return(false);
     }
 }
示例#3
0
        public bool RemoveRecruitmentById(long id)
        {
            try
            {
                JobOffer jo = GetJobOfferByOfferNumber(id);
                db.JobOffers.Remove(jo);

                Recruitment r = db.Recruitments.Find(id);

                db.Recruitments.Remove(r);
                db.SaveChanges();

                return(true);
            }
            catch (Exception e)
            {
                string s = e.StackTrace;
                //WriteErrorLog("Nieudany usunięcie ogłoszenia " + DateTime.Now);
                return(false);
            }
        }