private void frmCalendar_KeyDown(object sender, KeyEventArgs e) { try { switch (e.KeyCode) { case Keys.Escape: if (!string.IsNullOrEmpty(txtSearch.Text)) { txtSearch.Text = ""; return; } Close(); break; case Keys.Down: if (txtSearch.Focused) { DGrid.Focus(); } break; case Keys.F: if (e.Control) { txtSearch.Focus(); } break; } } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); } }
public frmShowAdvisor(bool status = true) { InitializeComponent(); ucHeader.Text = "نمایش لیست مشاوران"; _st = status; DGrid.Focus(); }
public frmShowBuildingAccountType(bool status = true) { InitializeComponent(); _st = status; SetAccess(); DGrid.Focus(); ucHeader.Text = "نمایش لیست کاربری ملک"; }
public frmShowSandouq(bool status = true) { InitializeComponent(); ucHeader.Text = "نمایش لیست صندوق ها"; _st = status; DGrid.Focus(); SetAccess(); }
public frmShowHazine(bool status = true) { InitializeComponent(); ucHeader.Text = "نمایش لیست هزینه ها"; _st = status; DGrid.Focus(); SetAccess(); }
public frmShowRentalAuthority(bool status = true) { InitializeComponent(); _st = status; SetAccess(); DGrid.Focus(); ucHeader.Text = "نمایش لیست انواع ارجحیت اجاره"; }
public frmShowCities(bool status = true) { InitializeComponent(); _st = status; SetAccess(); DGrid.Focus(); ucHeader.Text = "نمایش لیست شهرها"; }
public frmShowBuildingCondition(bool status = true) { InitializeComponent(); _st = status; SetAccess(); DGrid.Focus(); ucHeader.Text = "نمایش لیست انواع بنا"; }
public frmShowBuildingOption(bool status = true) { InitializeComponent(); _st = status; SetAccess(); DGrid.Focus(); ucHeader.Text = "نمایش لیست امکانات ملک"; }
public frmShowKitchenService(bool status = true) { InitializeComponent(); _st = status; SetAccess(); DGrid.Focus(); ucHeader.Text = "نمایش لیست انواع سرویس آشپزخانه"; }
public frmShowBuildingView(bool status = true) { InitializeComponent(); _st = status; SetAccess(); DGrid.Focus(); ucHeader.Text = "نمایش لیست نمای املاک"; }
public frmShowFloorCover(bool status = true) { InitializeComponent(); _st = status; SetAccess(); DGrid.Focus(); ucHeader.Text = "نمایش لیست انواع کفپوش"; }
public frmShowDasteCheck(bool status = true) { InitializeComponent(); ucHeader.Text = "نمایش لیست دسته چک ها"; _st = status; DGrid.Focus(); SetAccess(); }
public frmShowBanks(bool status = true) { InitializeComponent(); ucHeader.Text = "نمایش لیست حساب های بانکی"; _st = status; DGrid.Focus(); SetAccess(); }
public frmShowDocumentType(bool status = true) { InitializeComponent(); _st = status; SetAccess(); DGrid.Focus(); ucHeader.Text = "نمایش لیست انواع سند"; }
public void LoadLvList() { try { SqlConnection cnSQL = new SqlConnection(MyModules.strConnect); SqlCommand cmSQL = new SqlCommand("FetchUserAccessByPwd", cnSQL); cmdOk.Visible = true; cmSQL.CommandType = CommandType.StoredProcedure; switch (listQuery1) { case "SystemUser": cmSQL.CommandText = "FetchAllUserAccess"; // '-------------Accounts break; case "ActiveSchoolList": cmSQL.CommandText = "SELECT [Sn] AS RefNo,[SchName] ,[SchAddress],[State] FROM [RegisterSchool] WHERE InActive=0"; cmSQL.CommandType = CommandType.Text; break; case "AllPayRequest": cmSQL.CommandText = "AC_FetchAllPayRequest"; cmSQL.Parameters.AddWithValue("@BillType", qryPrm); break; } cnSQL.Open(); dataAdapter = new SqlDataAdapter(cmSQL); //"AC_FetchAllPaymentVouchers", strConnect) SqlCommandBuilder commandBuilder = new SqlCommandBuilder(this.dataAdapter); DataTable table = new DataTable(); table.Locale = System.Globalization.CultureInfo.InvariantCulture; this.dataAdapter.Fill(table); this.bindingSource.DataSource = table; cmSQL.Dispose(); DGrid.Refresh(); lblCount.Text = DGrid.Rows.Count.ToString(); //filterStatusLabel.Text = DGrid.Rows.Count.ToString + " of " + DGrid.Rows.Count.ToString SelColumn.Minimum = 1; SelColumn.Maximum = DGrid.Columns.Count; MyModules.formatGrid(DGrid); return; } catch (Exception ex) { MessageBox.Show("Ooops! ERROR :" + char.ConvertFromUtf32(13) + ex, MyModules.strApptitle, MessageBoxButtons.OK, MessageBoxIcon.Information); // MessageBox.Show("Ooops! ERROR", MyModules.strApptitle, MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public void LoadLvList() { try { SqlConnection cnSQL = new SqlConnection(MyModules.strConnect); SqlCommand cmSQL = new SqlCommand("FetchUserAccessByPwd", cnSQL); cmdOk.Visible = true; cmSQL.CommandType = CommandType.StoredProcedure; switch (listQuery1) { case "SystemUser": cmSQL.CommandText = "FetchAllUserAccess"; // '-------------Accounts break; case "Clients": cmSQL.CommandText = "SELECT [Code] ,[Telephone],[Name],[Outline],[Address],[Email] FROM [Register] WHERE [Discontinue]<>1"; cmSQL.CommandType = CommandType.Text; break; case "Services": cmSQL.CommandText = "SELECT [Sn],[TransDate],[RefNo],[Name],[Telephone] ,[ServiceRendered] ,[ValueOfService] ,[AmountPaid] ,[AmountChargedFromReward],[Username] FROM [RewardAssured].[dbo].[Services] ORDER BY [TransDate] DESC"; cmSQL.CommandType = CommandType.Text; break; } cnSQL.Open(); dataAdapter = new SqlDataAdapter(cmSQL); //"AC_FetchAllPaymentVouchers", strConnect) SqlCommandBuilder commandBuilder = new SqlCommandBuilder(this.dataAdapter); DataTable table = new DataTable(); table.Locale = System.Globalization.CultureInfo.InvariantCulture; this.dataAdapter.Fill(table); this.bindingSource.DataSource = table; cmSQL.Dispose(); DGrid.Refresh(); lblCount.Text = DGrid.Rows.Count.ToString(); //filterStatusLabel.Text = DGrid.Rows.Count.ToString + " of " + DGrid.Rows.Count.ToString SelColumn.Minimum = 1; SelColumn.Maximum = DGrid.Columns.Count; MyModules.formatGrid(DGrid); return; } catch (Exception ex) { MessageBox.Show(ex.Message, MyModules.strApptitle, MessageBoxButtons.OK, MessageBoxIcon.Information); // MessageBox.Show("Ooops! ERROR", MyModules.strApptitle, MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public frmShowRegions(bool status = true) { InitializeComponent(); ucHeader.Text = "نمایش لیست مناطق"; _st = status; rbtnMyRegion.Checked = true; SetAccess(); DGrid.Focus(); }
private void frmShowDesc_KeyDown(object sender, KeyEventArgs e) { try { switch (e.KeyCode) { case Keys.Insert: mnuAdd.PerformClick(); break; case Keys.F7: mnuEdit.PerformClick(); break; case Keys.Delete: mnuDelete.PerformClick(); break; case Keys.Escape: if (!string.IsNullOrEmpty(txtSearch.Text)) { txtSearch.Text = ""; return; } Close(); break; case Keys.Down: if (txtSearch.Focused) { DGrid.Focus(); } break; case Keys.F: if (e.Control) { txtSearch.Focus(); } break; case Keys.Enter: if (DGrid.RowCount <= 0 || DGrid.CurrentRow == null) { return; } Description = DGrid[dgDesc.Index, DGrid.CurrentRow.Index].Value.ToString(); DialogResult = DialogResult.OK; Close(); break; } } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); } }
public frmShowRequest(bool status = true) { InitializeComponent(); ucHeader.Text = "نمایش لیست تقاضاها"; _st = status; SetAccess(); DGrid.Focus(); SetColumns(); }
private void frmShowPardakht_KeyDown(object sender, KeyEventArgs e) { try { switch (e.KeyCode) { case Keys.Insert: mnuAdd.PerformClick(); break; case Keys.F7: mnuEdit.PerformClick(); break; case Keys.Delete: mnuDelete.PerformClick(); break; case Keys.F12: mnuView.PerformClick(); break; case Keys.Escape: if (!string.IsNullOrEmpty(txtSearch.Text)) { txtSearch.Text = ""; return; } Close(); break; case Keys.Down: if (txtSearch.Focused) { DGrid.Focus(); } break; case Keys.F: if (e.Control) { txtSearch.Focus(); } break; case Keys.Enter: mnuEdit.PerformClick(); break; } } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); } }
private void MiCsvLoadClick(object sender, RoutedEventArgs e) { OpenFileDialog openFileDialog = new OpenFileDialog { Filter = "CSV Files|*.csv" }; openFileDialog.ShowDialog(); MyDataTable = LoadDataTabletFromCSVFile(openFileDialog.FileName); DGrid.SetBinding(ItemsControl.ItemsSourceProperty, new Binding { Source = MyDataTable }); }
private void mnuDelete_Click(object sender, EventArgs e) { var res = new ReturnedSaveFuncInfo(); try { if (DGrid.RowCount <= 0 || DGrid.CurrentRow == null) { return; } if (DGrid[DGType.Index, DGrid.CurrentRow.Index].Value.ToString() == "چک") { var str = (ReceptionCheckBussines)GetRowInfo(DGrid.CurrentRow.Index); if (str.CheckStatus != EnCheckM.Mojoud) { res.AddError("جهت ابطال چک از صفحه چکها استفاده نمایید ."); return; } } if (MessageBox.Show("مایل به حذف سطر جاری هستید ؟", "هشدار", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2, MessageBoxOptions.RightAlign) == DialogResult.No) { return; } DGrid.Rows.RemoveAt(DGrid.CurrentRow.Index); DGrid.Focus(); } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); res.AddReturnedValue(ex); } finally { if (res.HasError) { this.ShowError(res, "خطا در حذف ریز دریافت"); } else { FetchData(); SetLables(); } } }
private void frmShowCheckM_KeyDown(object sender, KeyEventArgs e) { try { switch (e.KeyCode) { case Keys.Escape: if (!string.IsNullOrEmpty(txtSearch.Text)) { txtSearch.Text = ""; return; } Close(); break; case Keys.Down: if (txtSearch.Focused) { DGrid.Focus(); } break; case Keys.F: if (e.Control) { txtSearch.Focus(); } break; case Keys.Enter: if (isSelectMode) { SelectCheck(); } else { mnuEdit.PerformClick(); } break; } } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); } }
private void mnuCopyToClipboard_Click(object sender, System.EventArgs e) { DGrid.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableAlwaysIncludeHeaderText; if (DGrid.GetCellCount(DataGridViewElementStates.Selected) > 0) { try { // Add the selection to the clipboard. Clipboard.SetDataObject(DGrid.GetClipboardContent()); // Replace the text box contents with the clipboard text. //Me.TextBox1.Text = Clipboard.GetText() MessageBox.Show("Successfull!!", MyModules.strApptitle, MessageBoxButtons.OK, MessageBoxIcon.Information); } catch { MessageBox.Show("The Clipboard could not be accessed. Please try again."); } } }
private void plotMouseDoubleClick(object sender, MouseEventArgs e) { (double mouseX, double mouseY) = MainPlot.GetMouseCoordinates(); sph.HighlightClear(); var(trackerX, trackerY, index) = sph.HighlightPointNearest(mouseX, mouseY); for (int i = 0; i < dtb.Rows.Count; i++) { DataTable curTable = (DataTable)DGrid.DataContext; DataRow curRow = curTable.Rows[i]; string cellContent = String.Join(", ", curRow.ItemArray); if (cellContent.Contains(trackerX.ToString()) && cellContent.Contains(trackerY.ToString())) { DGrid.ScrollIntoView(DGrid.Items[i]); DGrid.SelectedIndex = i; DGrid.UpdateLayout(); } } MainPlot.Render(); }
private void mnuDelete_Click(object sender, EventArgs e) { var res = new ReturnedSaveFuncInfo(); try { if (DGrid.RowCount <= 0 || DGrid.CurrentRow == null) { return; } if (MessageBox.Show("مایل به حذف سطر جاری هستید ؟", "هشدار", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2, MessageBoxOptions.RightAlign) == DialogResult.No) { return; } DGrid.Rows.RemoveAt(DGrid.CurrentRow.Index); DGrid.Focus(); } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); res.AddReturnedValue(ex); } finally { if (res.HasError) { this.ShowError(res, "خطا در حذف ریز پرداخت"); } else { FetchData(); SetLables(); } } }
public frmShowDesc() { InitializeComponent(); DGrid.Focus(); }
public frmSelectTafsil(HesabType htype = HesabType.All) { InitializeComponent(); _type = htype; DGrid.Focus(); }
public frmSelectTafsil(bool isFromReception) { InitializeComponent(); _isFromReception = isFromReception; DGrid.Focus(); }