// GET: /Qua Trinh public PartialViewResult QuaTrinh(int id = 0) { nvbhDanhSachDieuChinhTangGiam nvbhdanhsachdieuchinhtanggiam = db.nvbhDanhSachDieuChinhTangGiam.Find(id); ViewBag.Manv = from nv in db.nvbhNhanVienBHXH where nv.NV_id == nvbhdanhsachdieuchinhtanggiam.NV_id select nv.MANV; ViewBag.tennv = from nv in db.nvbhNhanVienBHXH where nv.NV_id == nvbhdanhsachdieuchinhtanggiam.NV_id select nv.HoVaTen; return(PartialView(nvbhdanhsachdieuchinhtanggiam)); }
public ActionResult DeleteConfirmed(int id) { nvbhDanhSachDieuChinhTangGiam nvbhdanhsachdieuchinhtanggiam = db.nvbhDanhSachDieuChinhTangGiam.Find(id); db.nvbhDanhSachDieuChinhTangGiam.Remove(nvbhdanhsachdieuchinhtanggiam); db.SaveChanges(); return(RedirectToAction("Index2")); }
// // GET: /DanhSachDieuChinhTangGiam/Details/5 public PartialViewResult Details(int id = 0) { nvbhDanhSachDieuChinhTangGiam nvbhdanhsachdieuchinhtanggiam = db.nvbhDanhSachDieuChinhTangGiam.Find(id); //if (nvbhdanhsachdieuchinhtanggiam == null) //{ // return HttpNotFound(); //} return(PartialView(nvbhdanhsachdieuchinhtanggiam)); }
public ActionResult QuaTrinh(nvbhDanhSachDieuChinhTangGiam nvbhdanhsachdieuchinhtanggiam) { if (ModelState.IsValid) { nvbhdanhsachdieuchinhtanggiam.XacNhan = true; db.Entry(nvbhdanhsachdieuchinhtanggiam).State = EntityState.Modified; db.SaveChanges(); TempData["Message"] = "Đưa vào quá trình thành công"; } return(RedirectToAction("Index2")); }
// // GET: /DanhSachDieuChinhTangGiam/Delete/5 public PartialViewResult Delete(int id = 0) { nvbhDanhSachDieuChinhTangGiam nvbhdanhsachdieuchinhtanggiam = db.nvbhDanhSachDieuChinhTangGiam.Find(id); ViewBag.hovaten = from nv in db.nvbhNhanVienBHXH where nv.NV_id == nvbhdanhsachdieuchinhtanggiam.NV_id select nv.HoVaTen; ViewBag.manv = from nv in db.nvbhNhanVienBHXH where nv.NV_id == nvbhdanhsachdieuchinhtanggiam.NV_id select nv.MANV; ViewBag.sobh = from nv in db.nvbhNhanVienBHXH where nv.NV_id == nvbhdanhsachdieuchinhtanggiam.NV_id select nv.SoBHXH; //if (nvbhdanhsachdieuchinhtanggiam == null) //{ // return HttpNotFound(); //} return(PartialView(nvbhdanhsachdieuchinhtanggiam)); }
public ActionResult xoahangloat() { try { nvbhDanhSachDieuChinhTangGiam nvbhdanhsachdieuchinhtanggiam = db.nvbhDanhSachDieuChinhTangGiam.Find(2); db.nvbhDanhSachDieuChinhTangGiam.Remove(nvbhdanhsachdieuchinhtanggiam); db.SaveChanges(); TempData["Message"] = "Xóa thành công"; } catch (Exception e) { TempData["Message"] = "Xóa không thành công"; } return(RedirectToAction("Index2")); }
public ActionResult Create(nvbhDanhSachDieuChinhTangGiam nvbhdanhsachdieuchinhchucdanh) { if (ModelState.IsValid) { db.nvbhDanhSachDieuChinhTangGiam.Add(nvbhdanhsachdieuchinhchucdanh); db.SaveChanges(); TempData["Message"] = "Thêm thành công"; return(RedirectToAction("Index2")); } else { TempData["Message"] = "Thêm không thành công"; return(RedirectToAction("Index2")); } return(View(nvbhdanhsachdieuchinhchucdanh)); }
public ActionResult Edit(nvbhDanhSachDieuChinhTangGiam nvbhdanhsachdieuchinhtanggiam) { //try //{ if (ModelState.IsValid) { db.Entry(nvbhdanhsachdieuchinhtanggiam).State = EntityState.Modified; db.SaveChanges(); TempData["Message"] = "Sửa thành công"; return(RedirectToAction("Index2", "DanhSachDieuChinhTangGiam")); } //} //catch { TempData["Message"] = "Sửa không thành công"; } ViewBag.TyLeDong = new SelectList(from t in db.dmTyLeDongBHXH where t.TrangThai == true select t, "TongCong", "TongCong"); ViewBag.idLoaiDieu = new SelectList(db.dmLoaiDieuChinh.AsEnumerable(), "id", "LoaiDieuChinh", nvbhdanhsachdieuchinhtanggiam.idLoaiDieuChinh); ViewBag.idLoaiTang = new SelectList(db.dmLoaiTangGiam, "Ma", "Ma", nvbhdanhsachdieuchinhtanggiam.idLoaiTangGiam); ViewBag.nvid = new SelectList(db.nvbhNhanVienBHXH, "NV_id", "HoVaTen", nvbhdanhsachdieuchinhtanggiam.NV_id); return(View(nvbhdanhsachdieuchinhtanggiam)); }
// // GET: /DanhSachDieuChinhTangGiam/Edit/5 public PartialViewResult Edit(int id = 0) { nvbhDanhSachDieuChinhTangGiam nvbhdanhsachdieuchinhtanggiam = db.nvbhDanhSachDieuChinhTangGiam.Find(id); //if (nvbhdanhsachdieuchinhtanggiam == null) //{ // return HttpNotFound(); //} //ViewBag.idnvbhNhanVienBHXH = new SelectList((from nv in db.nvbhNhanVienBHXH select new { id = nv.id, HoVaTen = nv.HoVaTen + " - " + nv.MANV }), "id", "HoVaTen"); ViewBag.TyLeDong = new SelectList(from t in db.dmTyLeDongBHXH where t.TrangThai == true select t, "TongCong", "TongCong"); ViewBag.idLoaiDieu = new SelectList(db.dmLoaiDieuChinh.AsEnumerable(), "id", "LoaiDieuChinh", nvbhdanhsachdieuchinhtanggiam.idLoaiDieuChinh); ViewBag.idLoaiTang = new SelectList(db.dmLoaiTangGiam, "Ma", "Ma", nvbhdanhsachdieuchinhtanggiam.idLoaiTangGiam); ViewBag.nvid = new SelectList(db.nvbhNhanVienBHXH, "NV_id", "HoVaTen", nvbhdanhsachdieuchinhtanggiam.NV_id); return(PartialView(nvbhdanhsachdieuchinhtanggiam)); }
public ActionResult Create(nvbhDanhSachDieuChinhTangGiam nvbhdanhsachdieuchinhtanggiam) { if (ModelState.IsValid) { int maxId1 = (from c in db.nvbhDanhSachDieuChinhTangGiam select c.MoiNhat).Max(); db.nvbhDanhSachDieuChinhTangGiam.Add(nvbhdanhsachdieuchinhtanggiam); nvbhdanhsachdieuchinhtanggiam.MoiNhat = maxId1 + 1; db.SaveChanges(); TempData["Message"] = "Thêm thành công"; return(RedirectToAction("Index2")); } else { TempData["Message"] = "Thêm không thành công"; return(RedirectToAction("Index2")); } return(View(nvbhdanhsachdieuchinhtanggiam)); }
public ActionResult QuaTrinhTatCa(nvbhDanhSachDieuChinhTangGiam nvbhdanhsachdieuchinhtanggiam) { int maxId2 = (from c in db.nvbhDanhSachDieuChinhTangGiam select c.MoiNhat).Max(); var TGBD = DateTime.ParseExact(TempData["startdate"].ToString(), "MM/dd/yyyy", CultureInfo.CurrentCulture); var TGKT = DateTime.ParseExact(TempData["enddate"].ToString(), "MM/dd/yyyy", CultureInfo.CurrentCulture); if (TGBD != null && TGKT != null) { var qtid = from qt in db.nvbhDanhSachDieuChinhTangGiam.ToArray() where TGBD <= qt.NgayPhatSinh && TGKT >= qt.NgayPhatSinh select qt.id; int i; for (i = 0; i < qtid.Count(); i++) { nvbhDanhSachDieuChinhTangGiam hs = db.nvbhDanhSachDieuChinhTangGiam.Find(qtid.AsEnumerable().ElementAt(i)); hs.XacNhan = true; hs.MoiNhat = maxId2; } db.SaveChanges(); TempData["Message"] = "Đưa vào quá trình thành công"; } return(RedirectToAction("Index2")); }