Beispiel #1
0
 private void gridVoucher_DoubleClick(object sender, EventArgs e)
 {
     if (gridVoucher.SelectedCells.Count > 0)
     {
         string _BankID = "", _BankIDBBM = "";
         _BankID    = gridVoucher.SelectedCells[0].OwningRow.Cells["BankID"].Value.ToString();
         _BankIDBBM = gridVoucher.SelectedCells[0].OwningRow.Cells["BankIDBBM"].Value.ToString();
         //if (_BankID != _BankIDBBM)
         //{
         //    MessageBox.Show("BankID Giro Tidak Sama Dengan BankID BBM");
         //    gridVoucher.Focus();
         //    return;
         //}
         Guid     GiroID = (Guid)gridVoucher.SelectedCells[0].OwningRow.Cells["GiroID"].Value;
         DateTime _tglJT = (DateTime)gridVoucher.SelectedCells[0].OwningRow.Cells["TglJTempo"].Value;
         this.Close();
         Kasir.frmTransaksiPencairanGiro ifrmChild = new Kasir.frmTransaksiPencairanGiro(this.Caller, GiroID, _rowIDBBM, _tglJT);
         Program.MainForm.RegisterChild(ifrmChild);
         ifrmChild.ShowDialog();
     }
 }
Beispiel #2
0
        private void gridVoucher_DoubleClick(object sender, EventArgs e)
        {
            //if (gridVoucher.SelectedCells[0].OwningRow.Cells["InfoToko"].Value.ToString() == "")
            //{
            //    MessageBox.Show("Belum iden ke Toko");
            //    return;
            //}

            if (gridVoucher.SelectedCells.Count > 0)
            {
                DataTable dtcg = new DataTable(GlobalVar.DBName);
                _GiroID = new Guid(gridVoucher.SelectedCells[0].OwningRow.Cells["GiroID"].Value.ToString());

                /*tambahan cek pin giro*/
                try
                {
                    this.Cursor = Cursors.WaitCursor;
                    using (Database db = new Database(GlobalVar.DBName))
                    {
                        db.Commands.Add(db.CreateCommand("usp_PinGiro_CEK"));
                        db.Commands[0].Parameters.Add(new Parameter("@GiroID", SqlDbType.UniqueIdentifier, _GiroID));
                        dtcg = db.Commands[0].ExecuteDataTable();
                    }
                }
                catch (System.Exception ex)
                {
                    Error.LogError(ex);
                }
                finally
                {
                    this.Cursor = Cursors.Default;
                }

                if (dtcg.Rows.Count > 0)
                {
                    MessageBox.Show("Untuk Pencairan Giro harus minta Pin ke HO.");

                    string _pinKey = GetKey(_GiroID.ToString(), GlobalVar.Gudang, 31);
                    PengajuanPinGiro(dtcg, _pinKey);

                    pin.frmPinMd5 ifrmpin = new pin.frmPinMd5(this, _GiroID, GlobalVar.Gudang, 31, "Untuk Pencairan Giro harus minta Pin ke HO.");
                    ifrmpin.ShowDialog();
                    if (ifrmpin.DialogResult == DialogResult.OK)
                    {
                        try
                        {
                            this.Cursor = Cursors.WaitCursor;
                            using (Database db = new Database(GlobalVar.DBName))
                            {
                                db.Commands.Add(db.CreateCommand("usp_PinGiro_UPDATE"));
                                db.Commands[0].Parameters.Add(new Parameter("@GiroID", SqlDbType.UniqueIdentifier, _GiroID));
                                db.Commands[0].ExecuteNonQuery();
                            }
                            this.Close();
                        }
                        catch (System.Exception ex)
                        {
                            Error.LogError(ex);
                        }
                        finally
                        {
                            this.Cursor = Cursors.Default;
                            this.Close();
                        }
                    }
                    else
                    {
                        this.DialogResult = DialogResult.No;
                        this.Close();
                        return;
                    }
                }

                /*end tambahan*/


                //if (gridVoucher.SelectedCells[0].OwningRow.Cells["InfoToko"].Value.ToString() == "")
                //{
                //    MessageBox.Show("Belum iden ke Toko");
                //    return;
                //}

                string _BankID = "", _BankIDBBM = "";
                _BankID    = gridVoucher.SelectedCells[0].OwningRow.Cells["BankID"].Value.ToString();
                _BankIDBBM = gridVoucher.SelectedCells[0].OwningRow.Cells["BankIDBBM"].Value.ToString();

                //if (_BankID != _BankIDBBM)
                //{
                //    MessageBox.Show("BankID Giro Tidak Sama Dengan BankID BBM");
                //    gridVoucher.Focus();
                //    return;
                //}

                DateTime _tglJT = (DateTime)gridVoucher.SelectedCells[0].OwningRow.Cells["TglJTempo"].Value;
                this.Close();
                Kasir.frmTransaksiPencairanGiro ifrmChild = new Kasir.frmTransaksiPencairanGiro(this.Caller, _GiroID, _rowIDBBM, _tglJT);
                Program.MainForm.RegisterChild(ifrmChild);
                ifrmChild.ShowDialog();
            }
        }