private void TxtSearchBox_KeyDown(object sender, KeyEventArgs e)
        {
            try

            {
                HelpGridView.CloseEditor();
                HelpGridView.UpdateCurrentRow();
                if (e.KeyCode == Keys.Enter)
                {
                    HelpGrid_DoubleClick(null, e);
                }
                if (e.KeyCode == Keys.Down)
                {
                    HelpGrid.Focus();
                }
                if (e.KeyCode == Keys.Escape)
                {
                    panelControl2.Visible = false;
                }
                e.Handled = true;
            }
            catch (Exception ex)
            {
                ProjectFunctions.SpeakError(ex.Message);
            }
        }
Beispiel #2
0
        private void BtnSave_Click(object sender, EventArgs e)
        {
            HelpGridView.CloseEditor();
            HelpGridView.UpdateCurrentRow();
#pragma warning disable CS0618 // 'GridControl.KeyboardFocusView' is obsolete: 'Use the FocusedView property instead.'
            var MaxRow = ((HelpGrid.KeyboardFocusView as GridView).RowCount);
#pragma warning restore CS0618 // 'GridControl.KeyboardFocusView' is obsolete: 'Use the FocusedView property instead.'
            for (int i = 0; i < MaxRow; i++)
            {
                DataRow CurrentRow = HelpGridView.GetDataRow(i);
                if (CurrentRow["PassUnPass"].ToString().ToUpper() == "TRUE")
                {
                    string Query = "update  IndData Set ";
                    Query = Query + " IndPassTag='Y',IndPassDt='" + DateTime.Now.ToString("yyyy-MM-dd") + "',IndDItemQtyPass='******' Where IndID='" + CurrentRow["IndID"] + "'";

                    ProjectFunctions.GetDataSet(Query);
                }
                else
                {
                    DataSet dsCheck = ProjectFunctions.GetDataSet("Select * from POData Where POIndId='" + CurrentRow["IndID"] + "'");
                    if (dsCheck.Tables[0].Rows.Count > 0)
                    {
                        ProjectFunctions.SpeakError("Purchase Order Has Already Been Generated Against This Indent");
                    }
                    else
                    {
                        string Query = "update  IndData Set IndDItemQtyPass=0,";
                        Query = Query + " IndPassTag=null,IndPassDt=null Where IndID='" + CurrentRow["IndID"] + "'";

                        ProjectFunctions.GetDataSet(Query);
                    }
                }
            }
            Close();
        }
Beispiel #3
0
        private void HelpGrid_DoubleClick(object sender, EventArgs e)
        {
            HelpGridView.CloseEditor();
            HelpGridView.UpdateCurrentRow();
            DataRow row = HelpGridView.GetDataRow(HelpGridView.FocusedRowHandle);

            if (HelpGrid.Text == "txtVoucherTypeCode")
            {
                txtVoucherTypeCode.Text = row["VouCode"].ToString();
                txtVoucherTypeDesc.Text = row["VouDesc"].ToString();
                HelpGrid.Visible        = false;
                panelControl2.Visible   = false;
                txtAccountCode.Focus();
            }
            if (HelpGrid.Text == "txtAccountCode")
            {
                txtAccountCode.Text   = row["AccCode"].ToString();
                txtAccountName.Text   = row["AccName"].ToString();
                HelpGrid.Visible      = false;
                panelControl2.Visible = false;
                txtShortNarration.Focus();
            }

            if (HelpGrid.Text == "AccCode")
            {
                if (HelpGridView.RowCount > 0)
                {
                    DataRow dtNewRow = dt.NewRow();
                    dtNewRow["AccCode"]   = row["AccCode"].ToString();
                    dtNewRow["AccName"]   = row["AccName"].ToString();
                    dtNewRow["Amount"]    = Convert.ToDecimal("0.00");
                    dtNewRow["Narration"] = string.Empty;
                    dtNewRow["CRDR"]      = SetCrDrValue();

                    dt.Rows.Add(dtNewRow);
                    if (dt.Rows.Count > 0)
                    {
                        VoucherGrid.DataSource = dt;
                        VoucherGridView.BestFitColumns();
                    }
                    else
                    {
                        VoucherGrid.DataSource = null;
                        VoucherGridView.BestFitColumns();
                    }
                    panelControl2.Visible = false;
                    VoucherGridView.Focus();
                    VoucherGridView.MoveLast();
                    VoucherGridView.FocusedColumn = VoucherGridView.Columns["Amount"];
                    VoucherGridView.ShowEditor();
                    txtSearchBox.Text = string.Empty;
                }
            }
        }
Beispiel #4
0
        private void HelpGrid_DoubleClick(object sender, EventArgs e)
        {
            HelpGridView.CloseEditor();
            HelpGridView.UpdateCurrentRow();
            DataRow row = HelpGridView.GetDataRow(HelpGridView.FocusedRowHandle);

            if (HelpGrid.Text == "txtDebitPartyCode")
            {
                txtDebitPartyCode.Text = row["AccCode"].ToString();
                txtDebitPartyName.Text = row["AccName"].ToString();

                HelpGrid.Visible = false;
                txtDocType.Focus();
            }
        }
        private void HelpGrid_DoubleClick(object sender, EventArgs e)
        {
            HelpGridView.CloseEditor();
            HelpGridView.UpdateCurrentRow();
            DataRow row = HelpGridView.GetDataRow(HelpGridView.FocusedRowHandle);


            if (HelpGrid.Text == "AccCode" || HelpGrid.Text == "AccName")
            {
                if (HelpGridView.RowCount > 0)
                {
                    AccountGridView.SetRowCellValue(RowIndex, AccountGridView.Columns["AccCode"], row["AccCode"].ToString());
                    AccountGridView.SetRowCellValue(RowIndex, AccountGridView.Columns["AccName"], row["AccName"].ToString());
                    panelControl2.Visible = false;
                    AccountGridView.Focus();

                    AccountGridView.FocusedRowHandle = RowIndex;
                    txtSearchBox.Text = string.Empty;
                }
            }
        }