Exemplo n.º 1
0
        public void Update(ModifyEmployee model)
        {
            StoreManagerDBContext db = new StoreManagerDBContext();
            Employee e = db.Employees.SingleOrDefault(x => x.ID == model.ID);

            e.Name    = model.Name;
            e.Birth   = new DateTime(model.Year, model.Month, model.Day);
            e.Address = model.Address;
            e.Gender  = model.Gender;
            e.Phone   = model.Phone;
            db.SaveChanges();
        }
Exemplo n.º 2
0
        public void Insert(ModifyEmployee model)
        {
            StoreManagerDBContext db = new StoreManagerDBContext();
            Employee e = new Employee();

            e.ID       = GetNextID();
            e.Name     = model.Name;
            e.StatusID = 1;
            e.Birth    = new DateTime(model.Year, model.Month, model.Day);
            e.Gender   = model.Gender;
            e.Address  = model.Address;
            e.username = model.Username;
            e.Phone    = model.Phone;
            db.Employees.Add(e);
            db.SaveChanges();
        }