//
 // GET: /Worker/
 public ActionResult Index(String message, String page, String field, String condition, String search, String by)
 {
     message = HttpUtility.UrlDecode(message);
     search = HttpUtility.UrlDecode(search);
     int pageNum = Common.Common.getPageNum(page);
     DAL.m_worker dal_m_worker = new DAL.m_worker();
     if (message != null && message != "")
     {
         ViewBag.message = message;
     }
     Models.z_user session_model_z_user = (Models.z_user)ViewBag.model_z_user;
     List<Models.m_worker> m_worker_list = dal_m_worker.GetListModelByPage(field, condition, search, by, pageNum * 15 + 1, (pageNum + 1) * 15, true, session_model_z_user.ID);
     //判断是否有管理员和经理权限
     DAL.z_role dal_z_role = new DAL.z_role();
     List<Models.z_role> z_role_list = dal_z_role.GetModelList(session_model_z_user.ID);
     Boolean canAddorImport = false;
     foreach (Models.z_role model_z_role in z_role_list)
     {
         if (model_z_role.NAME == "管理员" || model_z_role.NAME == "经理")
         {
             canAddorImport = true;
         }
     }
     ViewBag.canAddorImport = canAddorImport;
     //判断是否有管理员和经理权限
     ViewBag.recordCount = dal_m_worker.GetRecordCount(field, condition, search, by, true, session_model_z_user.ID);
     ViewBag.page = pageNum + 1;
     ViewBag.pageNum = Math.Ceiling((double)ViewBag.recordCount / (double)15);
     ViewBag.field = field;
     ViewBag.condition = condition;
     ViewBag.search = search;
     ViewBag.by = by;
     return View(m_worker_list);
 }
 //
 // GET: /Worker/
 public ActionResult Index(String message, String page, String field, String condition, String search, String by)
 {
     message = HttpUtility.UrlDecode(message);
     search = HttpUtility.UrlDecode(search);
     int pageNum = Common.Common.getPageNum(page);
     DAL.m_worker dal_m_worker = new DAL.m_worker();
     if (message != null && message != "")
     {
         ViewBag.message = message;
     }
     Models.z_user session_model_z_user = (Models.z_user)ViewBag.model_z_user;
     List<Models.m_worker> m_worker_list = dal_m_worker.GetListModelByPage(field, condition, search, by, pageNum * 15 + 1, (pageNum + 1) * 15, false, session_model_z_user.ID);
     ViewBag.recordCount = dal_m_worker.GetRecordCount(field, condition, search, by, false, session_model_z_user.ID);
     ViewBag.page = pageNum + 1;
     ViewBag.pageNum = Math.Ceiling((double)ViewBag.recordCount / (double)15);
     ViewBag.field = field;
     ViewBag.condition = condition;
     ViewBag.search = search;
     ViewBag.by = by;
     return View(m_worker_list);
 }