public override bool CreateCustomBigType(CustomBigType customBigType) { StringBuilder strSql = new StringBuilder(); strSql.Append("Insert Into CustomBigType("); strSql.Append("CustomBigTypeId,CustomBigTypeName"); strSql.Append(") Values ("); strSql.Append("@CustomBigTypeId,@CustomBigTypeName"); strSql.Append(")"); SqlParameter[] parameters = { new SqlParameter("@CustomBigTypeId", SqlDbType.UniqueIdentifier), new SqlParameter("@CustomBigTypeName", SqlDbType.NVarChar) }; parameters[0].Value = customBigType.CustomBigTypeId; parameters[1].Value = customBigType.CustomBigTypeName; int rows; try { rows = DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); } catch (SqlException ex) { throw ex; } return (rows > 0); }
public static CustomBigType CreateInstance(bool isInitDefaultValue) { CustomBigType model = new CustomBigType(); if (isInitDefaultValue) { model.CustomBigTypeId = Guid.NewGuid(); } return model; }
public override bool UpdateCustomBigType(CustomBigType customBigType) { StringBuilder strSql = new StringBuilder(); strSql.Append("Update CustomBigType Set "); strSql.Append(@"CustomBigTypeName = @CustomBigTypeName"); strSql.Append(" Where CustomBigTypeId = @CustomBigTypeId"); SqlParameter[] paramArray = { new SqlParameter("@CustomBigTypeId", SqlDbType.UniqueIdentifier), new SqlParameter("@CustomBigTypeName", SqlDbType.NVarChar) }; paramArray[0].Value = customBigType.CustomBigTypeId; paramArray[1].Value = customBigType.CustomBigTypeName; List<SqlParameter> parameters = new List<SqlParameter>(); parameters.AddRange(paramArray); int rows; try { rows = DbHelperSQL.ExecuteSql(strSql.ToString(),parameters.ToArray()); } catch (SqlException ex) { throw ex; } return (rows > 0); }
public abstract bool UpdateCustomBigType(CustomBigType customBigType);
public abstract bool CreateCustomBigType(CustomBigType customBigType);
public CustomBigType PopulateCustomBigTypeFromIDataReader(IDataReader dr) { CustomBigType model = null; if (dr != null) { model = new CustomBigType(); if (dr["CustomBigTypeId"] is System.DBNull) model.CustomBigTypeId = null; else model.CustomBigTypeId = (Guid)dr["CustomBigTypeId"]; model.CustomBigTypeName = dr["CustomBigTypeName"].ToString(); } return model; }
public static bool Update(CustomBigType customBigType) { CommonDataProvider dp = CommonDataProvider.Instance(); return dp.UpdateCustomBigType(customBigType); }