public IHttpActionResult List(OperateCommand model) { var prelicateBuilder = PredicateBuilder.Create <JmpLocuser>(null); if (!string.IsNullOrEmpty(model.SearchKey)) { switch (model.SearchType) { case 1: prelicateBuilder = prelicateBuilder.And(x => x.ULoginname == model.SearchKey); break; case 2: prelicateBuilder = prelicateBuilder.And(x => x.URealname == model.SearchKey); break; } } if (model.SearchState > 0) { switch (model.SearchState) { case 1: prelicateBuilder = prelicateBuilder.And(x => x.UState == 1); break; case 2: prelicateBuilder = prelicateBuilder.And(x => x.UState == 0); break; } } var orderby = model.Sort + " " + model.Order; var list = _jmpLocuserService.FindPagedList(prelicateBuilder, orderby, model.Page, model.Rows); var gridModel = new ViewModel.DataSource.DataSourceResult <JmpLocuser>(list) { Rows = list.Select(x => { var m = x.ToLocalManagementModel(); return(m); }) }; return(Ok(gridModel)); }
public IHttpActionResult EnabledOrDisable(OperateCommand mod) { var ReturnStart = _jmpLocuserService.UpdateStart(mod.SearchState, mod.IdList); return(Ok(ReturnStart)); }
//------------------------------------------------------- // Generic Database Operations //------------------------------------------------------- /// <summary> /// Perform multiple read/write operations on a single key in one batch call. /// A record will be returned if there is a read in the operations list. /// An example would be to add an integer value to an existing record and then /// read the result, all in one database call. /// <para> /// Write operations are always performed first, regardless of operation order /// relative to read operations. /// </para> /// <para> /// Both scalar bin operations (Operation) and list bin operations (ListOperation) /// can be performed in same call. /// </para> /// </summary> /// <param name="policy">write configuration parameters, pass in null for defaults</param> /// <param name="key">unique record identifier</param> /// <param name="operations">database operations to perform</param> /// <exception cref="AerospikeException">if command fails</exception> public Record Operate(WritePolicy policy, Key key, params Operation[] operations) { if (policy == null) { policy = writePolicyDefault; } OperateCommand command = new OperateCommand(cluster, policy, key, operations); command.Execute(); return command.Record; }
public OperateRecord(OperateCommand operateCommand, long inframe) { m_OperateCommand = operateCommand; frame = inframe; }