public object GetData(string userid, string caseId, string baid) { //只有待办箱才有设置为已读 if (!String.IsNullOrEmpty(baid)) engineAPI.SetIsReaded(caseId, baid, userid); GetDataModel data = new GetDataModel(); B_OA_SupervisionReminder en = new B_OA_SupervisionReminder(); en.Condition.Add("caseId=" + caseId); data.reminderBaseInfor = Utility.Database.QueryObject<B_OA_SupervisionReminder>(en); B_OA_Supervision_Bill supervisionBill = new B_OA_Supervision_Bill(); supervisionBill.Condition.Add("caseid =" + caseId); data.supervisionBill = Utility.Database.QueryObject<B_OA_Supervision_Bill>(supervisionBill); if (data.reminderBaseInfor == null) { var baseInfo = new B_OA_SupervisionReminder(); baseInfo.createDate = DateTime.Now.ToString(); baseInfo.reminderManId = userid; baseInfo.reminderManName = ComClass.GetUserInfo(userid).CnName; data.reminderBaseInfor = baseInfo; //督办通知单据 B_OA_Supervision_Bill supervisionBill_ad = new B_OA_Supervision_Bill(); supervisionBill_ad.content = GetSupervisionBill(); supervisionBill_ad.year = DateTime.Now.Year.ToString(); supervisionBill_ad.createDate = DateTime.Now.ToString("yyyy年MM月dd日"); data.supervisionBill = supervisionBill_ad; } return data; }
public string UpdateReminderCount(string caseid, string count, string userid) { IDbTransaction tran = Utility.Database.BeginDbTransaction(); try { B_OA_SupervisionReminder reminder = new B_OA_SupervisionReminder(); reminder.Condition.Add("caseId = " + caseid); reminder = Utility.Database.QueryObject<B_OA_SupervisionReminder>(reminder, tran); if (reminder != null) { reminder.reminderCount = int.Parse(count); reminder.Condition.Add("id =" + reminder.id); Utility.Database.Update(reminder, tran); } Utility.Database.Commit(tran); return Utility.JsonResult(true, "数据加载成功");//将对象转为json字符串并返回到客户端 } catch (Exception ex) { Utility.Database.Rollback(tran); return Utility.JsonResult(false, "数据加载失败!异常信息: " + ex.Message); } }