Пример #1
0
 //将草稿的guid改为正式的业务ID
 public void ChangeGuidToCaseId(string guid, string caseid, IDbTransaction tran)
 {
     StringBuilder strSql = new StringBuilder();
     strSql.AppendFormat("select * from B_OA_Supervision_Notice where caseid = '{0}'", guid);
     DataSet ds = Utility.Database.ExcuteDataSet(strSql.ToString());
     if (ds.Tables[0].Rows.Count > 0)
     {
         string jsonData = JsonConvert.SerializeObject(ds.Tables[0]);
         List<B_OA_Supervision_Notice> list = (List<B_OA_Supervision_Notice>)JsonConvert.DeserializeObject(jsonData, typeof(List<B_OA_Supervision_Notice>));
         for (int i = 0; i < list.Count; i++)
         {
             B_OA_Supervision_Notice notice = new B_OA_Supervision_Notice();
             notice = list[i];
             notice.caseid = caseid;
             notice.Condition.Add("id = " + notice.id);
             Utility.Database.Update(notice, tran);
         }
     }
 }
Пример #2
0
        public string GetSupervsionNotice(string keyId)
        {
            IDbTransaction tran = Utility.Database.BeginDbTransaction();
            GetDataModel dataModel = new GetDataModel();
            B_OA_Supervision_Notice supervision = new B_OA_Supervision_Notice();
            try
            {
                supervision.Condition.Add("caseId = " + keyId);
                B_OA_Supervision_Notice result = Utility.Database.QueryObject<B_OA_Supervision_Notice>(supervision, tran);
                if (result == null)
                {
                    supervision.year = DateTime.Now.Year.ToString();
                    supervision.createDate = DateTime.Now.ToString();
                    supervision.supervisionDate = DateTime.Now.ToString("yyyy年MM月dd日");
                }
                else
                {
                    supervision = result;
                }
                dataModel.supervisionNoticeBaseInfor = supervision;
                Utility.Database.Commit(tran);
                return JsonConvert.SerializeObject(dataModel);

            }
            catch (Exception e)
            {
                Utility.Database.Rollback(tran);
                return Utility.JsonMsg(false, "数据加载失败!异常信息: " + e.Message);
            }
        }