Esempio n. 1
0
        /// <summary>
        /// 获取一个日程
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public JsonResult GetOneRC(int id)
        {
            RiCheng rc        = dbp.GetOneRiCheng(id);
            var     strResult = "{\"rc\":" + rc.ToJsonString() + "}";

            return(Json(strResult));
        }
Esempio n. 2
0
        /// <summary>
        /// 删除日程
        /// </summary>
        /// <param name="id">日程ID</param>
        public void DeleteRiCheng(int id)
        {
            RiCheng richeng = GetOneRiCheng(id);

            db.RiCheng.DeleteOnSubmit(richeng);
            db.SubmitChanges();
        }
Esempio n. 3
0
 /// <summary>
 /// 保存日程
 /// </summary>
 /// <param name="RC">一个日程的实体</param>
 public void SaveRC(RiCheng RC)
 {
     if (RC.RCId == 0)
     {
         db.RiCheng.InsertOnSubmit(RC);
     }
     db.SubmitChanges();
 }
Esempio n. 4
0
        public JsonResult AddRiCheng(string title, string remark, string dateTime, int riChengId = 0)
        {
            RiCheng riCheng = null;

            if (riChengId != 0)
            {
                riCheng = dbp.GetOneRiCheng(riChengId);
            }
            else
            {
                riCheng = new RiCheng();
            }
            riCheng.RCTitle    = title;
            riCheng.EmpId      = 1;
            riCheng.RCDateTime = DateTime.Parse(dateTime);
            riCheng.Remark     = remark;
            riCheng.CreateTime = DateTime.Now;
            dbp.SaveRC(riCheng);
            return(Json("OK"));
        }