public ActionResult importExcel() { if (Session["username"] == null) { return(RedirectToAction("Login", "Admin")); } m_p = new PhanQuyenHeThong(); string v_actionName = this.ControllerContext.RouteData.Values["action"].ToString(); string v_controllerName = this.ControllerContext.RouteData.Values["controller"].ToString(); var v_c = m_p.checkQuyenTruyCap( Session["IdUserGroup"].ToString() , v_controllerName , v_actionName); if (v_c == false) { return(RedirectToAction("Login", "Admin")); } return(PartialView()); }
public ActionResult ExcelToDB() { if (Session["username"] == null) { return(RedirectToAction("Login", "Admin")); } m_p = new PhanQuyenHeThong(); string v_actionName = this.ControllerContext.RouteData.Values["action"].ToString(); string v_controllerName = this.ControllerContext.RouteData.Values["controller"].ToString(); var v_c = m_p.checkQuyenTruyCap( Session["IdUserGroup"].ToString() , v_controllerName , v_actionName); if (v_c == false) { return(RedirectToAction("Login", "Admin")); } ViewBag.LstNhanVien = ((SLExcelData)Session["SessionExcelData"]).DataRows; ViewBag.LstColumn = Lay_danh_sach_cot_table_khach_hang(); return(PartialView()); }
public ActionResult UploadFile(HttpPostedFileBase excelFile) { if (Session["username"] == null) { return(RedirectToAction("Login", "Admin")); } m_p = new PhanQuyenHeThong(); string v_actionName = this.ControllerContext.RouteData.Values["action"].ToString(); string v_controllerName = this.ControllerContext.RouteData.Values["controller"].ToString(); var v_c = m_p.checkQuyenTruyCap( Session["IdUserGroup"].ToString() , v_controllerName , v_actionName); if (v_c == false) { return(RedirectToAction("Login", "Admin")); } var data = (new SLExcelReader()).ReadExcel(excelFile); Session["SessionExcelData"] = data; return(RedirectToAction("ExcelToDB")); }