Example #1
0
 public void CreatePermit(Models.ViewModel.VVehiclePermit VehiclePermit)
 {
     using (oversiiEntities db = new oversiiEntities())
     {
         db.ApplyPermit(VehiclePermit.Vehicle.VehicleMake.VehicleMakeID, VehiclePermit.Vehicle.VehicleColor.VehicleColorID, 1, VehiclePermit.Vehicle.MakeYear, VehiclePermit.Vehicle.LicPlateNum, VehiclePermit.Vehicle.State.StateID);
     }
 }
Example #2
0
        public List<Models.DB.VehicleColor> VehicleColorList()
        {
            using (oversiiEntities db = new oversiiEntities())
            {
                List<Models.DB.VehicleColor> RS = new List<VehicleColor>();
                RS = db.VehicleColors.ToList();
                return RS;

            }
        }
Example #3
0
        public List<Models.DB.State> StateList()
        {
            using (oversiiEntities db = new oversiiEntities())
            {
                List<Models.DB.State> RS = new List<State>();
                RS = db.States.ToList();
                return RS;

            }
        }
Example #4
0
        public AuthenticateUser_Result AuthenticateUser(string email,string password)
        {
            using (oversiiEntities db = new oversiiEntities())
            {

                List<AuthenticateUser_Result> RS = new List<AuthenticateUser_Result>();
              RS = db.AuthenticateUser(email, password).ToList();
                return RS.FirstOrDefault();
            }
        }
 protected override bool AuthorizeCore(HttpContextBase httpContext)
 {
     bool authorize = false;
     using (oversiiEntities db = new oversiiEntities())
     {
         UserRepository UM = new UserRepository();
         foreach (var roles in userAssignedRoles)
         {
             authorize = UM.IsUserInRole(httpContext.User.Identity.Name, roles);
             if (authorize)
                 return authorize;
         }
     }
     return authorize;
 }
Example #6
0
        //public void AddUserAccount(UserAccount resident)
        //{
        //    using (oversiiEntities db = new oversiiEntities())
        //    {
        //        user US = new user();
        //        US.Email = resident.Email;
        //        US.Password = resident.Password;
        //        US.FirstName = resident.FirstName;
        //        US.LastName = resident.LastName;
        //        US.Phone1 = resident.Phone1;
        //        US.Phone2 = resident.Phone2;
        //        US.CreateDate = DateTime.Now;
        //        db.users.Add(US);
        //        db.SaveChanges();
        //    }
        //}
        //public bool ISEmailExist(string email)
        //{
        //    using (oversiiEntities db = new oversiiEntities())
        //    {
        //        return db.users.Where(o => o.Email.Equals(email)).Any();
        //    }
        //}
        //public string GetUserPassword(string emailid)
        //{
        //    using (oversiiEntities db = new oversiiEntities())
        //    {
        //        var user = db.users.Where(o => o.Email.ToLower().Equals(emailid));
        //        if (user.Any())
        //            return user.FirstOrDefault().Password;
        //        else
        //            return string.Empty;
        //    }
        //}
        //public string GetParkingGL(int? propID)
        //{
        //    using (oversiiEntities db = new oversiiEntities())
        //    {
        //        var parkingGL = (from pr in db.properties
        //                         where pr.propID == propID
        //                         select pr.parkingGL).FirstOrDefault();
        //        if (parkingGL != null)
        //            return parkingGL.ToString();
        //        else
        //            return null;
        //    }
        //}
        //public List<Oversii.Models.DB.property> PropertyList(string zipcode)
        //{
        //    using (oversiiEntities db = new oversiiEntities())
        //    {
        //        var propmgmtid = (from pm in db.property_management
        //                          where pm.Zipcode.Equals(zipcode)
        //                          select pm.propertyMgmtID).ToList();
        //        var propertyList = (from pr in db.properties where propmgmtid.Contains(pr.propertyMgmtID)
        //                            select pr).ToList();
        //        return propertyList;
        //    }
        //}
        public List<Models.DB.VehicleMake> VehilceMakeList()
        {
            using (oversiiEntities db = new oversiiEntities())
            {
                List<Models.DB.VehicleMake> RS = new List<VehicleMake>();
                RS = db.VehicleMakes.ToList();
                return RS;

            }
        }