private EnumerableRowCollection <DataRow> Get( Context context, SiteSettings ss, SqlColumnCollection column = null, SqlJoinCollection join = null, SqlWhereCollection where = null, SqlOrderByCollection orderBy = null, SqlParamCollection param = null, Sqls.TableTypes tableType = Sqls.TableTypes.Normal, bool distinct = false, int top = 0, int offset = 0, int pageSize = 0, bool history = false, bool countRecord = false) { var statements = new List <SqlStatement> { Rds.SelectResults( dataTableName: "Main", column: column ?? Rds.ResultsDefaultColumns(), join: join ?? Rds.ResultsJoinDefault(), where : where, orderBy: orderBy, param: param, tableType: tableType, distinct: distinct, top: top, offset: offset, pageSize: pageSize, countRecord: countRecord) }; var dataSet = Rds.ExecuteDataSet( context: context, transactional: false, statements: statements.ToArray()); TotalCount = Rds.Count(dataSet); return(dataSet.Tables["Main"].AsEnumerable()); }
public static SqlWhereCollection SetCanReadWhere( Context context, SiteSettings ss, SqlWhereCollection where, bool checkPermission = true) { if (ss.IsSite(context: context) && ss.ReferenceType == "Sites") { where.Add( tableName: "Sites", raw: $"[Sites].[ParentId] in ({ss.SiteId})"); } else { if (ss.ColumnHash.ContainsKey("SiteId")) { if (ss.AllowedIntegratedSites != null) { where.Or(new SqlWhereCollection() .Add( tableName: ss.ReferenceType, raw: "[{0}].[SiteId] in ({1})".Params( ss.ReferenceType, ss.AllowedIntegratedSites.Join())) .CheckRecordPermission(ss, ss.IntegratedSites)); } else { where.Add( tableName: ss.ReferenceType, raw: "[{0}].[SiteId] in ({1})".Params( ss.ReferenceType, ss.SiteId)); if (!context.CanRead(ss: ss, site: true) && checkPermission) { where.CheckRecordPermission(ss); } } } } return(where); }
private SqlStatement CopyToStatement(SqlWhereCollection where, Sqls.TableTypes tableType) { var column = new Rds.OutgoingMailsColumnCollection(); var param = new Rds.OutgoingMailsParamCollection(); column.ReferenceType(function: Sqls.Functions.SingleColumn); param.ReferenceType(); column.ReferenceId(function: Sqls.Functions.SingleColumn); param.ReferenceId(); column.ReferenceVer(function: Sqls.Functions.SingleColumn); param.ReferenceVer(); column.OutgoingMailId(function: Sqls.Functions.SingleColumn); param.OutgoingMailId(); column.Ver(function: Sqls.Functions.SingleColumn); param.Ver(); column.Host(function: Sqls.Functions.SingleColumn); param.Host(); column.Port(function: Sqls.Functions.SingleColumn); param.Port(); column.From(function: Sqls.Functions.SingleColumn); param.From(); column.To(function: Sqls.Functions.SingleColumn); param.To(); column.Cc(function: Sqls.Functions.SingleColumn); param.Cc(); column.Bcc(function: Sqls.Functions.SingleColumn); param.Bcc(); column.Title(function: Sqls.Functions.SingleColumn); param.Title(); column.Body(function: Sqls.Functions.SingleColumn); param.Body(); column.SentTime(function: Sqls.Functions.SingleColumn); param.SentTime(); column.Comments(function: Sqls.Functions.SingleColumn); param.Comments(); column.Creator(function: Sqls.Functions.SingleColumn); param.Creator(); column.Updator(function: Sqls.Functions.SingleColumn); param.Updator(); column.CreatedTime(function: Sqls.Functions.SingleColumn); param.CreatedTime(); column.UpdatedTime(function: Sqls.Functions.SingleColumn); param.UpdatedTime(); ColumnNames().ForEach(columnName => { column.Add( columnBracket: $"[{columnName}]", columnName: columnName, function: Sqls.Functions.SingleColumn); param.Add( columnBracket: $"[{columnName}]", name: columnName); }); return(Rds.InsertOutgoingMails( tableType: tableType, param: param, select: Rds.SelectOutgoingMails(column: column, where : where), addUpdatorParam: false)); }
public ErrorData UpdateOrCreate( Context context, SqlWhereCollection where = null, SqlParamCollection param = null) { SetBySession(context: context); var statements = new List<SqlStatement> { Rds.UpdateOrInsertExportSettings( where: where ?? Rds.ExportSettingsWhereDefault(this), param: param ?? Rds.ExportSettingsParamDefault( context: context, exportSettingModel: this, setDefault: true)) }; var response = Rds.ExecuteScalar_response( context: context, transactional: true, selectIdentity: true, statements: statements.ToArray()); ExportSettingId = (response.Id ?? ExportSettingId).ToLong(); Get(context: context); return new ErrorData(type: Error.Types.None); }
public GridData( Context context, SiteSettings ss, View view, SqlColumnCollection column = null, SqlJoinCollection join = null, SqlWhereCollection where = null, int top = 0, int offset = 0, int pageSize = 0) { Get( context: context, ss: ss, view: view, column: column, join: join, where : where, top: top, offset: offset, pageSize: pageSize); }
private List <SqlStatement> UpdateStatements( Context context, string dataTableName = null, SqlWhereCollection where = null, SqlParamCollection param = null, bool otherInitValue = false) { return(new List <SqlStatement> { Rds.UpdateDepts( dataTableName: dataTableName, where : where, param: param ?? Rds.DeptsParamDefault( context: context, deptModel: this, otherInitValue: otherInitValue)), new SqlStatement(Def.Sql.IfConflicted.Params(DeptId)), StatusUtilities.UpdateStatus( tenantId: context.TenantId, type: StatusUtilities.Types.DeptsUpdated), }); }
public Error.Types UpdateOrCreate( RdsUser rdsUser = null, SqlWhereCollection where = null, SqlParamCollection param = null) { SetBySession(); var statements = new List <SqlStatement> { Rds.UpdateOrInsertHealths( where : where ?? Rds.HealthsWhereDefault(this), param: param ?? Rds.HealthsParamDefault(this, setDefault: true)) }; var response = Rds.ExecuteScalar_response( rdsUser: rdsUser, transactional: true, selectIdentity: true, statements: statements.ToArray()); HealthId = (response.Identity ?? HealthId).ToLong(); Get(); return(Error.Types.None); }
private SqlStatement CopyToStatement(SqlWhereCollection where, Sqls.TableTypes tableType) { var column = new Rds.DeptsColumnCollection(); var param = new Rds.DeptsParamCollection(); column.TenantId(function: Sqls.Functions.SingleColumn); param.TenantId(); column.DeptId(function: Sqls.Functions.SingleColumn); param.DeptId(); column.Ver(function: Sqls.Functions.SingleColumn); param.Ver(); column.DeptCode(function: Sqls.Functions.SingleColumn); param.DeptCode(); column.DeptName(function: Sqls.Functions.SingleColumn); param.DeptName(); column.Body(function: Sqls.Functions.SingleColumn); param.Body(); column.Comments(function: Sqls.Functions.SingleColumn); param.Comments(); column.Creator(function: Sqls.Functions.SingleColumn); param.Creator(); column.Updator(function: Sqls.Functions.SingleColumn); param.Updator(); column.CreatedTime(function: Sqls.Functions.SingleColumn); param.CreatedTime(); column.UpdatedTime(function: Sqls.Functions.SingleColumn); param.UpdatedTime(); return(Rds.InsertDepts( tableType: tableType, param: param, select: Rds.SelectDepts(column: column, where : where), addUpdatorParam: false)); }
public Error.Types UpdateOrCreate( RdsUser rdsUser = null, SqlWhereCollection where = null, SqlParamCollection param = null) { SetBySession(); var statements = new List <SqlStatement> { Rds.UpdateOrInsertBinaries( selectIdentity: true, where : where ?? Rds.BinariesWhereDefault(this), param: param ?? Rds.BinariesParamDefault(this, setDefault: true)) }; var newId = Rds.ExecuteScalar_long( rdsUser: rdsUser, transactional: true, statements: statements.ToArray()); BinaryId = newId != 0 ? newId : BinaryId; Get(); return(Error.Types.None); }
/// <summary> /// Fixed: /// </summary> public string UpdateOrCreate( Context context, SiteSettings ss, SqlWhereCollection where = null, SqlParamCollection param = null, Sqls.TableTypes tableType = Sqls.TableTypes.Normal) { Repository.ExecuteNonQuery( context: context, transactional: true, statements: Rds.UpdateOrInsertOrders( where : where ?? Rds.OrdersWhereDefault( context: context, orderModel: this), param: param ?? Rds.OrdersParamDefault( context: context, ss: ss, orderModel: this, setDefault: true), tableType: tableType)); return(new ResponseCollection().ToJson()); }
public GroupModel Get( SiteSettings ss, Sqls.TableTypes tableType = Sqls.TableTypes.Normal, SqlColumnCollection column = null, SqlJoinCollection join = null, SqlWhereCollection where = null, SqlOrderByCollection orderBy = null, SqlParamCollection param = null, bool distinct = false, int top = 0) { Set(ss, Rds.ExecuteTable(statements: Rds.SelectGroups( tableType: tableType, column: column ?? Rds.GroupsDefaultColumns(), join: join ?? Rds.GroupsJoinDefault(), where : where ?? Rds.GroupsWhereDefault(this), orderBy: orderBy, param: param, distinct: distinct, top: top))); return(this); }
private static ResponseFile Json( Context context, SiteSettings ss, Export export, SqlWhereCollection where) { return(new ResponseFile( fileContent: GridData( context: context, ss: ss, export: export, where : where) .Json( context: context, ss: ss, export: export), fileDownloadName: FileName( context: context, ss: ss, name: export.Name, extension: export.Type.ToString()))); }
private static Dictionary <long, long> ResultData( SiteSettings ss, Dictionary <long, Dictionary <long, Dictionary <int, string> > > data, SqlWhereCollection where, SqlOrderByCollection orderBy, Export export, Dictionary <long, long> keys, Dictionary <long, string> keyColumns) { ss.SetColumnAccessControls(); ss.SetChoiceHash(); var keyColumn = keyColumns.Get(ss.SiteId); var resultHash = new ResultCollection( ss: ss, column: ResultsColumn(ss, export, ss.GetColumn(keyColumn)), where : where, orderBy: orderBy) .ToDictionary(o => o.ResultId, o => o); resultHash.Values.ToList().SetLinks(ss); if (keys == null) { data.Add(ss.SiteId, resultHash.ToDictionary( o => o.Value.ResultId, o => ResultData(ss, export, o.Value))); return(resultHash.ToDictionary( o => o.Key, o => o.Value.PropertyValue(keyColumn).ToLong())); } else { data.Add(ss.SiteId, keys.ToDictionary( o => o.Key, o => ResultData(ss, export, resultHash.Get(o.Value)))); return(keys.ToDictionary( o => o.Key, o => resultHash.Get(o.Value)?.PropertyValue(keyColumn).ToLong() ?? 0)); } }
private SqlStatement CopyToStatement(SqlWhereCollection where, Sqls.TableTypes tableType) { var column = new Rds.TenantsColumnCollection(); var param = new Rds.TenantsParamCollection(); column.TenantId(function: Sqls.Functions.SingleColumn); param.TenantId(); column.Ver(function: Sqls.Functions.SingleColumn); param.Ver(); column.TenantName(function: Sqls.Functions.SingleColumn); param.TenantName(); column.Title(function: Sqls.Functions.SingleColumn); param.Title(); column.Body(function: Sqls.Functions.SingleColumn); param.Body(); column.ContractSettings(function: Sqls.Functions.SingleColumn); param.ContractSettings(); column.ContractDeadline(function: Sqls.Functions.SingleColumn); param.ContractDeadline(); column.DisableAllUsersPermission(function: Sqls.Functions.SingleColumn); param.DisableAllUsersPermission(); column.LogoType(function: Sqls.Functions.SingleColumn); param.LogoType(); column.HtmlTitleTop(function: Sqls.Functions.SingleColumn); param.HtmlTitleTop(); column.HtmlTitleSite(function: Sqls.Functions.SingleColumn); param.HtmlTitleSite(); column.HtmlTitleRecord(function: Sqls.Functions.SingleColumn); param.HtmlTitleRecord(); column.Comments(function: Sqls.Functions.SingleColumn); param.Comments(); column.Creator(function: Sqls.Functions.SingleColumn); param.Creator(); column.Updator(function: Sqls.Functions.SingleColumn); param.Updator(); column.CreatedTime(function: Sqls.Functions.SingleColumn); param.CreatedTime(); column.UpdatedTime(function: Sqls.Functions.SingleColumn); param.UpdatedTime(); ColumnNames().ForEach(columnName => { column.Add( columnBracket: $"[{columnName}]", columnName: columnName, function: Sqls.Functions.SingleColumn); param.Add( columnBracket: $"[{columnName}]", name: columnName); }); return(Rds.InsertTenants( tableType: tableType, param: param, select: Rds.SelectTenants(column: column, where : where), addUpdatorParam: false)); }
private static void SetAggregations( SiteSettings ss, IEnumerable <Aggregation> aggregations, SqlJoinCollection join, SqlWhereCollection where, List <SqlStatement> statements) { switch (ss.ReferenceType) { case "Depts": statements.AddRange(Rds.DeptsAggregations(aggregations, join, where)); break; case "Groups": statements.AddRange(Rds.GroupsAggregations(aggregations, join, where)); break; case "Users": statements.AddRange(Rds.UsersAggregations(aggregations, join, where)); break; case "Sites": statements.AddRange(Rds.SitesAggregations(aggregations, join, where)); break; case "Issues": statements.AddRange(Rds.IssuesAggregations(aggregations, join, where)); break; case "Results": statements.AddRange(Rds.ResultsAggregations(aggregations, join, where)); break; case "Wikis": statements.AddRange(Rds.WikisAggregations(aggregations, join, where)); break; } }
private static Dictionary <long, long> IssueData( SiteSettings ss, Dictionary <long, Dictionary <long, Dictionary <int, string> > > data, SqlWhereCollection where, SqlOrderByCollection orderBy, Export export, Dictionary <long, long> keys, Dictionary <long, string> keyColumns) { ss.SetColumnAccessControls(); var keyColumn = keyColumns.Get(ss.SiteId); var issueHash = new IssueCollection( ss: ss, column: IssuesColumn(ss, export, ss.GetColumn(keyColumn)), join: ss.Join(withColumn: true), where : where, orderBy: orderBy) .ToDictionary(o => o.IssueId, o => o); if (keys == null) { data.Add(ss.SiteId, issueHash.ToDictionary( o => o.Value.IssueId, o => IssueData(ss, export, o.Value))); return(issueHash.ToDictionary( o => o.Key, o => o.Value.PropertyValue(keyColumn).ToLong())); } else { data.Add(ss.SiteId, keys.ToDictionary( o => o.Key, o => IssueData(ss, export, issueHash.Get(o.Value)))); return(keys.ToDictionary( o => o.Key, o => issueHash.Get(o.Value)?.PropertyValue(keyColumn).ToLong() ?? 0)); } }
private List <SqlStatement> UpdateStatements( Context context, string dataTableName = null, SqlWhereCollection where = null, SqlParamCollection param = null, bool otherInitValue = false) { return(new List <SqlStatement> { Rds.UpdateMailAddresses( dataTableName: dataTableName, where : where, param: param ?? Rds.MailAddressesParamDefault( context: context, mailAddressModel: this, otherInitValue: otherInitValue)), new SqlStatement(Def.Sql.IfConflicted.Params(MailAddressId)) { IfConflicted = true, Id = MailAddressId } }); }
public Error.Types UpdateOrCreate( Context context, SqlWhereCollection where = null, SqlParamCollection param = null) { SetBySession(context: context); var statements = new List <SqlStatement> { Rds.UpdateOrInsertBinaries( where : where ?? Rds.BinariesWhereDefault(this), param: param ?? Rds.BinariesParamDefault( context: context, binaryModel: this, setDefault: true)) }; var response = Rds.ExecuteScalar_response( context: context, transactional: true, selectIdentity: true, statements: statements.ToArray()); BinaryId = (response.Identity ?? BinaryId).ToLong(); Get(context: context); return(Error.Types.None); }
public ErrorData UpdateOrCreate( Context context, SqlWhereCollection where = null, SqlParamCollection param = null) { SetBySession(context: context); var statements = new List <SqlStatement> { Rds.UpdateOrInsertDemos( where : where ?? Rds.DemosWhereDefault(this), param: param ?? Rds.DemosParamDefault( context: context, demoModel: this, setDefault: true)) }; var response = Repository.ExecuteScalar_response( context: context, transactional: true, selectIdentity: true, statements: statements.ToArray()); DemoId = (response.Id ?? DemoId).ToInt(); Get(context: context); return(new ErrorData(type: Error.Types.None)); }
private static GridData GridData( Context context, SiteSettings ss, Export export, SqlWhereCollection where, View view) { export.SetColumns( context: context, ss: ss); ss.SetColumnAccessControls(context: context); view.GridColumns = export.Columns .Where(o => o.Column.CanRead) .Select(o => o.ColumnName) .ToList(); var gridData = new GridData( context: context, ss: ss, view: view, where : where); return(gridData); }
private SqlStatement CopyToStatement(SqlWhereCollection where, Sqls.TableTypes tableType) { var column = new Rds.DemosColumnCollection(); var param = new Rds.DemosParamCollection(); column.DemoId(function: Sqls.Functions.SingleColumn); param.DemoId(); column.Ver(function: Sqls.Functions.SingleColumn); param.Ver(); column.TenantId(function: Sqls.Functions.SingleColumn); param.TenantId(); column.Title(function: Sqls.Functions.SingleColumn); param.Title(); column.Passphrase(function: Sqls.Functions.SingleColumn); param.Passphrase(); column.MailAddress(function: Sqls.Functions.SingleColumn); param.MailAddress(); column.Initialized(function: Sqls.Functions.SingleColumn); param.Initialized(); column.Comments(function: Sqls.Functions.SingleColumn); param.Comments(); column.Creator(function: Sqls.Functions.SingleColumn); param.Creator(); column.Updator(function: Sqls.Functions.SingleColumn); param.Updator(); column.CreatedTime(function: Sqls.Functions.SingleColumn); param.CreatedTime(); column.UpdatedTime(function: Sqls.Functions.SingleColumn); param.UpdatedTime(); return(Rds.InsertDemos( tableType: tableType, param: param, select: Rds.SelectDemos(column: column, where : where), addUpdatorParam: false)); }
private void CsStringColumns(Column column, string value, SqlWhereCollection where) { if (column.HasChoices()) { var param = value.Deserialize <List <string> >(); if (param?.Any() == true) { where.Add(or: new SqlWhereCollection( CsStringColumnsWhere(column, param), CsStringColumnsWhereNull(column, param))); } } else { if (!value.IsNullOrEmpty()) { where.SqlWhereLike( value, "([{0}].[{1}] like '%' + @SearchText#ParamCount#_#CommandCount# + '%')" .Params(column.TableName(), column.Name)); } } }
/// <summary> /// Fixed: /// </summary> public static SqlWhereCollection SearchText( this SqlWhereCollection self, Context context, string searchText) { return(self .SqlWhereLike( tableName: "Users", name: "SearchText", searchText: searchText, clauseCollection: new List <string>() { Rds.Users_LoginId_WhereLike(factory: context), Rds.Users_Name_WhereLike(factory: context), Rds.Users_UserCode_WhereLike(factory: context), Rds.Users_Body_WhereLike(factory: context), Rds.Depts_DeptCode_WhereLike(factory: context), Rds.Depts_DeptName_WhereLike(factory: context), Rds.Depts_Body_WhereLike(factory: context), Rds.MailAddresses_MailAddress_WhereLike( factory: context, tableName: "MailAddresses") }) .Users_Disabled(false)); }
private SqlStatement CopyToStatement(SqlWhereCollection where, Sqls.TableTypes tableType) { var column = new Rds.HealthsColumnCollection(); var param = new Rds.HealthsParamCollection(); column.HealthId(function: Sqls.Functions.SingleColumn); param.HealthId(); column.Ver(function: Sqls.Functions.SingleColumn); param.Ver(); column.TenantCount(function: Sqls.Functions.SingleColumn); param.TenantCount(); column.UserCount(function: Sqls.Functions.SingleColumn); param.UserCount(); column.ItemCount(function: Sqls.Functions.SingleColumn); param.ItemCount(); column.ErrorCount(function: Sqls.Functions.SingleColumn); param.ErrorCount(); column.Elapsed(function: Sqls.Functions.SingleColumn); param.Elapsed(); column.Comments(function: Sqls.Functions.SingleColumn); param.Comments(); column.Creator(function: Sqls.Functions.SingleColumn); param.Creator(); column.Updator(function: Sqls.Functions.SingleColumn); param.Updator(); column.CreatedTime(function: Sqls.Functions.SingleColumn); param.CreatedTime(); column.UpdatedTime(function: Sqls.Functions.SingleColumn); param.UpdatedTime(); return(Rds.InsertHealths( tableType: tableType, param: param, select: Rds.SelectHealths(column: column, where : where), addUpdatorParam: false)); }
private SqlStatement CopyToStatement(SqlWhereCollection where, Sqls.TableTypes tableType) { var column = new Rds.ExportSettingsColumnCollection(); var param = new Rds.ExportSettingsParamCollection(); column.ReferenceType(function: Sqls.Functions.SingleColumn); param.ReferenceType(); column.ReferenceId(function: Sqls.Functions.SingleColumn); param.ReferenceId(); column.Title(function: Sqls.Functions.SingleColumn); param.Title(); column.ExportSettingId(function: Sqls.Functions.SingleColumn); param.ExportSettingId(); column.Ver(function: Sqls.Functions.SingleColumn); param.Ver(); column.AddHeader(function: Sqls.Functions.SingleColumn); param.AddHeader(); column.ExportColumns(function: Sqls.Functions.SingleColumn); param.ExportColumns(); column.Comments(function: Sqls.Functions.SingleColumn); param.Comments(); column.Creator(function: Sqls.Functions.SingleColumn); param.Creator(); column.Updator(function: Sqls.Functions.SingleColumn); param.Updator(); column.CreatedTime(function: Sqls.Functions.SingleColumn); param.CreatedTime(); column.UpdatedTime(function: Sqls.Functions.SingleColumn); param.UpdatedTime(); return(Rds.InsertExportSettings( tableType: tableType, param: param, select: Rds.SelectExportSettings(column: column, where : where), addUpdatorParam: false)); }
public IssueCollection( Context context, SiteSettings ss, SqlColumnCollection column = null, SqlJoinCollection join = null, SqlWhereCollection where = null, SqlOrderByCollection orderBy = null, SqlParamCollection param = null, Sqls.TableTypes tableType = Sqls.TableTypes.Normal, bool distinct = false, int top = 0, int offset = 0, int pageSize = 0, bool get = true, List <FormData> formDataSet = null) { if (get) { Set( context: context, ss: ss, dataRows: Get( context: context, ss: ss, column: column, join: join, where : where, orderBy: orderBy, param: param, tableType: tableType, distinct: distinct, top: top, offset: offset, pageSize: pageSize), formDataSet: formDataSet); } }
public MailAddressModel Get( Context context, Sqls.TableTypes tableType = Sqls.TableTypes.Normal, SqlColumnCollection column = null, SqlJoinCollection join = null, SqlWhereCollection where = null, SqlOrderByCollection orderBy = null, SqlParamCollection param = null, bool distinct = false, int top = 0) { Set(context, Rds.ExecuteTable( context: context, statements: Rds.SelectMailAddresses( tableType: tableType, column: column ?? Rds.MailAddressesDefaultColumns(), join: join ?? Rds.MailAddressesJoinDefault(), where : where ?? Rds.MailAddressesWhereDefault(this), orderBy: orderBy, param: param, distinct: distinct, top: top))); return(this); }
public ErrorData UpdateOrCreate( Context context, SiteSettings ss, SqlWhereCollection where = null, SqlParamCollection param = null) { SetBySession(context: context); var statements = new List <SqlStatement> { Rds.UpdateOrInsertRegistrations( where : where ?? Rds.RegistrationsWhereDefault(this), param: param ?? Rds.RegistrationsParamDefault( context: context, registrationModel: this, setDefault: true)), }; var response = Rds.ExecuteScalar_response( context: context, transactional: true, selectIdentity: true, statements: statements.ToArray()); RegistrationId = (response.Id ?? RegistrationId).ToInt(); Get(context: context, ss: ss); return(new ErrorData(type: Error.Types.None)); }
private void CsNumericRangeColumns( Column column, List <string> param, SqlWhereCollection where) { var parts = new SqlWhereCollection(); param.ForEach(data => { var from = data.Split_1st(); var to = data.Split_2nd(); if (from == string.Empty) { parts.Add(new SqlWhere( tableName: column.TableName(), columnBrackets: ("[" + column.Name + "]").ToSingleArray(), _operator: "<{0}".Params(to.ToDecimal()))); } else if (to == string.Empty) { parts.Add(new SqlWhere( tableName: column.TableName(), columnBrackets: ("[" + column.Name + "]").ToSingleArray(), _operator: ">={0}".Params(from.ToDecimal()))); } else { parts.Add(new SqlWhere( tableName: column.TableName(), columnBrackets: ("[" + column.Name + "]").ToSingleArray(), _operator: " between {0} and {1}".Params( from.ToDecimal(), to.ToDecimal()))); } }); where.Add(or: parts); }
public Error.Types UpdateOrCreate( SiteSettings ss, RdsUser rdsUser = null, SqlWhereCollection where = null, SqlParamCollection param = null) { SetBySession(); var statements = new List <SqlStatement> { Rds.UpdateOrInsertGroups( selectIdentity: true, where : where ?? Rds.GroupsWhereDefault(this), param: param ?? Rds.GroupsParamDefault(this, setDefault: true)), StatusUtilities.UpdateStatus(StatusUtilities.Types.GroupsUpdated) }; var newId = Rds.ExecuteScalar_int( rdsUser: rdsUser, transactional: true, statements: statements.ToArray()); GroupId = newId != 0 ? newId : GroupId; Get(ss); return(Error.Types.None); }