コード例 #1
0
 /// <summary>
 /// 插入t_ElementProperty_Library
 /// </summary>
 public virtual bool Insert(t_ElementProperty_Library elementPropertyLibrary)
 {
     string sql = "insert into t_ElementProperty_Library (ElementID, PropertyNo, PropertyValue, Caption, PropertyName) values (@ElementID, @PropertyNo, @PropertyValue, @Caption, @PropertyName)";
     SqlParameter [] parameters = new SqlParameter[]
     {
         new SqlParameter("@ElementID", SqlDbType.Int, 4, ParameterDirection.Input, false, 0, 0, "ElementID", DataRowVersion.Default, elementPropertyLibrary.Elementid),
         new SqlParameter("@PropertyNo", SqlDbType.Int, 4, ParameterDirection.Input, false, 0, 0, "PropertyNo", DataRowVersion.Default, elementPropertyLibrary.Propertyno),
         new SqlParameter("@PropertyValue", SqlDbType.VarChar, 4096, ParameterDirection.Input, false, 0, 0, "PropertyValue", DataRowVersion.Default, elementPropertyLibrary.Propertyvalue),
         new SqlParameter("@Caption", SqlDbType.VarChar, 50, ParameterDirection.Input, false, 0, 0, "Caption", DataRowVersion.Default, elementPropertyLibrary.Caption),
         new SqlParameter("@PropertyName", SqlDbType.VarChar, 50, ParameterDirection.Input, false, 0, 0, "PropertyName", DataRowVersion.Default, elementPropertyLibrary.Propertyname)
     };
     return db.ExecuteNoQuery(sql, parameters) > -1;
 }
コード例 #2
0
        public List<t_ElementProperty_Library> selectAllDate()
        {
            string sql = "select * from t_ElementProperty_Library";

            DataTable dt = null;
            try
            {
                dt = db.ExecuteQuery(sql);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            List<t_ElementProperty_Library> _List = new List<t_ElementProperty_Library>();
            foreach (DataRow dr in dt.Rows)
            {
                t_ElementProperty_Library obj = new t_ElementProperty_Library(dr);
                _List.Add(obj);
            }
            return _List;
        }
コード例 #3
0
 public void Clone(t_ElementProperty_Library obj)
 {
     //
     Elementid = obj.Elementid;
     //
     Propertyno = obj.Propertyno;
     //
     Propertyvalue = obj.Propertyvalue;
     //
     Caption = obj.Caption;
     //
     Propertyname = obj.Propertyname;
 }
コード例 #4
0
 public t_ElementProperty_Library selectARowDate(string m_id)
 {
     string sql = string.Format("select * from t_ElementProperty_Library where  Elementid='{0}'",m_id);
       DataTable dt = null;
     try
      {
      dt = db.ExecuteQueryDataSet(sql).Tables[0];
     }
       catch (Exception ex)
     {
      throw ex;
       }
     if (dt == null)
      return null;
     if (dt.Rows.Count == 0)
     return null;
     DataRow dr = dt.Rows[0];
     t_ElementProperty_Library m_Elem=new t_ElementProperty_Library(dr);
      return m_Elem;
 }
コード例 #5
0
 /// <summary>
 /// 更新t_ElementProperty_Library
 /// </summary>
 public virtual bool Update(t_ElementProperty_Library elementPropertyLibrary)
 {
     string sql = "update t_ElementProperty_Library set  PropertyNo = @PropertyNo,  PropertyValue = @PropertyValue,  Caption = @Caption,  PropertyName = @PropertyName where  ElementID = @ElementID";
     SqlParameter [] parameters = new SqlParameter[]
     {
         new SqlParameter("@ElementID", SqlDbType.Int, 4, ParameterDirection.Input, false, 0, 0, "ElementID", DataRowVersion.Default, elementPropertyLibrary.Elementid),
         new SqlParameter("@PropertyNo", SqlDbType.Int, 4, ParameterDirection.Input, false, 0, 0, "PropertyNo", DataRowVersion.Default, elementPropertyLibrary.Propertyno),
         new SqlParameter("@PropertyValue", SqlDbType.VarChar, 4096, ParameterDirection.Input, false, 0, 0, "PropertyValue", DataRowVersion.Default, elementPropertyLibrary.Propertyvalue),
         new SqlParameter("@Caption", SqlDbType.VarChar, 50, ParameterDirection.Input, false, 0, 0, "Caption", DataRowVersion.Default, elementPropertyLibrary.Caption),
         new SqlParameter("@PropertyName", SqlDbType.VarChar, 50, ParameterDirection.Input, false, 0, 0, "PropertyName", DataRowVersion.Default, elementPropertyLibrary.Propertyname)
     };
     return db.ExecuteNoQuery(sql, parameters) > -1;
 }