Ejemplo n.º 1
0
        public IActionResult Update(string employeeGroupId)
        {
            var dal              = new EmployeeGroupDal();
            var p                = dal.Find(employeeGroupId);
            var model            = mapper.Map <EmployeeGroupUpdateModel>(p);
            var administratorDal = new AdministratorDal();

            model.Administrators = administratorDal.Query();
            return(View(model));
        }
Ejemplo n.º 2
0
        public IActionResult Delete(string employeeGroupId)
        {
            var dal = new EmployeeGroupDal();
            var p   = dal.Find(employeeGroupId);

            if (p == null)
            {
                return(Json(new { state = "error", data = "找不到这一条数据" }));
            }

            try
            {
                dal.Remove(p);
                return(Json(new { state = "ok", data = 1 }));
            }
            catch (Exception ex)
            {
                return(Json(new { state = "error", data = ex.Message }));
            }
        }