private void OpenOrderBtn_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     if (cashierFrm == null)
     {
         cashierFrm = new CashierForm();
     }
     cashierFrm.ShowDialog();
 }
Exemple #2
0
        static async void getLogin(string user, string pass)
        {
            HttpClient client = new HttpClient();

            //client.BaseAddress = new Uri("http://127.0.0.1:8000");
            client.BaseAddress = new Uri("http://atmauto.jasonfw.com/");
            Login lg = new Login {
                Username = user, Password = pass
            };
            var response = client.PostAsJsonAsync("api/pegawais/mobileauthenticate", lg).Result;

            if (response.IsSuccessStatusCode)
            {
                var a = await response.Content.ReadAsStringAsync();

                Debug.WriteLine($"{a}");
                Login.Data data = new Login.Data(a);
                Debug.WriteLine($"{data.name}");
                Debug.WriteLine($"{data.role}");
                LoginForm.ActiveForm.Hide();

                if ($"{data.role}" == "Customer Service")
                {
                    CustomerServiceForm cf = new CustomerServiceForm();
                    cf.ShowDialog();
                }
                else if ($"{data.role}" == "Admin")
                {
                    HomeForm1 hm = new HomeForm1();
                    hm.ShowDialog();
                }
                else if ($"{data.role}" == "Kasir")
                {
                    CashierForm hm = new CashierForm();
                    hm.ShowDialog();
                }
            }
            else
            {
                MessageBox.Show("Incorrect username or password.", "Message");
            }
        }