Ejemplo n.º 1
0
        public void ThongTin(qtUser user)
        {
            qtDepartmentService _department = new qtDepartmentService();
            qtUnitService       _unit       = new qtUnitService();
            qtPositionService   _position   = new qtPositionService();

            ViewBag.TenPhong = _department.FindByKey(user.DepartmentId).DepartmentName;
            ViewBag.TenDonVi = _unit.FindByKey(user.UnitId).UnitName;
            ViewBag.ChucVu   = _position.FindByKey(user.PositionId).PositionName;
        }
Ejemplo n.º 2
0
        public ActionResult Create(int?id, int?UnitId)
        {
            qtDepartmentService _department = new qtDepartmentService();
            qtDepartment        department  = new qtDepartment();

            if (id.HasValue)
            {
                department = _department.FindByKey(id);
                if (department != null)
                {
                    ViewBag.UnitId = department.UnitId;
                    return(View(department));
                }
                else
                {
                    ModelState.AddModelError("", "Dữ liệu không tồn tại trong hệ thống. Vui lòng kiểm tra lại");
                    return(View(new qtDepartment()));
                }
            }

            ViewBag.UnitId = UnitId;

            return(View(department));
        }