예제 #1
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            if (position >= 0)
            {
                if (UserCurrent.getCurrentUser().FlagAdmin == true)
                {
                    idProd = MethodsTable.getCellValueRowSelectedIdInt(gridViewProducts);
                    new FrmProducts(this, idProd).ShowDialog();
                }
                else
                {
                    if (UserCurrent.getPermission().Stock)
                    {
                        idProd = MethodsTable.getCellValueRowSelectedIdInt(gridViewProducts);
                        if (position >= 0)
                        {
                            idProd = MethodsTable.getCellValueRowSelectedIdInt(gridViewProducts);
                            new FrmProducts(this, idProd).ShowDialog();
                        }
                        else
                        {
                            MessageBox.Show("Selecione o produto");
                        }
                    }
                }
            }

            position = -1;
            ///
        }
예제 #2
0
 private void bunifuThinButton23_Click(object sender, EventArgs e)
 {
     if (UserCurrent.getCurrentUser().FlagAdmin == true)
     {
         if (position >= 0)
         {
             _storeController.deleteForId(_storeController.List()[position].Id);
             fillData();
         }
         else
         {
             MessageBox.Show("Selecione o armazem");
         }
     }
     else
     {
         if (UserCurrent.getPermission().Stock)
         {
             if (position >= 0)
             {
                 _storeController.deleteForId(_storeController.List()[position].Id);
                 fillData();
             }
             else
             {
                 MessageBox.Show("Selecione o armazem");
             }
         }
     }
     position = -1;
 }
예제 #3
0
 private void barButtonItem42_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     if (UserCurrent.getCurrentUser().FlagAdmin == true)
     {
         if (new SerieController().ListALL().Count > 0)
         {
             if (TurnoCurrent.getTurnoCurrent() == null)
             {
                 MessageBox.Show("Abra o Caixa Primeiro");
             }
             else
             {
                 FrmPosRestaurant frmPos = new FrmPosRestaurant(this);
                 frmPos.Show();
                 Hide();
             }
         }
         else
         {
             MessageBox.Show("Cadastre uma serie no sistema");
         }
     }
     else
     {
         if (UserCurrent.getPermission().Venda)
         {
             if (new SerieController().ListALL().Count > 0)
             {
                 if (new TableController().ListALL().Count > 0)
                 {
                     FrmPosRestaurant frmPos = new FrmPosRestaurant(this);
                     frmPos.Show();
                     Hide();
                 }
                 else
                 {
                     MessageBox.Show("Cadastre pelo menos uma(1) mesa");
                 }
             }
             else
             {
                 MessageBox.Show("Cadastre uma serie no sistema");
             }
         }
         else
         {
             MessageBox.Show("Não tem permissão para completar essa operação");
         }
     }
 }
예제 #4
0
 private void barButtonItem8_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     if (UserCurrent.getCurrentUser().FlagAdmin == true)
     {
         new FrmOutProduct().ShowDialog();
     }
     else
     {
         if (UserCurrent.getPermission().Stock)
         {
             new FrmOutProduct().ShowDialog();
         }
         else
         {
             MessageBox.Show("Não tem permissão para completar essa operação");
         }
     }
 }
예제 #5
0
 private void btnNewCategory_Click(object sender, EventArgs e)
 {
     if (UserCurrent.getCurrentUser().FlagAdmin == true)
     {
         new FrmCategorySave(this).ShowDialog();
     }
     else
     {
         if (UserCurrent.getPermission().Stock)
         {
             new FrmCategorySave(this).ShowDialog();
         }
         else
         {
             MessageBox.Show("Não tem permissão para completar essa operação");
         }
     }
 }
예제 #6
0
 private void bunifuThinButton21_Click(object sender, EventArgs e)
 {
     if (UserCurrent.getCurrentUser().FlagAdmin == true)
     {
         FrmStoreSave frm = new FrmStoreSave(this);
         frm.ShowDialog();
     }
     else
     {
         if (UserCurrent.getPermission().Stock)
         {
             FrmStoreSave frm = new FrmStoreSave(this);
             frm.ShowDialog();
         }
         else
         {
             MessageBox.Show("Não tem permissão para completar essa operação");
         }
     }
 }
예제 #7
0
 public void openInvoiceForm(string type, FrmInvoice frm)
 {
     if (UserCurrent.getCurrentUser().FlagAdmin == true)
     {
         if (isFormInactive(frm))
         {
             activeForm(frm = new FrmInvoice(type));
         }
     }
     else
     {
         if (UserCurrent.getPermission().Venda)
         {
             if (isFormInactive(frm))
             {
                 activeForm(frm = new FrmInvoice(type));
             }
         }
         else
         {
             MessageBox.Show("Não tem permissão para completar essa operação");
         }
     }
 }
예제 #8
0
 private void btnNDC_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     if (UserCurrent.getCurrentUser().FlagAdmin == true)
     {
         if (isFormInactive(frmInvoiceCredite))
         {
             activeForm(frmInvoiceCredite = new FrmInvoicesForCreditNote());
         }
     }
     else
     {
         if (UserCurrent.getPermission().Stock)
         {
             if (isFormInactive(frmInvoiceCredite))
             {
                 activeForm(frmInvoiceCredite = new FrmInvoicesForCreditNote());
             }
         }
         else
         {
             MessageBox.Show("Não tem permissão para completar essa operação");
         }
     }
 }
예제 #9
0
 private void btnPOS_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     if (UserCurrent.getCurrentUser().FlagAdmin == true)
     {
         if (new SerieController().ListALL().Count > 0)
         {
             FrmPosPdv frmPost = new FrmPosPdv(this);
             frmPost.Show();
             Hide();
         }
         else
         {
             MessageBox.Show("Cadastre uma serie no sistema");
         }
     }
     else
     {
         if (UserCurrent.getPermission().Stock)
         {
             if (new SerieController().ListALL().Count > 0)
             {
                 FrmPosPdv frmPost = new FrmPosPdv(this);
                 frmPost.Show();
                 Hide();
             }
             else
             {
                 MessageBox.Show("Cadastre uma serie no sistema");
             }
         }
         else
         {
             MessageBox.Show("Não tem permissão para completar essa operação");
         }
     }
 }
예제 #10
0
        private void barButtonItem7_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (UserCurrent.getCurrentUser().FlagAdmin == true)
            {
                StorageController  _storageController  = new StorageController();
                ProviderController _providerController = new ProviderController();

                if (_providerController.ListALLAsNoTracking().Count > 0)
                {
                    if (_storageController.List().Count > 0)
                    {
                        if (isFormInactive(frmEntry))
                        {
                            frmEntry           = new FrmEntryProducts();
                            frmEntry.MdiParent = this;
                            frmEntry.Show();
                        }
                    }
                    else
                    {
                        MessageBox.Show("Nenhum armazem encontrado \nInsira um armazem primeiro");
                        new FrmStoreSave().ShowDialog();
                    }
                }
                else
                {
                    MessageBox.Show("Nenhum Fornecedor encontrado \nInsira um Fornecedor primeiro");
                    new FrmFornecedorSave(true).ShowDialog();
                }
            }
            else
            {
                if (UserCurrent.getPermission().Stock)
                {
                    StorageController  _storageController  = new StorageController();
                    ProviderController _providerController = new ProviderController();

                    if (_providerController.ListALLAsNoTracking().Count > 0)
                    {
                        if (_storageController.List().Count > 0)
                        {
                            if (isFormInactive(frmEntry))
                            {
                                frmEntry           = new FrmEntryProducts();
                                frmEntry.MdiParent = this;
                                frmEntry.Show();
                            }
                        }
                        else
                        {
                            MessageBox.Show("Nenhum armazem encontrado \nInsira um armazem primeiro");
                            new FrmStoreSave().ShowDialog();
                        }
                    }
                    else
                    {
                        MessageBox.Show("Nenhum Fornecedor encontrado \nInsira um Fornecedor primeiro");
                        new FrmFornecedorSave(true).ShowDialog();
                    }
                }
                else
                {
                    MessageBox.Show("Não tem permissão para completar essa operação");
                }
            }
        }