Ejemplo n.º 1
0
        private void cmdAdd_Click(object sender, EventArgs e)
        {
            //TODO: ADD Potongan Rights
            //if(SecurityManager.AppRole == "004")
            //{
            //    if(indexing != Tgl_pot)
            //    {
            //        if (dataGridView1.SelectedCells.Count > 0)
            //            {
            try
            {
                if (DateTime.Now <= GlobalVar.LastClosingDate)
                {
                    throw new Exception(String.Format(ISA.Toko.Messages.Error.AlreadyClosingPJT, GlobalVar.LastClosingDate));
                }
                Penjualan.frmPenjualanPotonganUpdateISA ifrmChild = new Penjualan.frmPenjualanPotonganUpdateISA(this);
                ifrmChild.MdiParent = Program.MainForm;
                Program.MainForm.RegisterChild(ifrmChild);
                ifrmChild.Show();
            }
            catch (Exception ex)
            {
                Error.LogError(ex);
            }

            //            }

            //    }
            //}
        }
        private void cmdEdit_Click(object sender, EventArgs e)
        {
            if (dataGridView1.RowCount > 0)
            {
                try
                {
                    //GlobalVar.LastClosingDate = (DateTime)dataGridView1.SelectedCells[0].OwningRow.Cells["TglPot"].Value;
                    //if ((DateTime)dataGridView1.SelectedCells[0].OwningRow.Cells["TglPot"].Value <= GlobalVar.LastClosingDate)
                    //{
                    //    throw new Exception(String.Format(ISA.Trading.Messages.Error.AlreadyClosingPJT, GlobalVar.LastClosingDate));
                    //}

                    if (dataGridView1.SelectedCells[0].OwningRow.Cells["IDLink"].Value.ToString() != "")
                    {
                        MessageBox.Show("Sudah Link ke Piutang, tidak bisa Edit data", "Peringatan", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }

                    //if (SecurityManager.HasRight("004") || SecurityManager.HasRight("005"))
                    //{
                    //    return;
                    //}

                    Guid rowID = (Guid)dataGridView1.SelectedCells[0].OwningRow.Cells["RowID"].Value;
                    Penjualan.frmPenjualanPotonganUpdateISA ifrmChild = new Penjualan.frmPenjualanPotonganUpdateISA(this, rowID);
                    ifrmChild.MdiParent = Program.MainForm;
                    Program.MainForm.RegisterChild(ifrmChild);
                    ifrmChild.Show();
                }
                catch (Exception ex)
                {
                    Error.LogError(ex);
                }
            }
        }
 private void cmdAdd_Click(object sender, EventArgs e)
 {
     try
     {
         if (DateTime.Now <= GlobalVar.LastClosingDate)
         {
             throw new Exception(String.Format(ISA.Trading.Messages.Error.AlreadyClosingPJT, GlobalVar.LastClosingDate));
         }
         Penjualan.frmPenjualanPotonganUpdateISA ifrmChild = new Penjualan.frmPenjualanPotonganUpdateISA(this);
         ifrmChild.MdiParent = Program.MainForm;
         Program.MainForm.RegisterChild(ifrmChild);
         ifrmChild.Show();
     }
     catch (Exception ex)
     {
         Error.LogError(ex);
     }
 }