Exemplo n.º 1
0
        public static bool SetMasterSkills(string SkillType, string SkillTypeData)
        {
            bool flag;

            try
            {
                using (var entity = new HirePressEntity())
                {
                    var exist = entity.MasterSkills.Where(x => x.SkillType == SkillType).FirstOrDefault();
                    if (exist == null)
                    {
                        MasterSkills MS = new MasterSkills()
                        {
                            SkillType     = SkillType,
                            SkillTypeData = SkillTypeData
                        };
                        entity.MasterSkills.Add(MS);
                        entity.SaveChanges();
                        flag = true;
                    }
                    else
                    {
                        exist.SkillTypeData       = SkillTypeData;
                        entity.Entry(exist).State = System.Data.Entity.EntityState.Modified;
                        entity.SaveChanges();
                        flag = true;
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(flag);
        }
Exemplo n.º 2
0
 public static void CreateUserDetails(RegisterViewModel rvm)
 {
     try
     {
         using (var entity = new HirePressEntity())
         {
             var data = entity.AspNetUsers.Where(x => x.Email == rvm.Email).FirstOrDefault();
             data.FirstName           = rvm.FirstName;
             data.LastName            = rvm.LastName;
             entity.Entry(data).State = System.Data.Entity.EntityState.Modified;
             entity.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }