public JSYCRM.Models.z_parameter GetModel(String TYPE, String NAME)
 {
     StringBuilder strSql = new StringBuilder();
     strSql.Append("select  top 1 ID,TYPE,NAME,VALUE,DESCRIPTION,CREATE_USER_ID,CREATE_DATETIME,UPDATE_USER_ID,UPDATE_DATETIME,DELETE_FLG from z_parameter ");
     strSql.Append(" where TYPE=@TYPE and NAME=@NAME");
     SqlParameter[] parameters = {
             new SqlParameter("@TYPE", SqlDbType.NVarChar, 50),
             new SqlParameter("@NAME", SqlDbType.NVarChar, 50)
                         };
     parameters[0].Value = TYPE;
     parameters[1].Value = NAME;
     JSYCRM.Models.z_parameter model = new JSYCRM.Models.z_parameter();
     DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
     if (ds.Tables[0].Rows.Count > 0)
     {
         return DataRowToModel(ds.Tables[0].Rows[0]);
     }
     else
     {
         return null;
     }
 }
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public JSYCRM.Models.z_parameter DataRowToModel(DataRow row)
 {
     JSYCRM.Models.z_parameter model = new JSYCRM.Models.z_parameter();
     if (row != null)
     {
         if (row["ID"] != null && row["ID"].ToString() != "")
         {
             model.ID = new Guid(row["ID"].ToString());
         }
         if (row["TYPE"] != null)
         {
             model.TYPE = row["TYPE"].ToString();
         }
         if (row["NAME"] != null)
         {
             model.NAME = row["NAME"].ToString();
         }
         if (row["VALUE"] != null)
         {
             model.VALUE = row["VALUE"].ToString();
         }
         if (row["DESCRIPTION"] != null)
         {
             model.DESCRIPTION = row["DESCRIPTION"].ToString();
         }
         if (row["CREATE_USER_ID"] != null && row["CREATE_USER_ID"].ToString() != "")
         {
             model.CREATE_USER_ID = new Guid(row["CREATE_USER_ID"].ToString());
         }
         if (row["CREATE_DATETIME"] != null && row["CREATE_DATETIME"].ToString() != "")
         {
             model.CREATE_DATETIME = DateTime.Parse(row["CREATE_DATETIME"].ToString());
         }
         if (row["UPDATE_USER_ID"] != null && row["UPDATE_USER_ID"].ToString() != "")
         {
             model.UPDATE_USER_ID = new Guid(row["UPDATE_USER_ID"].ToString());
         }
         if (row["UPDATE_DATETIME"] != null && row["UPDATE_DATETIME"].ToString() != "")
         {
             model.UPDATE_DATETIME = DateTime.Parse(row["UPDATE_DATETIME"].ToString());
         }
         if (row["DELETE_FLG"] != null)
         {
             model.DELETE_FLG = row["DELETE_FLG"].ToString();
         }
         try
         {
             if (row["UPDATE_USER"] != null && row["UPDATE_USER"].ToString() != "")
             {
                 model.UPDATE_USER = row["UPDATE_USER"].ToString();
             }
             if (row["CREATE_USER"] != null && row["CREATE_USER"].ToString() != "")
             {
                 model.CREATE_USER = row["CREATE_USER"].ToString();
             }
         }
         catch
         { }
     }
     return model;
 }
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public JSYCRM.Models.z_parameter GetModel(Guid ID)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select  top 1 ID,TYPE,NAME,VALUE,DESCRIPTION,CREATE_USER_ID,CREATE_DATETIME,UPDATE_USER_ID,UPDATE_DATETIME,DELETE_FLG from z_parameter ");
            strSql.Append(" where ID=@ID ");
            SqlParameter[] parameters = {
                    new SqlParameter("@ID", SqlDbType.UniqueIdentifier,16)			};
            parameters[0].Value = ID;

            JSYCRM.Models.z_parameter model = new JSYCRM.Models.z_parameter();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
            if (ds.Tables[0].Rows.Count > 0)
            {
                return DataRowToModel(ds.Tables[0].Rows[0]);
            }
            else
            {
                return null;
            }
        }