Ejemplo n.º 1
0
 /// <summary>
 /// 得到审核主表最新的一个实体
 /// </summary>
 /// <param name="conn">OracleConnection</param>
 /// <param name="formid">formid</param>
 /// <returns></returns>
 public FLOW_FLOWRECORDMASTER_T GetFlowerMasterIDByFormid(OracleConnection conn, string formid)
 {
     try
     {
         FLOW_FLOWRECORDMASTER_T model = new FLOW_FLOWRECORDMASTER_T();
         string            selSql      = "SELECT INSTANCEID,FORMID,EDITUSERID,EDITUSERNAME FROM FLOW_FLOWRECORDMASTER_T WHERE   FORMID=:FORMID   ORDER BY CREATEDATE DESC";
         OracleParameter[] pageparm    =
         {
             new OracleParameter(":FORMID", OracleType.NVarChar, 100)
         };
         pageparm[0].Value = formid;
         DataTable dt = OracleDataProvider.GetDataTable(conn, selSql, pageparm);
         if (dt.Rows.Count > 0)
         {                                                               //多次提交单据的时候,取最新的一条数据
             model.INSTANCEID   = dt.Rows[0]["INSTANCEID"].ToString();   //
             model.FORMID       = dt.Rows[0]["FORMID"].ToString();       //
             model.EDITUSERID   = dt.Rows[0]["EDITUSERID"].ToString();   //
             model.EDITUSERNAME = dt.Rows[0]["EDITUSERNAME"].ToString(); //
         }
         return(model);
     }
     catch (Exception e)
     {
         throw new Exception(e.Message, e);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 获取元数据
 /// </summary>
 /// <param name="formid">formid</param>
 /// <returns></returns>
 public static string GetMetadataByFormid(string formid)
 {
     try
     {
         string sql = "select businessobject from FLOW_FLOWRECORDMASTER_T where formid='" + formid + "' order by createdate desc ";
         using (OracleConnection con = new OracleConnection(ADOHelper.ContextOracleConnection))
         {
             try
             {
                 con.Open();
                 DataTable dt = OracleDataProvider.GetDataTable(con, sql);
                 if (dt != null && dt.Rows.Count > 0)
                 {
                     return(dt.Rows[0]["businessobject"].ToString());//取新新的一条
                 }
                 else
                 {
                     return("");
                 }
             }
             catch (Exception ex)
             {
                 LogHelper.WriteLog("获取元数据:GetMetadataByFormid-> OracleDataProvider.GetDataTable:异常信息:" + ex.Message);
                 return("");
             }
             finally
             {
                 if (con.State == ConnectionState.Open)
                 {
                     con.Close();
                 }
                 LogHelper.WriteLog("获取元数据:GetMetadataByFormid-> SQL=" + sql);
             }
         }
     }
     catch (Exception ex)
     {
         LogHelper.WriteLog("获取元数据:GetMetadataByFormid:异常信息:" + ex.Message);
         return("");
     }
 }