コード例 #1
0
ファイル: frmPinMd5.cs プロジェクト: adji142/DekstopMaster2
 private void frmPinMd5_FormClosed(object sender, FormClosedEventArgs e)
 {
     if (this.Caller is Penjualan.TabelDO)
     {
         if (_bagian != PinId.Bagian.Harga)
         {
             Penjualan.TabelDO frmCaller = (Penjualan.TabelDO) this.Caller;
             frmCaller.RefreshDataDO();
             try
             {
                 frmCaller.FindHeader("RowID", _rowID.ToString());
             }
             catch { };
         }
         else
         {
             Penjualan.TabelDO frm = (Penjualan.TabelDO)Caller;
             frm.RefreshDataDetailDO();
         }
     }
     else if (this.Caller is Penjualan.frmNotaJualBrowser)
     {
         Penjualan.frmNotaJualBrowser frmCaller = (Penjualan.frmNotaJualBrowser) this.Caller;
         frmCaller.RefreshDataDO();
     }
     else if (this.Caller is Penjualan.frmNotaReturJualBrowse)
     {
         Penjualan.frmNotaReturJualBrowse frmCaller = (Penjualan.frmNotaReturJualBrowse) this.Caller;
         frmCaller.RefreshDataReturJual();
     }
     else if (this.Caller is Penjualan.frmNotaJualUpdate)
     {
         Penjualan.frmNotaJualUpdate frmCaller = (Penjualan.frmNotaJualUpdate) this.Caller;
         frmCaller.RefreshDataNota();
     }
     else if (this.Caller is Penjualan.frmPotonganNotaBrowse)
     {
         Penjualan.frmPotonganNotaBrowse frmCaller = (Penjualan.frmPotonganNotaBrowse) this.Caller;
         frmCaller.RefreshData();
         frmCaller.FindHeader("RowID", _rowID.ToString());
     }
 }
コード例 #2
0
ファイル: frmPin.cs プロジェクト: adji142/DekstopMaster2
        private void commandButton1_Click(object sender, EventArgs e)
        {
            if (txtPin.Text.ToString().Length != 8)
            {
                MessageBox.Show("Pin Yang anda masukan salah, silhakan Ulangi");
                txtPin.Text = "";

                return;
            }

            if (ISA.Pin.key.cek(txtKey.Text, txtPin.Text, _bagian))
            {
                //GlobalVar.pinResult = true;

                if (this.Caller is Rekon.frmrekonclosing)
                {
                    using (Database db = new Database())
                    {
                        DataTable dt = new DataTable();
                        db.Commands.Add(db.CreateCommand("usp_Rekon_Clstrans_update"));
                        db.Commands[0].Parameters.Add(new Parameter("@RowID", SqlDbType.UniqueIdentifier, _RowID));
                        db.Commands[0].Parameters.Add(new Parameter("@pin", SqlDbType.VarChar, txtPin.Text));
                        db.Commands[0].Parameters.Add(new Parameter("@LastUpdatedBy", SqlDbType.VarChar, SecurityManager.UserID));
                        dt = db.Commands[0].ExecuteDataTable();
                        db.Commands[0].ExecuteNonQuery();

                        MessageBox.Show("Pin Benar, Proses Rekons Sudah Selesai");
                    }
                }

                if (this.Caller is Penjualan.frmNotaJualBrowser)
                {
                    if (_bagian != 6)
                    {
                        using (Database db = new Database())
                        {
                            DataTable dt = new DataTable();
                            db.Commands.Add(db.CreateCommand("usp_OrderPenjualan_updateACCPiutang"));
                            db.Commands[0].Parameters.Add(new Parameter("@rowID", SqlDbType.UniqueIdentifier, _RowID));
                            db.Commands[0].Parameters.Add(new Parameter("@bagian", SqlDbType.Int, _bagian));
                            db.Commands[0].Parameters.Add(new Parameter("@pin", SqlDbType.VarChar, txtPin.Text));
                            db.Commands[0].Parameters.Add(new Parameter("@lastUpdatedBy", SqlDbType.VarChar, SecurityManager.UserID));
                            dt = db.Commands[0].ExecuteDataTable();
                            db.Commands[0].ExecuteNonQuery();
                        }
                    }
                    else
                    {
                        using (Database db = new Database())
                        {
                            DataTable dt = new DataTable();
                            db.Commands.Add(db.CreateCommand("usp_OrderPenjualanDetail_UPDATE_ACC"));
                            db.Commands[0].Parameters.Add(new Parameter("@headerID", SqlDbType.UniqueIdentifier, _RowID));
                            db.Commands[0].Parameters.Add(new Parameter("@lastUpdatedBy", SqlDbType.VarChar, SecurityManager.UserID));
                            dt = db.Commands[0].ExecuteDataTable();
                            db.Commands[0].ExecuteNonQuery();
                        }
                    }
                    MessageBox.Show("DO sudah diACC, silahkan insert kembali di Browse Nota");
                }

                if (this.Caller is Penjualan.frmNotaReturJualBrowse)
                {
                    using (Database db = new Database())
                    {
                        DataTable dt = new DataTable();
                        db.Commands.Add(db.CreateCommand("usp_ReturPenjualanDetail_UPDATE_RowID"));
                        db.Commands[0].Parameters.Add(new Parameter("@HeaderID", SqlDbType.UniqueIdentifier, _RowID));
                        db.Commands[0].Parameters.Add(new Parameter("@noACC", SqlDbType.VarChar, txtPin.Text.Substring(0, 6)));
                        db.Commands[0].Parameters.Add(new Parameter("@lastUpdatedBy", SqlDbType.VarChar, SecurityManager.UserID));
                        dt = db.Commands[0].ExecuteDataTable();
                        db.Commands[0].ExecuteNonQuery();

                        MessageBox.Show("Retur sudah diACC, silahkan insert kembali di Browse Nota Retur");
                    }
                }

                if (this.Caller is Penjualan.TabelDO)
                {
                    if (_bagian != 6)
                    {
                        using (Database db = new Database())
                        {
                            DataTable dt = new DataTable();
                            db.Commands.Add(db.CreateCommand("usp_OrderPenjualan_updateACCPiutang"));
                            db.Commands[0].Parameters.Add(new Parameter("@rowID", SqlDbType.UniqueIdentifier, _RowID));
                            db.Commands[0].Parameters.Add(new Parameter("@bagian", SqlDbType.Int, _bagian));
                            db.Commands[0].Parameters.Add(new Parameter("@pin", SqlDbType.VarChar, txtPin.Text));
                            db.Commands[0].Parameters.Add(new Parameter("@lastUpdatedBy", SqlDbType.VarChar, SecurityManager.UserID));
                            dt = db.Commands[0].ExecuteDataTable();
                            db.Commands[0].ExecuteNonQuery();
                        }

                        MessageBox.Show("DO sudah diACC, silahkan cetak kembali di Browse DO");

                        Penjualan.TabelDO frm = (Penjualan.TabelDO)Caller;
                        frm.RefreshDataDO();
                    }
                    else
                    {
                        using (Database db = new Database())
                        {
                            DataTable dt = new DataTable();
                            db.Commands.Add(db.CreateCommand("usp_OrderPenjualanDetail_UPDATE_ACC"));
                            db.Commands[0].Parameters.Add(new Parameter("@headerID", SqlDbType.UniqueIdentifier, _RowID));
                            db.Commands[0].Parameters.Add(new Parameter("@lastUpdatedBy", SqlDbType.VarChar, SecurityManager.UserID));
                            dt = db.Commands[0].ExecuteDataTable();
                            db.Commands[0].ExecuteNonQuery();
                        }

                        MessageBox.Show("DO sudah diACC, silahkan cetak kembali di Browse DO");

                        Penjualan.TabelDO frm = (Penjualan.TabelDO)Caller;
                        frm.RefreshDataDetailDO();
                    }
                }

                using (Database db = new Database())
                {
                    DataTable dt = new DataTable();
                    db.Commands.Add(db.CreateCommand("usp_pin_INSERT"));
                    db.Commands[0].Parameters.Add(new Parameter("@keyNumber", SqlDbType.VarChar, txtKey.Text));
                    db.Commands[0].Parameters.Add(new Parameter("@PinNummber", SqlDbType.VarChar, txtPin.Text));
                    db.Commands[0].Parameters.Add(new Parameter("@id", SqlDbType.Int, _bagian));
                    db.Commands[0].Parameters.Add(new Parameter("@ket", SqlDbType.Text, txtKet.Text));
                    dt = db.Commands[0].ExecuteDataTable();
                }

                //if (GlobalVar.pinResult)
                //{
                //    using (Database db = new Database())
                //    {

                //        db.Commands.Add(db.CreateCommand("usp_PINUnlockLog"));
                //        db.Commands[0].Parameters.Add(new Parameter("@ModulID", SqlDbType.Int, _modulId));
                //        db.Commands[0].Parameters.Add(new Parameter("@MingguKe", SqlDbType.Int, _MingguKe));
                //        db.Commands[0].Parameters.Add(new Parameter("@Tanggal", SqlDbType.DateTime2, _tanggal));
                //        db.Commands[0].Parameters.Add(new Parameter("@PublicKey", SqlDbType.VarChar, txtKey.Text));
                //        db.Commands[0].Parameters.Add(new Parameter("@PINEntered", SqlDbType.VarChar, txtPin.Text));
                //        db.Commands[0].Parameters.Add(new Parameter("@Periode", SqlDbType.Int, _periode));
                //        db.Commands[0].ExecuteDataTable();

                //    }

                //}

                this.Close();
            }
            else
            {
                MessageBox.Show("Pin yang anda masukan salah, cek kembali");
            }
        }