Esempio n. 1
0
        public EmpDepositeItem GetById(int id)
        {
            Mapper.CreateMap <EmployeeDeposite, EmpDepositeItem>();
            EmployeeDeposite objDep     = DBContext.EmployeeDeposites.SingleOrDefault(m => m.DepId == id);
            EmpDepositeItem  objDepItem = Mapper.Map <EmpDepositeItem>(objDep);

            return(objDepItem);
        }
Esempio n. 2
0
        public int Update(EmpDepositeItem model)
        {
            Mapper.CreateMap <EmpDepositeItem, EmployeeDeposite>();
            EmployeeDeposite objDep = DBContext.EmployeeDeposites.SingleOrDefault(m => m.DepId == model.DepId);

            objDep = Mapper.Map(model, objDep);
            return(DBContext.SaveChanges());
        }
Esempio n. 3
0
 public int Insert(EmpDepositeItem model)
 {
     try
     {
         Mapper.CreateMap <EmpDepositeItem, EmployeeDeposite>();
         EmployeeDeposite objempDeposite = Mapper.Map <EmployeeDeposite>(model);
         DBContext.EmployeeDeposites.Add(objempDeposite);
         return(DBContext.SaveChanges());
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }