Пример #1
0
        public async Task <ActionResult> Edit([Bind(Include = "Id,Name")] JobType jobType)
        {
            if (ModelState.IsValid)
            {
                db.Entry(jobType).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(jobType));
        }
        public async Task <ActionResult> Edit([Bind(Include = "Id,House_Road,PoliceStation,PostOffice,District,EmployeeId")] Address address)
        {
            if (ModelState.IsValid)
            {
                db.Entry(address).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.EmployeeId = new SelectList(db.Employees, "Id", "FirstName", address.EmployeeId);
            return(View(address));
        }
        public async Task <ActionResult> Edit([Bind(Include = "Id,Institute,Degree,Result,PassingYear,Board,EmployeeId")] Education education)
        {
            if (ModelState.IsValid)
            {
                db.Entry(education).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.EmployeeId = new SelectList(db.Employees, "Id", "FirstName", education.EmployeeId);
            return(View(education));
        }
        public async Task <ActionResult> Edit([Bind(Include = "Id,FirstName,LastName,DOB,Phone,Email,Nationality,NID,PhotoPath,JobTypeId")] Employee employee)
        {
            if (ModelState.IsValid)
            {
                db.Entry(employee).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.JobTypeId = new SelectList(db.JobTypes, "Id", "Name", employee.JobTypeId);
            return(View(employee));
        }
        public async Task <ActionResult> Edit([Bind(Include = "Id,EmployeeId,Time,Date,Type")] Attendance attendance)
        {
            if (ModelState.IsValid)
            {
                db.Entry(attendance).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.EmployeeId = new SelectList(db.Employees, "Id", "FirstName", attendance.EmployeeId);
            return(View(attendance));
        }
Пример #6
0
        public async Task <ActionResult> Edit([Bind(Include = "UserId,password,UserTypeId,EmployeeId")] User user)
        {
            if (ModelState.IsValid)
            {
                db.Entry(user).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.EmployeeId = new SelectList(db.Employees, "Id", "FirstName", user.EmployeeId);
            ViewBag.UserTypeId = new SelectList(db.UserTypes, "Id", "Name", user.UserTypeId);
            return(View(user));
        }