Exemplo n.º 1
0
 /// <summary>
 /// 插入t_ControlProperty
 /// </summary>
 public virtual bool Insert(t_ControlProperty controlProperty)
 {
     string sql = "insert into t_ControlProperty (ControlID, PropertyNo, PropertyName, DefaultValue, Caption) values (@ControlID, @PropertyNo, @PropertyName, @DefaultValue, @Caption)";
     SqlParameter [] parameters = new SqlParameter[]
     {
         new SqlParameter("@ControlID", SqlDbType.Int, 4, ParameterDirection.Input, false, 0, 0, "ControlID", DataRowVersion.Default, controlProperty.ControlID),
         new SqlParameter("@PropertyNo", SqlDbType.Int, 4, ParameterDirection.Input, false, 0, 0, "PropertyNo", DataRowVersion.Default, controlProperty.PropertyNo),
         new SqlParameter("@PropertyName", SqlDbType.VarChar, 50, ParameterDirection.Input, false, 0, 0, "PropertyName", DataRowVersion.Default, controlProperty.PropertyName),
         new SqlParameter("@DefaultValue", SqlDbType.VarChar, 128, ParameterDirection.Input, false, 0, 0, "DefaultValue", DataRowVersion.Default, controlProperty.DefaultValue),
         new SqlParameter("@Caption", SqlDbType.VarChar, 50, ParameterDirection.Input, false, 0, 0, "Caption", DataRowVersion.Default, controlProperty.Caption)
     };
     return db.ExecuteNoQuery(sql, parameters) > -1;
 }
Exemplo n.º 2
0
        public List<t_ControlProperty> selectAllDate()
        {
            string sql = "select * from t_ControlProperty";

            DataTable dt = null;
            try
            {
                dt = db.ExecuteQuery(sql);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            List<t_ControlProperty> _List = new List<t_ControlProperty>();
            foreach (DataRow dr in dt.Rows)
            {
                t_ControlProperty obj = new t_ControlProperty(dr);
                _List.Add(obj);
            }
            return _List;
        }
Exemplo n.º 3
0
 public void Clone(t_ControlProperty obj)
 {
     //
     ControlID = obj.ControlID;
     //
     PropertyNo = obj.PropertyNo;
     //
     PropertyName = obj.PropertyName;
     //
     DefaultValue = obj.DefaultValue;
     //
     Caption = obj.Caption;
 }
Exemplo n.º 4
0
 public t_ControlProperty selectARowDate(string m_id)
 {
     string sql = string.Format("select * from t_ControlProperty where  Controlid='{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_ControlProperty m_Cont=new t_ControlProperty(dr);
      return m_Cont;
 }
Exemplo n.º 5
0
 /// <summary>
 /// 更新t_ControlProperty
 /// </summary>
 public virtual bool Update(t_ControlProperty controlProperty)
 {
     string sql = "update t_ControlProperty set  PropertyNo = @PropertyNo,  PropertyName = @PropertyName,  DefaultValue = @DefaultValue,  Caption = @Caption where  ControlID = @ControlID";
     SqlParameter [] parameters = new SqlParameter[]
     {
         new SqlParameter("@ControlID", SqlDbType.Int, 4, ParameterDirection.Input, false, 0, 0, "ControlID", DataRowVersion.Default, controlProperty.ControlID),
         new SqlParameter("@PropertyNo", SqlDbType.Int, 4, ParameterDirection.Input, false, 0, 0, "PropertyNo", DataRowVersion.Default, controlProperty.PropertyNo),
         new SqlParameter("@PropertyName", SqlDbType.VarChar, 50, ParameterDirection.Input, false, 0, 0, "PropertyName", DataRowVersion.Default, controlProperty.PropertyName),
         new SqlParameter("@DefaultValue", SqlDbType.VarChar, 128, ParameterDirection.Input, false, 0, 0, "DefaultValue", DataRowVersion.Default, controlProperty.DefaultValue),
         new SqlParameter("@Caption", SqlDbType.VarChar, 50, ParameterDirection.Input, false, 0, 0, "Caption", DataRowVersion.Default, controlProperty.Caption)
     };
     return db.ExecuteNoQuery(sql, parameters) > -1;
 }