Ejemplo n.º 1
0
        private void BtnSignUp_Click(object sender, EventArgs e)
        {
            if (ValidateSingUp() == true)
            {
                try
                {
                    var main = new FrmMainMenu();
                    employeeObj.PositionId = 2;
                    employeeObj.StateB     = true;
                    if (new DataValidation(employeeObj).Validate())
                    {
                        employeeObj.StateEntity = EntityState.Added;

                        string result = employeeObj.SaveChanges();
                        MessageBox.Show(result);

                        var resp = employeeObj.UserLogin(employeeObj.UserName, employeeObj.Password);
                        if (resp > 0)
                        {
                            main.FormClosed += Logout;
                            main.Show();
                            this.Hide();
                        }
                        else
                        {
                            MessageBox.Show("Error al loguearse", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Error al intentar registrar usuario/loguearse", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
        }
Ejemplo n.º 2
0
 private void LoginEmployee()
 {
     if (ValidateForm() != true)
     {
         //MessageBox.Show("Complete los campos", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         MsgError("  Complete los campos correctamente y vuelva a intertarlo");
     }
     else
     {
         try
         {
             var resp = employeeObj.UserLogin(txtUser.Text, txtPassword.Text);
             if (resp <= 0)
             {
                 //MessageBox.Show("Usuario no valido", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                 MsgError("  Usuario no valido. Vuelva a intentarlo");
             }
             else
             {
                 var main = new FrmMainMenu();
                 main.FormClosed += Logout;
                 main.Show();
                 this.Hide();
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message);
             //MessageBox.Show("Error de logueo", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             MsgError("  Error de logueo.");
         }
     }
 }//end class
    private void pictureBox1_Click(object sender, EventArgs e)
    {
        FrmMainMenu menu = new FrmMainMenu();

        menu.Show();
        this.Hide();
    }
Ejemplo n.º 4
0
        public FrmIncidents(FrmMainMenu a, User b)
        {
            InitializeComponent();
            menu         = a;
            korisnik     = b;
            userLab.Text = "User: "******"Resolved";
            lista.Add(unos);
            Status unos1 = new Status();

            unos1.ID  = 2;
            unos1.Ime = "In proccess";
            lista.Add(unos1);
            Status unos2 = new Status();

            unos2.ID  = 3;
            unos2.Ime = "Pending";
            Status unos3 = new Status();

            lista.Add(unos2);
            comboStatus.Items.Add(unos);
            comboStatus.Items.Add(unos2);
            comboStatus.Items.Add(unos1);
        }
Ejemplo n.º 5
0
        private void btnMeinMenu_Click(object sender, EventArgs e)
        {
            FrmMainMenu frmMainMenu = new FrmMainMenu(User);

            frmMainMenu.Show();
            this.Hide();
        }
Ejemplo n.º 6
0
        public FrmRents(User a, FrmMainMenu b)
        {
            InitializeComponent();
            menu1                       = b;
            korisnik                    = a;
            userLabel.Text              = "USER: "******"http://marichely.me:8099/");
            var zahtjev = new RestRequest("rent/user", Method.GET)
            {
                RequestFormat = DataFormat.Json
            };

            zahtjev.AddHeader("userapikey", korisnik.ApiKey);

            IRestResponse odgovor = klijent.Execute(zahtjev);

            if ((int)odgovor.StatusCode == 200)
            {
                List <Rent> rent = JsonConvert.DeserializeObject <List <Rent> >(odgovor.Content);
                SortableBindingList <Rent> sortableBindingList = new SortableBindingList <Rent>(rent);
                dgNajmovi.DataSource = sortableBindingList;

                List <Status> lista = new List <Status>();
                Status        unos  = new Status();
                unos.ID  = 1;
                unos.Ime = "Reserved";
                lista.Add(unos);
                Status unos1 = new Status();
                unos1.ID  = 2;
                unos1.Ime = "Active";
                lista.Add(unos1);
                Status unos2 = new Status();
                unos2.ID  = 3;
                unos2.Ime = "Expired";
                lista.Add(unos2);
                promjenaStatus.Items.Add(unos);
                promjenaStatus.Items.Add(unos2);
                promjenaStatus.Items.Add(unos1);


                var listBinding = new BindingList <Status>(lista);
            }
        }
Ejemplo n.º 7
0
        private void BtnEntrar_Click_1(object sender, EventArgs e)
        {
            Controle controle = new Controle();

            controle.acessar(txbLogin1.Text, txbPass.Text);

            if (controle.tem)
            {
                MessageBox.Show("Logon com sucesso", "LOGON", MessageBoxButtons.OK, MessageBoxIcon.Information);

                FrmMainMenu menu = new FrmMainMenu();
                menu.Show();
            }
            else
            {
                MessageBox.Show("Login não cadastrado", "Erro ao se conectar", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }