Esempio 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);
        }
Esempio n. 2
0
        public static List <GetRegisterViewModel> GetUserDetails()
        {
            List <GetRegisterViewModel> rvml = new List <GetRegisterViewModel>();

            try
            {
                using (var entity = new HirePressEntity())
                {
                    var users = entity.AspNetUsers;
                    foreach (var user in users)
                    {
                        GetRegisterViewModel rvm = new GetRegisterViewModel();
                        ArrayList            al  = new ArrayList();
                        foreach (var role in user.AspNetRoles)
                        {
                            al.Add(role.Name);
                        }
                        rvm.Name   = user.FirstName + " " + user.LastName;
                        rvm.Email  = user.Email;
                        rvm.UserID = user.Id;
                        rvm.Roles  = al;
                        rvml.Add(rvm);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(rvml);
        }
Esempio n. 3
0
        public static bool GetFlag(string FlagName)
        {
            bool flag;

            try
            {
                using (var entity = new HirePressEntity())
                {
                    flag = entity.MasterFlags.Where(x => x.FlagName == FlagName).Select(x => x.IsFlag).SingleOrDefault();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(flag);
        }
Esempio n. 4
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;
     }
 }
Esempio n. 5
0
        public static string GetUserName(string email)
        {
            var username = "";

            try
            {
                using (var entity = new HirePressEntity())
                {
                    var data = entity.AspNetUsers.Where(x => x.Email == email).FirstOrDefault();
                    username = data.FirstName + " " + data.LastName;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(username);
        }
Esempio n. 6
0
        public static string GetSkillTypeData(string SkillType)
        {
            string data;

            try
            {
                using (var entity = new HirePressEntity())
                {
                    data = entity.MasterSkills.Where(x => x.SkillType == SkillType).Select(x => x.SkillTypeData).SingleOrDefault();
                    if (data != null)
                    {
                        return(data);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return("Not Found");
        }