Exemplo n.º 1
0
        private void DebitDGView_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (PrivilegesManager.GetEventStatues(Calcium_RMS.Events.EditVouchers) == EventStatus.Permit)
            {
                if (e.RowIndex < 0)
                {
                    return;
                }
                DataTable   aDataTableToPass = PurchaseVoucherDetailedMgmt.SelectVoucherByVoucherNumber(int.Parse(DebitDGView.Rows[e.RowIndex].Cells["VoucherNumber"].Value.ToString()));
                EditVoucher aEditVoucher     = new EditVoucher();
                aEditVoucher.AddDGView(aDataTableToPass);

                DataRow aGeneralVoucherDataRow = PurchaseVoucherGeneralMgmt.SelectGeneralVoucherByNumber(int.Parse(DebitDGView.Rows[e.RowIndex].Cells["VoucherNumber"].Value.ToString()));
                aEditVoucher.UpdateVariables(aGeneralVoucherDataRow);
                // aEditVoucher.MdiParent = Helper.Instance.ActiveMainWindow;
                aEditVoucher.Show();
            }
            else
            {
                MessageBox.Show(MsgTxt.PrivUserNotAllowedTxt, MsgTxt.InformationCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemplo n.º 2
0
        private void ListVouchersDGView_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (PrivilegesManager.GetEventStatues(Calcium_RMS.Events.EditVouchers) == EventStatus.Permit)
            {
                if (e.RowIndex < 0)
                {
                    return;
                }

                DataTable aDataTableToPass = PurchaseVoucherDetailedMgmt.SelectVoucherByVoucherNumber(int.Parse(ListVouchersDGView.Rows[e.RowIndex].Cells["VoucherNumber"].Value.ToString()));
                if (aDataTableToPass == null)
                {
                    MessageBox.Show(MsgTxt.UnexpectedError + "\n IN [ListVouchersDGView_CellDoubleClick:DB-ERROR  aDataTableToPass=null] \n  \n", MsgTxt.ErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }


                DataRow aGeneralVoucherDataRow = PurchaseVoucherGeneralMgmt.SelectGeneralVoucherByNumber(int.Parse(ListVouchersDGView.Rows[e.RowIndex].Cells["VoucherNumber"].Value.ToString()));
                if (aDataTableToPass == null)
                {
                    MessageBox.Show(MsgTxt.UnexpectedError + "\n IN [ListVouchersDGView_CellDoubleClick:DB-ERROR  aDataTableToPass=null] \n  \n", MsgTxt.ErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                EditVoucher aEditVoucher = new EditVoucher();
                aEditVoucher.AddDGView(aDataTableToPass);
                aEditVoucher.UpdateVariables(aGeneralVoucherDataRow);
                //aEditVoucher.TopLevel = true;
                aEditVoucher.TopMost = true;
                aEditVoucher.Show();
            }
            else
            {
                MessageBox.Show(MsgTxt.PrivUserNotAllowedTxt, MsgTxt.InformationCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }