Esempio n. 1
0
        public static changehistory GenerateHistory(this user user, int bussinesId, BussinesType bty, ChangeType cty, string note)
        {
            var history = new changehistory
            {
                UsersId      = user.Id,
                BussinessId  = bussinesId,
                BussinesType = bty,
                ChangeType   = cty,
                CreatedDate  = DateTime.Now,
                Note         = note
            };

            return(history);
        }
Esempio n. 2
0
        public static bool AddHistory(this user user, int bussinesId, BussinesType bty, ChangeType cty, string note)
        {
            var history = new changehistory
            {
                UsersId      = user.Id,
                BussinessId  = bussinesId,
                BussinesType = bty,
                ChangeType   = cty,
                CreatedDate  = DateTime.Now,
                Note         = note
            };

            try
            {
                using (var db = new OcphDbContext())
                {
                    return(db.Histories.Insert(history));
                }
            }
            catch (Exception)
            {
                return(false);
            }
        }