private void CmdF4_Click(object sender, EventArgs e)
        {
            Guid   potID = (Guid)dataGridView1.SelectedCells[0].OwningRow.Cells["RowID"].Value;
            string noPot = dataGridView1.SelectedCells[0].OwningRow.Cells["NoPotJ"].Value.ToString();

            Pin.frmPinMd5 ifrmpin = new Pin.frmPinMd5(this, potID, GlobalVar.Gudang, PinId.Bagian.Potongan, "Pengajuan Potongan " + noPot);
            ifrmpin.MdiParent = Program.MainForm;
            Program.MainForm.RegisterChild(ifrmpin);
            ifrmpin.Show();
            return;
        }
예제 #2
0
        private void cmdPIN_Click(object sender, EventArgs e)
        {
            Guid   headerID = (Guid)dataGridDetailDO.SelectedCells[0].OwningRow.Cells["HeaderID"].Value;
            Guid   rowID    = (Guid)dataGridDetailDO.SelectedCells[0].OwningRow.Cells["DetailRowID"].Value;
            string namaStok = Tools.isNull(dataGridDetailDO.SelectedCells[0].OwningRow.Cells["NamaStok"].Value, string.Empty).ToString();

            Pin.frmPinMd5 ifrmpin = new Pin.frmPinMd5(this, headerID, rowID, GlobalVar.Gudang, PinId.Bagian.Harga, "Cegatan Harga " + namaStok);
            ifrmpin.MdiParent = Program.MainForm;
            Program.MainForm.RegisterChild(ifrmpin);
            ifrmpin.Show();
        }
예제 #3
0
        private void cmdEDIT_Click(object sender, EventArgs e)
        {
            if (dataGridHeader.SelectedCells.Count == 0)
            {
                MessageBox.Show(Messages.Error.RowNotSelected);
                return;
            }
            int    _nPrint   = (int)dataGridHeader.SelectedCells[0].OwningRow.Cells["NPrint"].Value;
            bool   _isClosed = (bool)dataGridHeader.SelectedCells[0].OwningRow.Cells["isClosed"].Value;
            string _linkID   = dataGridHeader.SelectedCells[0].OwningRow.Cells["LinkID"].Value.ToString().Trim();
            Guid   _rowID;

            try
            {
                switch (selectedGrid)
                {
                case enumSelectedGrid.HeaderSelected:

                    //if (_nPrint > 2)
                    //{
                    // Minta password manager
                    //}
                    if (_isClosed == true)
                    {
                        MessageBox.Show("Data sudah diaudit. Tidak bisa di koreksi !!!");
                        return;
                    }
                    if (_linkID != string.Empty)
                    {
                        MessageBox.Show("Sudah di Link Ke Piutang !!");
                        return;
                    }
                    if (DateTime.Today <= GlobalVar.LastClosingDate)
                    {
                        throw new Exception(String.Format(Messages.Error.AlreadyClosingPJT, GlobalVar.LastClosingDate));
                    }
                    _rowID = (Guid)dataGridHeader.SelectedCells[0].OwningRow.Cells["HeaderRowID"].Value;
                    DateTime tglrq_   = (DateTime)dataGridHeader.SelectedCells[0].OwningRow.Cells["TglRQRetur"].Value;
                    string   NeedACC_ = string.Empty;
                    NeedACC_ = NeedACC(_rowID, tglrq_);

                    //accspv
                    string _ACCSpv = string.Empty;
                    _ACCSpv = NeedACCSPV(_rowID);


                    if (NeedACC_.Length > 0)
                    {
                        MessageBox.Show("Barang Perlu ACC");

                        /*
                         * Pin.frmPin ifrmpin = new Pin.frmPin(this, 0, 5, 10, _rowID, DateTime.Today);
                         * ifrmpin.MdiParent = Program.MainForm;
                         * Program.MainForm.RegisterChild(ifrmpin);
                         * ifrmpin.Show();
                         */

                        string noMPR = dataGridHeader.SelectedCells[0].OwningRow.Cells["NoMPR"].Value.ToString();

                        Pin.frmPinMd5 ifrmpin = new Pin.frmPinMd5(this, _rowID, GlobalVar.Gudang, PinId.Bagian.Retur, "Cegatan Retur " + noMPR);
                        ifrmpin.MdiParent = Program.MainForm;
                        Program.MainForm.RegisterChild(ifrmpin);
                        ifrmpin.Show();


                        return;
                        //throw new Exception("Barang Perlu ACC" + System.Environment.NewLine+NeedACC_);
                    }
                    //if (_ACCSpv.Length > 0)
                    //{
                    //    MessageBox.Show("Retur Perlu ACC Supervisor");
                    //    return;
                    //}

                    Penjualan.frmNotaReturJualUpdate ifrmChild = new Penjualan.frmNotaReturJualUpdate(this, _rowID);
                    ifrmChild.MdiParent = Program.MainForm;
                    Program.MainForm.RegisterChild(ifrmChild);
                    ifrmChild.Show();

                    break;

                case enumSelectedGrid.DetailSelected:

                    if (dataGridDetail.SelectedCells.Count == 0)
                    {
                        MessageBox.Show(Messages.Error.RowNotSelected);
                        return;
                    }
                    if (_isClosed == true)
                    {
                        MessageBox.Show("Data sudah diaudit. Tidak bisa di koreksi !!!");
                        return;
                    }
                    if (_linkID != string.Empty)
                    {
                        MessageBox.Show("Sudah di Link Ke Piutang !!");
                        return;
                    }
                    //if (_nPrint > 2)
                    //{
                    // Minta password manager
                    //}
                    if (dataGridHeader.SelectedCells[0].OwningRow.Cells["TglGudang"].Value.ToString() == "")
                    {
                        MessageBox.Show("Isi dulu tgl masuk gudang");
                        return;
                    }
                    string _noACC = dataGridDetail.SelectedCells[0].OwningRow.Cells["NoACC"].Value.ToString();
                    if (dataGridDetail.SelectedCells[0].OwningRow.Cells["KodeRetur"].Value.ToString() == "3" && _noACC == "")
                    {
                        MessageBox.Show("Harus isi No. ACC dulu...!!!");
                        return;
                    }
                    if (dataGridDetail.SelectedCells[0].OwningRow.Cells["KodeRetur"].Value.ToString() == "1")
                    {
                        if (dataGridDetail.SelectedCells[0].OwningRow.Cells["TglTerima"].Value.ToString().Trim() == string.Empty)
                        {
                            throw new Exception("NotaDetail Asal Belum PJ3");
                        }
                        if (CekACCRetur() &&
                            (_noACC == "" || ((_noACC.Length >= 3)?_noACC.Substring(0, 3) == "TLK":true) || _noACC == "XXXXXX"))
                        {
                            MessageBox.Show("Harus isi No. ACC dulu...!!!");
                            return;
                        }
                    }
                    GlobalVar.LastClosingDate = (DateTime)dataGridHeader.SelectedCells[0].OwningRow.Cells["TglGudang"].Value;
                    if ((DateTime)dataGridHeader.SelectedCells[0].OwningRow.Cells["TglGudang"].Value <= GlobalVar.LastClosingDate)
                    {
                        throw new Exception(String.Format(Messages.Error.AlreadyClosingPJT, GlobalVar.LastClosingDate));
                    }

                    if (dataGridDetail.SelectedCells[0].OwningRow.Cells["QtyGudang"].Value.ToString() != "0")
                    {
                        MessageBox.Show("Qty Gudang sudah diisi...!!!");
                        return;
                    }

                    _rowID = (Guid)dataGridDetail.SelectedCells[0].OwningRow.Cells["DetailRowID"].Value;
                    Penjualan.frmNotaReturJualDetailUpdate ifrmChild2 = new Penjualan.frmNotaReturJualDetailUpdate(this, _rowID);
                    ifrmChild2.MdiParent = Program.MainForm;
                    Program.MainForm.RegisterChild(ifrmChild2);
                    ifrmChild2.Show();
                    break;
                }
            }
            catch (Exception ex)
            {
                Error.LogError(ex);
            }
        }