コード例 #1
0
        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);
            }
        }
コード例 #2
0
 public frmShowAdvisor(bool status = true)
 {
     InitializeComponent();
     ucHeader.Text = "نمایش لیست مشاوران";
     _st           = status;
     DGrid.Focus();
 }
コード例 #3
0
 public frmShowBuildingAccountType(bool status = true)
 {
     InitializeComponent();
     _st = status;
     SetAccess();
     DGrid.Focus();
     ucHeader.Text = "نمایش لیست کاربری ملک";
 }
コード例 #4
0
 public frmShowSandouq(bool status = true)
 {
     InitializeComponent();
     ucHeader.Text = "نمایش لیست صندوق ها";
     _st           = status;
     DGrid.Focus();
     SetAccess();
 }
コード例 #5
0
 public frmShowHazine(bool status = true)
 {
     InitializeComponent();
     ucHeader.Text = "نمایش لیست هزینه ها";
     _st           = status;
     DGrid.Focus();
     SetAccess();
 }
コード例 #6
0
 public frmShowRentalAuthority(bool status = true)
 {
     InitializeComponent();
     _st = status;
     SetAccess();
     DGrid.Focus();
     ucHeader.Text = "نمایش لیست انواع ارجحیت اجاره";
 }
コード例 #7
0
 public frmShowCities(bool status = true)
 {
     InitializeComponent();
     _st = status;
     SetAccess();
     DGrid.Focus();
     ucHeader.Text = "نمایش لیست شهرها";
 }
コード例 #8
0
 public frmShowBuildingCondition(bool status = true)
 {
     InitializeComponent();
     _st = status;
     SetAccess();
     DGrid.Focus();
     ucHeader.Text = "نمایش لیست انواع بنا";
 }
コード例 #9
0
 public frmShowBuildingOption(bool status = true)
 {
     InitializeComponent();
     _st = status;
     SetAccess();
     DGrid.Focus();
     ucHeader.Text = "نمایش لیست امکانات ملک";
 }
コード例 #10
0
 public frmShowKitchenService(bool status = true)
 {
     InitializeComponent();
     _st = status;
     SetAccess();
     DGrid.Focus();
     ucHeader.Text = "نمایش لیست انواع سرویس آشپزخانه";
 }
コード例 #11
0
 public frmShowBuildingView(bool status = true)
 {
     InitializeComponent();
     _st = status;
     SetAccess();
     DGrid.Focus();
     ucHeader.Text = "نمایش لیست نمای املاک";
 }
コード例 #12
0
 public frmShowFloorCover(bool status = true)
 {
     InitializeComponent();
     _st = status;
     SetAccess();
     DGrid.Focus();
     ucHeader.Text = "نمایش لیست انواع کفپوش";
 }
コード例 #13
0
 public frmShowDasteCheck(bool status = true)
 {
     InitializeComponent();
     ucHeader.Text = "نمایش لیست دسته چک ها";
     _st           = status;
     DGrid.Focus();
     SetAccess();
 }
コード例 #14
0
 public frmShowBanks(bool status = true)
 {
     InitializeComponent();
     ucHeader.Text = "نمایش لیست حساب های بانکی";
     _st           = status;
     DGrid.Focus();
     SetAccess();
 }
コード例 #15
0
 public frmShowDocumentType(bool status = true)
 {
     InitializeComponent();
     _st = status;
     SetAccess();
     DGrid.Focus();
     ucHeader.Text = "نمایش لیست انواع سند";
 }
コード例 #16
0
ファイル: FrmList.cs プロジェクト: woleolapoju/EdgeOnShore
        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);
            }
        }
コード例 #17
0
ファイル: FrmList.cs プロジェクト: woleolapoju/RewardAssured
        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);
            }
        }
コード例 #18
0
 public frmShowRegions(bool status = true)
 {
     InitializeComponent();
     ucHeader.Text        = "نمایش لیست مناطق";
     _st                  = status;
     rbtnMyRegion.Checked = true;
     SetAccess();
     DGrid.Focus();
 }
コード例 #19
0
        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);
            }
        }
コード例 #20
0
 public frmShowRequest(bool status = true)
 {
     InitializeComponent();
     ucHeader.Text = "نمایش لیست تقاضاها";
     _st           = status;
     SetAccess();
     DGrid.Focus();
     SetColumns();
 }
コード例 #21
0
        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);
            }
        }
コード例 #22
0
ファイル: MainWindow.xaml.cs プロジェクト: IT2012/SWE
        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
            });
        }
コード例 #23
0
        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();
                }
            }
        }
コード例 #24
0
        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);
            }
        }
コード例 #25
0
ファイル: FrmList.cs プロジェクト: woleolapoju/RewardAssured
        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.");
                }
            }
        }
コード例 #26
0
        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();
        }
コード例 #27
0
        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();
                }
            }
        }
コード例 #28
0
 public frmShowDesc()
 {
     InitializeComponent();
     DGrid.Focus();
 }
コード例 #29
0
 public frmSelectTafsil(HesabType htype = HesabType.All)
 {
     InitializeComponent();
     _type = htype;
     DGrid.Focus();
 }
コード例 #30
0
 public frmSelectTafsil(bool isFromReception)
 {
     InitializeComponent();
     _isFromReception = isFromReception;
     DGrid.Focus();
 }