private void Model_MouseUp(object sender, OxyMouseEventArgs e) { isPanBar = false; if (RectangleUI != null && isSelected) { if (Math.Abs(RectangleUI.X1 - RectangleUI.X0) < 10) { ClearBar(); SelectedData.Clear(); } else { double min = RectangleUI.X0 < RectangleUI.X1 ? RectangleUI.X0 : RectangleUI.X1; double max = RectangleUI.X0 > RectangleUI.X1 ? RectangleUI.X0 : RectangleUI.X1; RectangleUI = new RectangleBarItem(min, Int16.MinValue, max, Int16.MaxValue); RectangleUI.Color = OxyColor.FromArgb(100, 250, 0, 0); Bar.Items.Add(RectangleUI); Bar.Items.RemoveAt(0); Line.Points.Where(point => point.X > min && point.X < max).ToList().ForEach(p => { SelectedData.Add(new Complex(p.Y, 0)); }); LastX = (int)min; Debug.WriteLine(SelectedData.Count()); } } isSelected = false; }
private void ProcessFFT() { double width = RectangleUI.X1 - RectangleUI.X0; SelectedData.Clear(); double[] func = FFTHelper.WindowFunc(SelectedWindowFunc, (int)width); int px = -1; int i = 0; Line.Points.Where(point => point.X >= RectangleUI.X0 && point.X <= RectangleUI.X1).ToList().ForEach(p => { if (px == -1) { px = (int)p.X; } double pY = !IsMagnitude ? p.Y * func[i] : p.Y; SelectedData.Add(new Complex(pY, 0)); if (i < width - 1) { i++; } }); // Process((int)RectangleUI.X0, (int)RectangleUI.X1); }
private void Morphing() { int startPos = (int)RectangleUI.X0; int err = (SelectedData.Count() % 2); SelectedData.RemoveRange((SelectedData.Count() - 1 - err), err); Complex[] tempFFT = FFT2Helper.fft(SelectedData.ToArray()); int start = 0; int count = 90; int dest = 10; tempFFT.ToList().GetRange(start, count).CopyTo(tempFFT.ToArray(), dest); for (int i = start; i < dest - start; i++) { tempFFT[i] = new Complex(0, 0); } for (int i = start; i < start + count; i++) { tempFFT[(tempFFT.Count() - 1) - i] = tempFFT[i]; } IFFT(tempFFT, startPos); // Line.Points.AddRange(res.ToList()); Model.InvalidatePlot(true); }
public static ImportDataDelegate <Customer> CreateCoolCustomerImportDataFromXmlFileDelegate(XafApplication application) { IObjectSpace os1 = application.CreateObjectSpace(); SelectedData data = GetData(os1); return(delegate(IObjectSpace os, object[] args) { object masterObject = null; int index = 0; if (args != null) { if (args.Length == 2) { masterObject = args[0]; index = Convert.ToInt32(args[1]); } } foreach (var result in data.ResultSet) { if (index < result.Rows.Count()) { Customer customer = os.CreateObject <Customer>(); customer.Name = result.Rows[index].Values[0].ToString(); customer.Address = result.Rows[index].Values[1].ToString(); customer.Code = result.Rows[index].Values[2].ToString(); customer.CreditDays = Convert.ToInt32(result.Rows[index].Values[3]); customer.CreditLimit = Convert.ToDecimal(result.Rows[index].Values[4]); customer.ERPCode = result.Rows[index].Values[2].ToString(); return customer; } } return null; }); }
public void GenerateData(List <StockDatas> data) { for (int i = 29; i < data.Count - 1; i++) { SelectedData.Add(data[i]); } }
private void GetSalesRate() { try { string sqlquery = ""; sqlquery = " select top 1 price from billdet where prodcode='" + Product.Code + "' and Custcode='" + SalesInvoice.Customer.ERPCode + "' order by bill_date desc"; //Initialize your data layer. //By default if you don't do this, XPO will try and use an access databse (jet) Session session = new Session(); XpoDefault.DataLayer = XpoDefault.GetDataLayer(MSSqlConnectionProvider.GetConnectionString(SalesInvoice.Company.ServerName, SalesInvoice.Company.ERPMasterDB + SalesInvoice.Company.Initials), AutoCreateOption.None); //XpoDefault.DataLayer = XpoDefault.GetDataLayer(MSSqlConnectionProvider.GetConnectionString("ACC00", SalesInvoice.Company.ERPMasterDB + SalesInvoice.Company.Initials), AutoCreateOption.None); XpoDefault.Session = session; //Equivalent of SELECT * FROM TableName in SQL // YourClassName would be your XPO object (your persistent object) using (var uow = new UnitOfWork()) { SelectedData sd = uow.ExecuteQuery(sqlquery); foreach (var item in sd.ResultSet) { Price = Convert.ToDecimal(item.Rows[0].Values[0]); } } } catch (Exception ex) { } }
private void FooterLeft() { EditorGUILayout.BeginHorizontal(); { GUI.backgroundColor = Color.cyan; if (GUILayout.Button("Apply Setting", GUILayout.Height(30))) { UndoHelper.BuilderDataUndo("Apply Config"); CurrentConfig = SelectedData.CurrentConfig; SelectedData.ApplyConfig(); SelectedData.ApplyVersionListConfig(); if (CurrentConfig != null) { TreeViewInitialize(); } } GUI.backgroundColor = Color.white; GUI.backgroundColor = Color.yellow; if (GUILayout.Button("Load Assets", GUILayout.Height(30))) { UndoHelper.BuilderDataUndo("Load Assets"); CurrentConfig = SelectedData.CurrentConfig; if (CurrentConfig != null) { SelectedData.BuildAssets = TreeHelper.GetFileTreeViewItems(CurrentConfig.AssetBundleBuildRootPath); SelectedData.ApplyConfig(); SelectedData.LoadNewestAssetBundleList(); SelectedData.ApplyVersionListConfig(); TreeViewInitialize(); } } GUI.backgroundColor = Color.white; } EditorGUILayout.EndHorizontal(); }
public static int ExecuteProc(string procName, params OperandValue[] parameters) { SelectedData result = null; string s_error = string.Empty; int i_ret_code = 0; try { result = XpoDefault.Session.ExecuteSproc(procName.ToUpper(), parameters); i_ret_code = Convert.ToInt32(result.ResultSet[1].Rows[0].Values[1]); if (result.ResultSet[1].Rows[1].Values[1] != null) { s_error = result.ResultSet[1].Rows[1].Values[1].ToString(); } if (i_ret_code > 0) { return(i_ret_code); } else { ///LogUtils.Error(s_error); XtraMessageBox.Show(s_error, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); return(-1); } } catch (Exception ee) { LogUtils.Error(ee.ToString()); XtraMessageBox.Show(ee.ToString(), "执行错误", MessageBoxButtons.OK, MessageBoxIcon.Error); return(-1); } }
public static ImportDataDelegate <Agent> CreateCoolAgentImportDataFromXmlFileDelegate(XafApplication application) { IObjectSpace os1 = application.CreateObjectSpace(); SelectedData data = GetData(os1); return(delegate(IObjectSpace os, object[] args) { object masterObject = null; int index = 0; if (args != null) { if (args.Length == 2) { masterObject = args[0]; index = Convert.ToInt32(args[1]); } } foreach (var result in data.ResultSet) { if (index < result.Rows.Count()) { Agent agent = os.CreateObject <Agent>(); agent.Name = result.Rows[index].Values[0].ToString(); agent.Address = result.Rows[index].Values[1].ToString(); agent.Code = result.Rows[index].Values[2].ToString(); return agent; } } return null; }); }
public void Clear() { AllData.Clear(); FilterString = ""; SelectedData.Clear(); SelectedItem = null; }
private void ReadDataWave() { System.Windows.Forms.OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Filter = "All Supported Files (*.wav)|*.wav"; if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.Cancel) { return; } FileName = openFileDialog.FileName; WavFile file = new WavFile(FileName); //входной файл WavData orig = file.ReadData(); Processed = new WavData(orig.Header, orig.Data.Length); SelectedData.Clear(); Line.Points.Clear(); using (orig) { int c = orig.GetSamplesCount(); int x = 0; for (int i = 0; i < c; i++) { float y = orig.ReadNextSample(); //читаем следующий семпл Line.Points.Add(new DataPoint(x++, y)); } Model.InvalidatePlot(true); } }
private void EditData() { DataModel newData = new DataModel { Date = SelectedData.Date, Description = SelectedData.Description, Login = SelectedData.Login, Password = SelectedData.Password }; Views.DataValidateView validateView = new Views.DataValidateView(); DataValidateViewModel validateVM = new DataValidateViewModel(ref newData, ref validateView.passwordBox); validateView.DataContext = validateVM; validateView.ShowDialog(); if (!SelectedData.Equals(newData)) { try { storageHandler.ReplaceData(SelectedData, newData); } catch (FileNotFoundException ex) { MessageBox.Show($"File not found {ex.Message}."); } catch (InvalidOperationException ex) { MessageBox.Show($"Can't write data to file {ex.Message}."); } catch (Exception ex) { MessageBox.Show($"Something is wrong {ex.Message}."); } DataChanged(); } }
private void Model_MouseDown(object sender, OxyMouseDownEventArgs e) { if (IsLeftMousePressed()) { X = (int)(OxyPlot.Axes.Axis.InverseTransform(e.Position, Model.Axes[0], Model.Axes[1]).X); if (RectangleUI != null) { if (X > RectangleUI.X0 && X < RectangleUI.X1) { isPanBar = true; LastX = X; } } if (!isPanBar) { isSelected = true; SelectedData.Clear(); if (RectangleUI != null) { ClearBar(); } } } }
private void Morphing2() { int startPos = (int)RectangleUI.X0; DataPoint[] res = new DataPoint[SelectedData.Count() - 2048]; for (int x = 0; x < SelectedData.Count() - 2048; x += 100) { if (x + 2048 < SelectedData.Count() - 2048) { Complex[] tempFFT = FFT2Helper.fft(SelectedData.GetRange(x, 2048).ToArray()); int start = 0; int count = 900; int dest = 10; tempFFT.ToList().GetRange(start, count).CopyTo(tempFFT.ToArray(), dest); for (int i = start; i < dest - start; i++) { tempFFT[i] = new Complex(0, 0); } for (int i = start; i < start + count; i++) { tempFFT[(tempFFT.Count() - 1) - i] = tempFFT[i]; } IFFT(tempFFT, startPos + x); } } // Line.Points.AddRange(res.ToList()); Model.InvalidatePlot(true); }
public SelectedData GetOrgDetails() { var result = new SelectedData(); var ds = SqlHelper.ExecuteDataset(_connectionString, SqlObject.CommandText, SqlObject.Parameters); result.SelectedDetails = JsonConvert.SerializeObject(ds.Tables[0]); return(result); }
private void FDIT_MigrarAction_Execute(object sender, SimpleActionExecuteEventArgs e) { var os = (XPObjectSpace)ObjectSpace; SelectedData sd = os.Session.ExecuteSproc("fdit.spMigrador_FM"); MessageBox.Show("Fin Migración", "Resultado"); }
public void DataIsNotNullWhenSetSelectedData() { SelectedData <Property> selectedData = new SelectedData <Property>(); selectedData.data = new Property(); selectedData.selected = true; Assert.IsNotNull(selectedData); }
private void Checked(object sender, RoutedEventArgs e) { FilterData item = (FilterData)((CheckBox)e.OriginalSource).Tag; if (!SelectedData.Contains(item.Data)) { SelectedData.Add(item.Data); } }
public async Task <byte[]> SelectData() { byte[] Bytes = null; Bytes = await Request.GetRawBodyBytesAsync(); SelectedData SelectedData = _DataStore.SelectData(RestApiDataStore.GetObjectsFromByteArray <SelectStatement[]>(Bytes)); return(RestApiDataStore.ToByteArray(SelectedData)); }
SelectedData GetSelectedData(MouseHandlerInfo mhi) { SelectedData sd = null; if (mhi._pos != null) { HomelandsLocation loc = _locations[mhi._pos]; sd = new SelectedData(loc); } return(sd); }
private void EditDataButton_Click(object sender, EventArgs e) { if (SelectedData == null) { MessageBox.Show("Choose dataset", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } CurrentEditedData = SelectedData.Clone(); EditWindowLoadData(CurrentEditedData); TabControlMenu.SelectedTab = EditPage; }
public MouseHandlerOutput GetMouseHandlerOutput(MouseHandlerInfo mhi) { dStructurePlacement builtBuilding = GetStructurePlacement(mhi); SelectedData selected = GetSelectedData(mhi); MouseHandlerOutput mho = new MouseHandlerOutput(); mho._structurePlaced = builtBuilding; mho._selected = selected; return(mho); }
private void popupWindowShowAction_Execute(object sender, PopupWindowShowActionExecuteEventArgs e) { // sample code when OK button is pressed var popupDetailWinObj = (ValorDeposito)_popupDetailView.CurrentObject; //var xos = View.ObjectSpace.GetObject(escribania_LibroRequerimiento)Oid); //var LibroRequerimiento = PopupDetailWinObj..GetParentObject(escribania_LibroRequerimiento_escribania_LibroRequerimientoActa_ListView)..LibroRequerimiento.Oid; //var LibroRequerimiento = PopupDetailWinObj.LibroRequerimiento.Oid; //var serie = PopupDetailWinObj.Serie; //var numero = Convert.ToInt32(PopupDetailWinObj.Numero); //var os = (XPObjectSpace)ObjectSpace; //determinar nombre de usuario //var usuario = SecuritySystem.CurrentUser as DevExpress.ExpressApp.Security.Strategy.SecuritySystemUser; //for (var i = numero; i < numero + 200; i++) //{ // os.Session.ExecuteScalar(string.Format("INSERT INTO escribania.LibroRequerimientoActa (LibroRequerimiento, Serie, Numero, Acta) VALUES ({0}, UPPER('{1}'), {2}, '{3}')", LibroRequerimiento, serie, i, i - numero + 1)); //} View.ObjectSpace.Refresh(); ///////////// IList valoresSeleccionados = View.SelectedObjects; if (valoresSeleccionados.Count < 1) { return; } int boletaDepositoNumero = popupDetailWinObj.Numero; int cuentaADepositar = popupDetailWinObj.CuentaADepositar.Oid; var os = (XPObjectSpace)ObjectSpace; foreach (Valor i in valoresSeleccionados) { try { //Actualizar SelectedData sd = os.Session.ExecuteSproc("fondos.spValorADepositar", i.Oid, cuentaADepositar, boletaDepositoNumero); } catch (Exception exc) { throw new Exception(exc.Message); } } View.ObjectSpace.Refresh(); //os.Refresh(); }
public async Task <SelectedData> SelectDataAsync(CancellationToken cancellationToken, params SelectStatement[] selects) { string serialized_selects = Serialize(selects); var content = new StringContent(JsonSerializer.Serialize(serialized_selects), Encoding.UTF8, "application/json"); HttpResponseMessage response = await client.PostAsync($"api/xpo/selectdataasync", content, cancellationToken).ConfigureAwait(false); response.EnsureSuccessStatusCode(); string result = JsonSerializer.Deserialize <string>(await response.Content.ReadAsStringAsync().ConfigureAwait(false)); SelectedData response_deserialized = Deserialize <OperationResult <SelectedData> >(result).Result; return(response_deserialized); }
private void SelectableData_ObjectSelectionChanged(object sender, SelectableObjectEventArgs e) { var selectedObject = (SelectableObject <IVoxelDataStructure>)sender; if (e.IsNowSelected) { SelectedData.Add(selectedObject.Value); } else { SelectedData.Remove(selectedObject.Value); } }
/// <summary> /// Здесь пока все в куче: поднятие/создание объекта, загрузка справочников для списков, настройка внешнего вида... /// </summary> void initForm() { if (edit) { currentOperations = uow.GetObjectByKey <device_Operations>(currentOperationsGuid); } else { currentOperations = new device_Operations(uow); } #region Настройка внешнего вида if (edit) { Text = string.Format("Редактировать операцию {0} ", currentOperations.NameOperations); addButton.Text = "Сохранить"; } if (view) { Text = string.Format("Просмотр операцию {0} ", currentOperations.NameOperations); nameOperationsTextEdit.ReadOnly = true; typeOperationsGUIDLookUpEdit1.ReadOnly = true; timeEdit1.ReadOnly = true; workTeamGUIDLookUpEdit.ReadOnly = true; layoutControlItem7.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; } #endregion #region Заполнение выпадающего списка данными using (Session u = new Session()) { SelectedData typeOperationsGUIDData = u.ExecuteQuery(@"SELECT GUID,NameOperationsType FROM [device].TypeOperations WHERE[DeletedDate] is null"); typeOperationsGUIDDataView.LoadData(typeOperationsGUIDData); } using (Session u = new Session()) { SelectedData workTeamGUID = u.ExecuteQuery(@"SELECT GUID,NumberOfWorkers FROM [device].WorkTeam WHERE[DeletedDate] is null"); workTeamGUIDDataView.LoadData(workTeamGUID); } #endregion if (edit) { nameOperationsTextEdit.Text = currentOperations.NameOperations; typeOperationsGUIDLookUpEdit1.EditValue = currentOperations.TypeOperationsGUID; timeEdit1.Text = currentOperations.OperationTime.ToString(); workTeamGUIDLookUpEdit.EditValue = currentOperations.WorkTeamGUID; } }
//데이터리스트 제거 public void DeleteData(PswdData DeleteData) { int index = 0; foreach (PswdData SelectedData in DataList) { if (SelectedData.IsSame(DeleteData)) { DataList.RemoveAt(index); break; } index++; } }
//데이터리스트 수정 public void ModifyData(PswdData LastData, PswdData NewData) { int index = 0; foreach (PswdData SelectedData in DataList) { if (SelectedData.IsSame(LastData)) { DataList[index].SetData(NewData); break; } index++; } }
static bool IsEmpty(IDataStore dataStore, DBTable table) { SelectStatement select = new SelectStatement(table, "N0") { Condition = new QueryOperand("GCRecord", "N0", DBColumnType.Int32).IsNull(), TopSelectedRecords = 1 }; select.Operands.AddRange(new[] { new QuerySubQueryContainer(null, null, Aggregate.Count) }); SelectedData data = dataStore.SelectData(select); int cnt = (int)data.ResultSet[0].Rows[0].Values[0]; return(cnt == 0); }
private async Task selectItemAsync(TItem item, object selected) { if ((bool)selected) { SelectedData.Add(item); } else { SelectedData.Remove(item); } await SelectedDataChanged.InvokeAsync(SelectedData); StateHasChanged(); }