Example #1
0
        public int Update()
        {
            int rowsUpdated = -1;

            try
            {
                byte[]   BytEmp = Convert.FromBase64String(Entity64);
                Employee emp    = (Employee)ViewModelUtils.Deserializer(BytEmp);
                emp.Title        = Title;
                emp.Firstname    = Firstname;
                emp.Lastname     = Lastname;
                emp.Phoneno      = Phoneno;
                emp.Email        = Email;
                emp.DepartmentId = new ObjectId(DepartmentId);
                rowsUpdated      = _dao.Update(emp);
            }
            catch (Exception e)
            {
                ViewModelUtils.ErrorRoutine(e, "EmployeeViewModel", "Update");
            }
            return(rowsUpdated);
        }