Ejemplo n.º 1
0
        public ActionResult Create()
        {
            EmployeeListDTO employee = new EmployeeListDTO();

            ManagerDAL objManagerDAL = new ManagerDAL();

            employee.Managers = objManagerDAL.Get().Select(x => new Manager
            {
                ManagerId   = x._id.ToString(),
                ManagerName = x.ManagerName
            }).ToList();

            return(View(employee));
        }
Ejemplo n.º 2
0
        public ActionResult Edit(string id)
        {
            EmployeeDAL     objDal   = new EmployeeDAL();
            EmployeeListDTO employee = objDal.GetById(id);

            ManagerDAL objManagerDAL = new ManagerDAL();

            employee.Managers = objManagerDAL.Get().Select(x => new Manager
            {
                ManagerId   = x._id.ToString(),
                ManagerName = x.ManagerName
            }).ToList();

            return(View(employee));
        }
Ejemplo n.º 3
0
        public ActionResult Edit(EmployeeListDTO obj)
        {
            EmployeeDAL objDal = new EmployeeDAL();

            ManagerDAL objManagerDAL = new ManagerDAL();

            obj.Manager = objManagerDAL.Get().
                          Where(x => x._id.ToString() == obj.ManagerId).
                          Select(x => new Manager
            {
                ManagerId   = x._id.ToString(),
                ManagerName = x.ManagerName
            }).First();

            objDal.UpdateById(obj);
            return(RedirectToAction("Detail", new { id = obj._id.ToString() }));
        }
Ejemplo n.º 4
0
        public ActionResult Create(EmployeeListDTO obj)
        {
            ManagerDAL objManagerDAL = new ManagerDAL();

            obj.Manager = objManagerDAL.Get().
                          Where(x => x._id.ToString() == obj.ManagerId).
                          Select(x => new Manager
            {
                ManagerId   = x._id.ToString(),
                ManagerName = x.ManagerName
            }).First();

            EmployeeDAL objDal = new EmployeeDAL();

            objDal.Insert(obj);
            return(RedirectToAction("Get"));
        }
Ejemplo n.º 5
0
        // GET: Manager
        public ActionResult Get()
        {
            ManagerDAL objDal = new ManagerDAL();

            return(View(objDal.Get()));
        }