Ejemplo n.º 1
0
 public List<OptometristModel> GetOptometrists()
 {
     using (var optometristrepo = new OptometristRepository())
     {
         return optometristrepo.GetAll().Select(x => new OptometristModel() { OptometristId = x.OptometristId, LocationId = x.LocationId, OptometristName = x.OptometristName, Email = x.Email, Cell = x.Cell }).ToList();
     }
 }
Ejemplo n.º 2
0
 public OptometristModel GetById(int id)
 {
     using (var repo = new OptometristRepository())
     {
         return GetOptometrists().Find(x => x.OptometristId == id);
     }
 }
Ejemplo n.º 3
0
 //public List<OptometristView> GetOptometrist()
 //{
 //    using (var optometristrepo = new OptometristRepository())
 //    {
 //        return optometristrepo.GetAll().Select(x => new OptometristView() { OptometristName =x.OptometristName }).ToList();
 //    }
 //}
 //public OptometristModel GetByBranchId(int id)
 //{
 //    using (var repo = new OptometristRepository())
 //    {
 //        return GetOptometrists().Find(x => x.BranchId == id);
 //    }
 //}
 public void Dispose(bool disposing)
 {
     using (var repo = new OptometristRepository())
     {
         repo.Dispose();
     }
 }
Ejemplo n.º 4
0
 public void Delete(OptometristModel optometristView)
 {
     using (var repo = new OptometristRepository())
     {
         var bo = new Optometrist();
         bo = repo.GetById(optometristView.OptometristId);
         repo.Delete(bo);
     }
 }
Ejemplo n.º 5
0
        public void Insert(OptometristModel optometristView)
        {
            using (var repo = new OptometristRepository())
            {
                var op = new Optometrist();

                {

                    op.LocationId = optometristView.LocationId;
                    op.OptometristName = optometristView.OptometristName;
                    op.Cell = optometristView.Cell;
                    op.Email = optometristView.Email;

                }

                repo.Insert(op);

            }
        }
Ejemplo n.º 6
0
 public void Update(OptometristModel optometristView)
 {
     using (var repo = new OptometristRepository())
     {
         var op = new Optometrist();
         op = repo.GetById(optometristView.OptometristId);
         if (true)
         {
             op.LocationId = optometristView.LocationId;
             op.OptometristName = optometristView.OptometristName;
             op.Cell = optometristView.Cell;
             op.Email = optometristView.Email;
         }
         repo.Update(op);
     }
 }