Example #1
0
        public async Task <ActionResult> Create([Bind(Include = "EmployeeKey,ParentEmployeeKey,FirstName,LastName,MiddleName,Title,HireDate,BirthDate,EmailAddress,Phone,MaritalStatus,EmergencyContactName,EmergencyContactPhone,SalariedFlag,Gender,PayFrequency,BaseRate,VacationHours,CurrentFlag,SalesPersonFlag,DepartmentName,StartDate,EndDate,Status,ImageUrl,ProfileUrl,ETLLoadID,LoadDate,UpdateDate")] DimEmployee dimEmployee)
        {
            if (ModelState.IsValid)
            {
                DimEmployee respuesta = await DimEmployeesClient.CreateAsync(dimEmployee);

                if (respuesta != null)
                {
                    return(RedirectToAction("Index"));
                }
            }

            //ViewBag.ParentEmployeeKey = new SelectList(db.DimEmployee, "EmployeeKey", "FirstName", dimEmployee.ParentEmployeeKey);

            return(View(dimEmployee));
        }
Example #2
0
        public async Task <ActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            var dimEmployee = await DimEmployeesClient.GetAsync(id.Value);

            if (dimEmployee == null)
            {
                return(HttpNotFound());
            }

            return(View(dimEmployee));
        }
Example #3
0
        public async Task <ActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            else
            {
                var dimEmployee = await DimEmployeesClient.GetAsync(id.Value);

                if (dimEmployee == null)
                {
                    return(HttpNotFound());
                }

                //ViewBag.ParentEmployeeKey =
                //    new SelectList(db.DimEmployee, "EmployeeKey", "FirstName", dimEmployee.ParentEmployeeKey);

                return(View(dimEmployee));
            }
        }
Example #4
0
        public async Task <ActionResult> Index()
        {
            List <DimEmployee> resp = await DimEmployeesClient.GetAllAsync();

            return(View(resp));
        }
Example #5
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            var dimEmployee = await DimEmployeesClient.DeleteAsync(id);

            return(RedirectToAction("Index"));
        }