Пример #1
0
 /// <summary>
 /// 插入值日信息
 /// </summary>
 /// <param name="text"></param>
 /// <returns></returns>
 public JsonResult InsertDuty(string text)
 {
     try
     {
         DateTime DutyStart = Convert.ToDateTime(Request.Form[0]);
         DateTime DutyEnd   = Convert.ToDateTime(Request.Form[1]);
         int      User_ID   = int.Parse(Request.Form[2]);
         DutyData.InsertDtoData(DutyStart, DutyEnd, User_ID);
         return(Json("true"));
     }
     catch
     {
         return(Json("false"));
     }
 }
Пример #2
0
 /// <summary>
 /// 删除值日信息
 /// </summary>
 /// <param name="text"></param>
 /// <returns></returns>
 public JsonResult DelDuty(string text)
 {
     try {
         DateTime DutyStart = Convert.ToDateTime(Request.Form[0]);
         int      User_ID   = int.Parse(Request.Form[1]);
         if (DutyData.DelDtoData(DutyStart, User_ID))
         {
             return(Json("true"));
         }
         else
         {
             return(Json("false"));
         }
     }
     catch
     {
         return(Json("false"));
     }
 }
Пример #3
0
        /// <summary>
        /// 获取值日信息
        /// </summary>
        /// <returns></returns>
        public JsonResult GetDutyData()
        {
            //List<DutyNeedDto>
            List <DutyDto>     DutyList   = DutyData.GetDuty();
            List <DutyNeedDto> returnList = new List <DutyNeedDto>();

            foreach (DutyDto ss in DutyList)
            {
                DutyNeedDto DutyNeedData = new DutyNeedDto();
                int         userId       = ss.User_ID;
                ss.DutyEnd = ss.DutyEnd.AddDays(1);
                List <UserDto> UserList = UserData.GetUser(userId);
                DutyNeedData.title = UserList[0].Real_Name;
                DutyNeedData.start = ss.DutyStart.ToString("yyyy-MM-dd");
                DutyNeedData.end   = ss.DutyEnd.ToString("yyyy-MM-dd");

                //DutyNeedData.Url = ss.Url;
                returnList.Add(DutyNeedData);
            }

            return(Json(ISIS.Obj2Json(returnList), JsonRequestBehavior.AllowGet));
        }