コード例 #1
0
        public ActionResult Create(ServicePoxry.AWServiceReference.Employee employee)
        {
            if (this.ModelState.IsValid)
            {
                this.serviceClient.CreateEmployee(employee);
                return this.RedirectToAction("Index");
            }

            int count = 0;
            PagedListOfEmployeeuTvS1Dbc employeelist = this.serviceClient.FindEmployeeByTitle(out count, null, 1, 10);
            var contactlist = this.serviceClient.GetPagedListContact(out count, 1, 10);

            this.ViewBag.ContactID = new SelectList(contactlist, "ContactID", "FirstName");
            this.ViewBag.ManagerID = new SelectList(employeelist, "EmployeeID", "LoginID", employee.ManagerID);
            return View(employee);
        }
コード例 #2
0
        public ActionResult Edit(ServicePoxry.AWServiceReference.Employee employee)
        {
            if (this.ModelState.IsValid)
            {
                // db.Entry(employee).State = EntityState.Modified;
                // db.SaveChanges();
                this.serviceClient.UpdateEmployee(employee);
                return this.RedirectToAction("Index");
            }

            int count = 0;
            var employeelist = this.serviceClient.FindEmployeeByTitle(out count, null, 1, 10);

            var contactlist = this.serviceClient.GetPagedListContact(out count, 1, 10);

            this.ViewBag.ContactID = new SelectList(contactlist, "ContactID", "FirstName");
            this.ViewBag.ManagerID = new SelectList(employeelist, "EmployeeID", "LoginID", employee.ManagerID);
            return View(employee);
        }