Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            if (Session["type"] == null || Session["type"].ToString() == "")
            {
                Session["DefaultView"]     = "Delete";
                Session["DefaultControll"] = "EmployeeSalary";
                return(RedirectToAction("Login", "Employee"));
            }

            EpmloyeeSalary epmloyeeSalary = db.EpmloyeeSalaries.Find(id);

            db.EpmloyeeSalaries.Remove(epmloyeeSalary);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
        public ActionResult Edit([Bind(Include = "ID,EmployeeID,EmployeeSalary,SalaryMonth,SalaryReciveDate")] EpmloyeeSalary epmloyeeSalary)
        {
            if (Session["type"] == null || Session["type"].ToString() == "")
            {
                Session["DefaultView"]     = "Edit";
                Session["DefaultControll"] = "EmployeeSalary";
                return(RedirectToAction("Login", "Employee"));
            }

            if (ModelState.IsValid)
            {
                db.Entry(epmloyeeSalary).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            ViewBag.EmployeeID = new SelectList(db.Employees, "ID", "EmployeeName", epmloyeeSalary.EmployeeID);
            return(View(epmloyeeSalary));
        }
Пример #3
0
        // GET: EmployeeSalary/Details/5
        public ActionResult Details(int?id)
        {
            if (Session["type"] == null || Session["type"].ToString() == "")
            {
                Session["DefaultView"]     = "Details";
                Session["DefaultControll"] = "EmployeeSalary";
                return(RedirectToAction("Login", "Employee"));
            }

            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            EpmloyeeSalary epmloyeeSalary = db.EpmloyeeSalaries.Find(id);

            if (epmloyeeSalary == null)
            {
                return(HttpNotFound());
            }
            return(View(epmloyeeSalary));
        }
Пример #4
0
        // GET: EmployeeSalary/Edit/5
        public ActionResult Edit(int?id)
        {
            if (Session["type"] == null || Session["type"].ToString() == "")
            {
                Session["DefaultView"]     = "Edit";
                Session["DefaultControll"] = "EmployeeSalary";
                return(RedirectToAction("Login", "Employee"));
            }

            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            EpmloyeeSalary epmloyeeSalary = db.EpmloyeeSalaries.Find(id);

            if (epmloyeeSalary == null)
            {
                return(HttpNotFound());
            }
            ViewBag.EmployeeID = new SelectList(db.Employees, "ID", "EmployeeName", epmloyeeSalary.EmployeeID);
            return(View(epmloyeeSalary));
        }