Ejemplo n.º 1
0
        public RePaymentItem GetById(int id)
        {
            Mapper.CreateMap <Repayment_Master, RePaymentItem>();
            Repayment_Master objRep     = DbContext.Repayment_Master.SingleOrDefault(m => m.Id == id);
            RePaymentItem    objRepItem = Mapper.Map <RePaymentItem>(objRep);

            return(objRepItem);
        }
Ejemplo n.º 2
0
        public int Update(RePaymentItem model)
        {
            model.Date = System.DateTime.Now;
            Mapper.CreateMap <RePaymentItem, Repayment_Master>();
            Repayment_Master objRep = DbContext.Repayment_Master.SingleOrDefault(m => m.Id == model.Id);

            objRep = Mapper.Map(model, objRep);
            return(DbContext.SaveChanges());
        }
Ejemplo n.º 3
0
        public int Insert(RePaymentItem model)
        {
            Repayment_Master objPayItem = new Repayment_Master();

            //  objPayItem.CompId = model.CompId;
            objPayItem.EmpId   = model.EmpId;
            objPayItem.Payment = model.Payment;
            objPayItem.Month   = model.Month;
            objPayItem.Year    = model.Year;
            objPayItem.CompId  = model.CompId;
            objPayItem.Date    = model.Date;
            DbContext.Repayment_Master.Add(objPayItem);
            return(DbContext.SaveChanges());
        }