Exemplo n.º 1
0
        public BLLBudget Insert(BLLBudget entity)
        {
            DALBudget dalBudget = GetDALBudget(entity);

            _db.AddToBudgets(dalBudget);
            _db.SaveChanges();
            entity.Id = dalBudget.ID;
            return(entity);
        }
Exemplo n.º 2
0
 internal static DALBudget GetDALBudget(BLLBudget bllBudget)
 {
     return(new DALBudget
     {
         Amount = bllBudget.Amount,
         Date = bllBudget.Date,
         ID = bllBudget.Id,
         IsActive = bllBudget.IsActive,
         Note = bllBudget.Note,
         ProjectHeadID = bllBudget.ProjectHeadId
     });
 }
Exemplo n.º 3
0
        public bool Update(BLLBudget entity)
        {
            DALBudget dalBudget = GetDALBudget(entity.ProjectHeadId);

            if (dalBudget == null)
            {
                return(false);
            }
            dalBudget.Amount   = entity.Amount;
            dalBudget.Date     = entity.Date;
            dalBudget.IsActive = entity.IsActive;
            dalBudget.Note     = entity.Note;
            return(_db.SaveChanges() > 0);
        }