public ActionResult Create(T_NB_Attendance t_nb_attendance)
        {
            if (Request.IsAjaxRequest())
            {
                if (ModelState.IsValid)
                {
                    if (db.T_NB_Attendance.Where(m => m.WorkTime == t_nb_attendance.WorkTime).Any(m => m.UserId == t_nb_attendance.UserId))
                    {
                        return ReturnJson(false, "重复登记!", "", "", false, "");
                    }

                    t_nb_attendance.RecordUser = CurrentUser().UserName;

                    db.T_NB_Attendance.Add(t_nb_attendance);
                    int result = db.SaveChanges();
                    if (result > 0)
                        return ReturnJson(true, "操作成功", "", "", true, "");
                    else
                        return ReturnJson(false, "操作失败", "", "", false, "");
                }
                else
                {
                    return ReturnJson(false, "请选择考勤信息", "", "", false, "");
                }
            }
            return Json(new { });
        }
        public ActionResult Edit(int id,T_NB_Attendance t_nb_attendance)
        {
            if (Request.IsAjaxRequest())
            {
                if (ModelState.IsValid)
                {
                    t_nb_attendance.RecordUser = CurrentUser().UserName;
                    t_nb_attendance.RecordTime = DateTime.Now;

                    db.Entry(t_nb_attendance).State = EntityState.Modified;
                    int result = db.SaveChanges();
                    if (result >= 0)
                        return ReturnJson(true, "操作成功", "", "", true, "");
                    else
                        return ReturnJson(false, "操作失败", "", "", false, "");
                }
            }
            return Json(new { });
        }