private void init(PDMDbProperty property, UpdateType updateType, object value, string nickName) { this.Property = property; this.Operator = updateType; this.Value = value; this.NickName = nickName; }
public ComponentValueOfWhere(PDMDbProperty property, object value, LocateType operatorType, string nickName = null) { this.Property = property; this.IsMultipleProperties = false; this.Operator = operatorType; this.Value = value; this.NickName = !string.IsNullOrEmpty(nickName) ? nickName : property.Title; }
public ComponentValueOfWhere(PDMDbProperty property, SelectBuilder subSelect, LocateType operatorType, string nickName = null) { this.Property = property; this.IsMultipleProperties = false; this.Operator = operatorType; this.SubSelect = subSelect; this.NickName = !string.IsNullOrEmpty(nickName) ? nickName : property.Title; }
/// <summary> /// 获取对应数据库的参数对象 /// </summary> public static DbParameter GetDbParameter(this PDMDbProperty property, DbSession session, object value, string nickName)//TODO =null { switch (session.DatabaseType) { case EDatabaseType.MSSQL: return(new SqlParameter(nickName ?? property.Title, value.GetType().IsEnum ? (int)value : value)); case EDatabaseType.Oracle: return(new OracleParameter(!string.IsNullOrEmpty(nickName) ? nickName : property.Title, value.GetType().IsEnum ? (int)value : value)); case EDatabaseType.MySQL: return(new MySqlParameter(!string.IsNullOrEmpty(nickName) ? nickName : property.Title, value.GetType().IsEnum ? (int)value : value)); default: throw new NotImplementedException("未支持该类型数据库的参数生成" + session.DatabaseType.ToString()); } }
/// <summary> /// 新增设置项 /// </summary> public void Add(PDMDbProperty property, object value, UpdateType updateType, string nickName = null) { Sets.Add(new ComponentValueOfSet(property, value, updateType, nickName)); }
/// <summary> /// 构造函数 /// </summary> /// <param name="property"></param> /// <param name="value"></param> /// <param name="nickName"></param> public ComponentValueOfInsert(PDMDbProperty property, object value, string nickName = null) { this.Property = property; this.Value = value; this.NickName = !string.IsNullOrEmpty(nickName) ? nickName : property.Title; }
/// <summary> /// 构造函数 /// </summary> /// <param name="property"></param> /// <param name="value"></param> /// <param name="updateType"></param> /// <param name="nickName"></param> public ComponentValueOfSet(PDMDbProperty property, object value, UpdateType updateType, string nickName = null) { init(property, updateType, value, !string.IsNullOrEmpty(nickName) ? nickName : property.Title); }
/// <summary> /// 新增查询项 /// </summary> /// <param name="select"></param> public void Add(PDMDbProperty property) { this.Add(property.Title); }
/// <summary> /// 新增插入项 /// </summary> /// <param name="property"></param> /// <param name="value"></param> /// <param name="nickName"></param> public void Add(PDMDbProperty property, object value, string nickName = null) { Values.Add(new ComponentValueOfInsert(property, value, nickName)); }
/// <summary> /// 新增条件项 /// </summary> public void Add(PDMDbProperty property, object value, LocateType operatorType, string nickName = null) { Wheres.Add(new ComponentValueOfWhere(property, value, operatorType, nickName)); }
/// <summary> /// 新增条件项 /// </summary> public void Add(PDMDbProperty property, SelectBuilder subSelect, LocateType operatorType, string nickName = null) { Wheres.Add(new ComponentValueOfWhere(property, subSelect, operatorType, nickName)); }