Esempio n. 1
0
        private void btnCari_Click(object sender, EventArgs e)
        {
            var list = new CustomerControl();

            try
            {
                if (txtCari.Text != null && list.SearchCustomer(txtCari.Text) != null)
                {
                    buttonUbah.Enabled = true;
                    customer           = list.SearchCustomer(txtCari.Text);

                    txtNamaPelanggan.Text         = customer.Nama_Pelanggan;
                    txtAlamatPelanggan.Text       = customer.Alamat_Pelanggan;
                    txtNomorTelponPelanggan.Text  = customer.Phone_Pelanggan;
                    dateTimePickerPelanggan.Value = DateTime.Parse(customer.Tgl_Lahir_Pelanggan);

                    txtNamaPelanggan.Enabled        = true;
                    txtAlamatPelanggan.Enabled      = true;
                    txtNomorTelponPelanggan.Enabled = true;
                    dateTimePickerPelanggan.Enabled = true;
                }
                else
                {
                    MessageBox.Show("Pencarian Tidak Ditemukan");
                    throw null;
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }
Esempio n. 2
0
    IEnumerator CustomerWaitAlert(CustomerControl customer)
    {
        yield return(null);

        if (PlayerStop.PlayerPos > 1 && !customer.StopWait && customer.WaitTime >= 30 * customer.CustomerWaitLimit && !Time.TimeNight)
        {
            WaitAlertSet.transform.position = Vector3.Lerp(WaitAlertSet.transform.position, nextAlertPos, 0.1f);
            if (WaitAlertSet.transform.position == nextAlertPos)
            {
                WaitAlertSet.transform.position = nextAlertPos;
                yield return(new WaitForSeconds(3f));

                EndAlert();
                StopCoroutine("CustomerWaitAlert");
                yield break;
            }
        }
        else if (PlayerStop.ReadyOrderd)
        {
            EndAlert();
            StopCoroutine("CustomerWaitAlert");
            yield break;
        }
        StartCoroutine("CustomerWaitAlert", customer);
    }
 public Reg_Customer()
 {
     InitializeComponent();
     _custModel = new CustomerModel();
     _custModel.Attach(this);
     _custControl = new CustomerControl(_custModel);
 }
Esempio n. 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            CustomerControl cc = new CustomerControl();

            cc.addNewCustomer(name.Text, idNumber.Text, phone.Text, email.Text, password.Text);
            MessageBox.Show(cc.Message);
        }
Esempio n. 5
0
        private void buttonTampilCustomer_Click(object sender, EventArgs e)
        {
            txtCari.Enabled = true;
            btnCari.Enabled = true;

            stat = "customer";
            var ctrl = new CustomerControl();

            dataGridViewTampil.DataSource = ctrl.ShowCustomer();
        }
        public void VratiCustomer_IdJeNula_VratiNotFound()
        {
            var controler = new CustomerControl();

            var result = controler.VratiCustomer(0);

            Assert.That(result, Is.TypeOf <NotFound>());

            Assert.That(result, Is.InstanceOf <NotFound>());
        }
        public void VratiCustomer_IdNijeNula_VratiOk()
        {
            var controler = new CustomerControl();

            var result = controler.VratiCustomer(1);

            Assert.That(result, Is.TypeOf <Ok>());

            Assert.That(result, Is.InstanceOf <Ok>());
        }
 private void AddCostumerControls(City city)
 {
     foreach (var customer in city.Customers)
     {
         if (!HasControlFor(customer))
         {
             var c = new CustomerControl(customer, Screen);
             Panel.SetZIndex(c, 100);
             _Canvas.Children.Add(c);
         }
     }
 }
Esempio n. 9
0
        private void buttonUbah_Click(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(txtCari.Text.Trim()))
                {
                    MessageBox.Show("Text Pencarian Kosong");
                    throw null;
                }
                if (string.IsNullOrEmpty(txtNamaPelanggan.Text.Trim()))
                {
                    MessageBox.Show("Nama Pelanggan Kosong");
                    throw null;
                }
                if (!Regex.Match(txtNamaPelanggan.Text, @"^[a-zA-Z]+$").Success)
                {
                    MessageBox.Show("Nama Pelanggan Tidak Boleh Mengandung Angka");
                    throw null;
                }
                if (string.IsNullOrEmpty(txtAlamatPelanggan.Text.Trim()))
                {
                    MessageBox.Show("Alamat Kosong");
                    throw null;
                }
                if (string.IsNullOrEmpty(txtNomorTelponPelanggan.Text.Trim()))
                {
                    MessageBox.Show("Nomor Telpon Kosong");
                    throw null;
                }

                var list = new CustomerControl();
                customer = new Customer(txtNamaPelanggan.Text, txtAlamatPelanggan.Text, dateTimePickerPelanggan.Text, txtNomorTelponPelanggan.Text, FormLogin.id_pegawai);
                list.UpdateCustomer(customer, txtCari.Text);
                ValidateNumberOnly(txtNomorTelponPelanggan.Text);

                txtNamaPelanggan.Enabled        = false;
                txtAlamatPelanggan.Enabled      = false;
                txtNomorTelponPelanggan.Enabled = false;
                dateTimePickerPelanggan.Enabled = false;

                MessageBox.Show("Data Berhasil Diubah");
                buttonUbah.Enabled = false;
            }
            catch (NumberOnlyException ex)
            {
                Console.WriteLine(ex.ToString());
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }
Esempio n. 10
0
    public void CustomerWaitEnd()
    {
        if (TimeManager.GetOut)
        {
            return;
        }

        for (int index = 0; index < Customers.Count; index++)
        {
            CustomerControl customerControl = Customers[index].GetComponent <CustomerControl>();
            customerControl.isWaiting = false;
        }
    }
Esempio n. 11
0
 public void StartAlert(CustomerControl customer)
 {
     if (!firstAlert)
     {
         firstAlert      = true;
         nextAlertPos    = WaitAlertSet.transform.position;
         nextAlertPos    = new Vector3(7.1f, 1.7f, -11.0f);
         WaitIcon.sprite = customer.CustomerIcon;
         WaitSpeech.text = customer.CustomerWaitOrder;
         StopCoroutine("CustomerWaitAlert");
         StartCoroutine("CustomerWaitAlert", customer);
     }
 }
Esempio n. 12
0
    public void BossItemGiv(CustomerControl customer)
    {
        GameObject  OuttedPrice;
        Rigidbody2D Pricerigid;
        Vector2     outPower;
        Transform   PriceOutPos = GameObject.Find("Price_Position").transform;

        OuttedPrice = Instantiate(customer.CustomerPrice, PriceOutPos);
        Pricerigid  = OuttedPrice.GetComponent <Rigidbody2D>();
        outPower    = new Vector2(-3f, Random.Range(5f, 6f));
        Pricerigid.AddForce(outPower, ForceMode2D.Impulse);
        Pricerigid.AddTorque(90f);
    }
Esempio n. 13
0
        internal CustomerControl CreateCustomerDialog()
        {
            DialogContentPanel.Children.Clear();
            var customerControl = new CustomerControl(ViewModel)
            {
                Height     = Double.NaN,
                Width      = 550,
                DialogHost = CustomerDialogHost
            };

            DialogContentPanel.Children.Add(customerControl);
            return(customerControl);
        }
Esempio n. 14
0
        private void button1_Click(object sender, EventArgs e)
        {
            CustomerControl myc           = new CustomerControl();
            bool            authenticated = myc.checkCustomerPassword(cusEmail.Text, cusPassword.Text);

            if (!authenticated)
            {
                MessageBox.Show(myc.Message);
                return;
            }
            CustomerMenu myCustomerMenu = new CustomerMenu();

            myCustomerMenu.Show();
            this.Hide();
        }
        private void BtnAdd_OnClick(object sender, RoutedEventArgs e)
        {
            CustomerFormPanel.Children.Clear();
            var customer = new CustomerControl();

            customer.Close += async(sender1, e1) =>
            {
                await LoadingList();
            };
            customer.Close += (sender1, e1) =>
            {
                CustomerFormFlyout.IsOpen = false;
            };
            CustomerFormPanel.Children.Add(customer);
            CustomerFormFlyout.IsOpen = true;
        }
        private void ButtonEdit_OnClick(object sender, RoutedEventArgs e)
        {
            CustomerFormPanel.Children.Clear();
            var item     = sender as FrameworkElement;
            var entity   = item?.DataContext as CustomerEntity;
            var customer = new CustomerControl(Operation.Edit, entity);

            customer.Close += async(sender1, e1) =>
            {
                await LoadingList();
            };
            customer.Close += (sender1, e1) =>
            {
                CustomerFormFlyout.IsOpen = false;
            };
            CustomerFormPanel.Children.Add(customer);
            CustomerFormFlyout.IsOpen = true;
        }
Esempio n. 17
0
        protected void Control_click(object sender, EventArgs e)
        {
            CustomerControl cc = (CustomerControl)sender;

            KubixAdmin.Customer tempcustomer = null;

            foreach (KubixAdmin.Customer customer in context.Customers.Local)
            {
                if (customer.CustomerID == cc.CustomerID)
                {
                    tempcustomer = customer;
                }
            }
            if (tempcustomer != null)
            {
                Application.Current.MainWindow.Content = new Projects(tempcustomer);
            }
        }
Esempio n. 18
0
        protected void Control_click(object sender, EventArgs e)
        {
            CustomerControl cc = (CustomerControl)sender;

            KubixAdmin.Service tempService = null;

            foreach (KubixAdmin.Service service in context.Services.Local)
            {
                if (service.ServiceID == cc.CustomerID)
                {
                    tempService = service;
                }
            }
            if (tempService != null)
            {
                Application.Current.MainWindow.Content = new Service(tempService);
            }
        }
Esempio n. 19
0
    IEnumerator CustomerAllOut()
    {
        if (Customers.Count == 0)
        {
            yield break;
        }

        SpeechOrder(false);

        CustomerControl customerControl = Customers[Customers.Count - 1].GetComponent <CustomerControl>();

        customerControl.isGoHome   = true;
        customerControl.isWaiting  = false;
        customerControl.isMarchent = false;
        customerControl.isOrder    = false;
        yield return(new WaitForSeconds(0.2f));

        StartCoroutine("CustomerAllOut");
    }
Esempio n. 20
0
        private void buttonHapus_Click(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(txtCari.Text.Trim()))
                {
                    MessageBox.Show("Text Pencarian Kosong");
                    throw null;
                }

                var list = new CustomerControl();
                list.DeleteCustomer(txtCari.Text);
                MessageBox.Show("Data Berhasil Dihapus");
                buttonHapus.Enabled = false;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }
Esempio n. 21
0
    public void CustomerOrder(CustomerControl customer)
    {
        currentCustomer         = customer;
        CustomerNameLabel.text  = customer.CustomerName;
        CustomerOrderLabel.text = customer.CustomerOrder;
        switch (customer.CustomerType)
        {
        case "A":
            SpeechStart(true);
            break;

        case "B":
            MarchentStart(true);
            break;

        case "C":
            Animator animator = currentCustomer.GetComponent <Animator>();
            animator.SetBool("isIntro", true);
            Invoke("BossActionStarter", 1f);
            break;
        }
    }
Esempio n. 22
0
        public Services()
        {
            InitializeComponent();
            context = new KubixDBEntities();
            context.Services.Load();
            BitmapImage imgsrc = new BitmapImage(new Uri("/Images/icon_user_primary.png", UriKind.Relative));

            enable  = (Style)FindResource("ButtonPrimary");
            disable = (Style)FindResource("ButtonPrimaryDisabled");

            foreach (var cust in context.Services.Local)
            {
                CustomerControl cc = new CustomerControl();
                cc.CustomerName         = cust.Name;
                cc.CustomerLocation     = cust.Description;
                cc.CustomerCreatedDate  = cust.WorkPrice.ToString();
                cc.CustomerCreatedLabel = cust.WorkTime.ToString();
                //cc.CustomerPhoneNumber = cust.PhoneNumber;
                cc.Control_Click     += new EventHandler(Control_click);
                cc.CustomerLogoSource = imgsrc;
                cc.CustomerID         = cust.ServiceID;
                rpsGridServices.Children.Add(cc);
            }
        }
Esempio n. 23
0
        public Customers()
        {
            InitializeComponent();
            context = new KubixDBEntities();
            context.Customers.Load();
            BitmapImage imgsrc = new BitmapImage(new Uri("/Images/icon_user_primary.png", UriKind.Relative));

            enable  = (Style)FindResource("ButtonPrimary");
            disable = (Style)FindResource("ButtonPrimaryDisabled");

            foreach (var cust in context.Customers.Local)
            {
                CustomerControl cc = new CustomerControl();
                cc.CustomerName         = cust.Name + " " + cust.Surname;
                cc.CustomerLocation     = cust.Address;
                cc.CustomerCreatedDate  = cust.CreationDate.ToShortDateString();
                cc.CustomerCreatedLabel = "CREATED ON";
                cc.CustomerPhoneNumber  = cust.PhoneNumber;
                cc.Control_Click       += new EventHandler(Control_click);
                cc.CustomerLogoSource   = imgsrc;
                cc.CustomerID           = cust.CustomerID;
                rpsGridCustomers.Children.Add(cc);
            }
        }
Esempio n. 24
0
 public void setTargetCustomer(CustomerControl customer)
 {
     targetCustomer = customer;
     UISetting();
 }
Esempio n. 25
0
        private void loadData()
        {
            CustomerControl myc = new CustomerControl();

            bookList.DataSource = myc.getBooksBorrowedByCustomer(LoginInfo.LoggedInId);
        }
Esempio n. 26
0
        private void btnCari_Click(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(txtCari.Text.Trim()))
                {
                    MessageBox.Show("Text Pencarian Kosong");
                    throw null;
                }

                if (stat == "customer")
                {
                    var ctrl = new CustomerControl();
                    if (ctrl.SearchCustomer(txtCari.Text) == null)
                    {
                        MessageBox.Show("Pencarian Tidak Ditemukan");
                        throw null;
                    }
                    else
                    {
                        List <Customer> CustomerList = new List <Customer>();
                        CustomerList.Add(ctrl.SearchCustomer(txtCari.Text));
                        dataGridViewTampil.DataSource = CustomerList;
                    }
                }
                else if (stat == "hewan")
                {
                    var ctrl = new HewanControl();
                    if (ctrl.SearchHewan(txtCari.Text) == null)
                    {
                        MessageBox.Show("Pencarian Tidak Ditemukan");
                        throw null;
                    }
                    else
                    {
                        List <Hewan> HewanList = new List <Hewan>();
                        HewanList.Add(ctrl.SearchHewan(txtCari.Text));
                        dataGridViewTampil.DataSource = HewanList;
                    }
                }
                else if (stat == "jenishewan")
                {
                    var ctrl = new JenisHewanControl();
                    if (ctrl.SearchJenisHewan(txtCari.Text) == null)
                    {
                        MessageBox.Show("Pencarian Tidak Ditemukan");
                        throw null;
                    }
                    else
                    {
                        List <JenisHewan> JenisHewanList = new List <JenisHewan>();
                        JenisHewanList.Add(ctrl.SearchJenisHewan(txtCari.Text));
                        dataGridViewTampil.DataSource = JenisHewanList;
                    }
                }
                else if (stat == "layanan")
                {
                    var ctrl = new LayananControl();
                    if (ctrl.SearchLayanan(txtCari.Text) == null)
                    {
                        MessageBox.Show("Pencarian Tidak Ditemukan");
                        throw null;
                    }
                    else
                    {
                        List <Layanan> LayananList = new List <Layanan>();
                        LayananList.Add(ctrl.SearchLayanan(txtCari.Text));
                        dataGridViewTampil.DataSource = LayananList;
                    }
                }
                else if (stat == "pegawai")
                {
                    var ctrl = new PegawaiControl();
                    if (ctrl.SearchPegawai(txtCari.Text) == null)
                    {
                        MessageBox.Show("Pencarian Tidak Ditemukan");
                        throw null;
                    }
                    else
                    {
                        List <Pegawai> PegawaiList = new List <Pegawai>();
                        PegawaiList.Add(ctrl.SearchPegawai(txtCari.Text));
                        dataGridViewTampil.DataSource = PegawaiList;
                    }
                }
                else if (stat == "produk")
                {
                    string           connStr     = "datasource=127.0.0.1;port=3306;username=root;password=;database=kouvee;Convert Zero Datetime=True;";
                    MySqlConnection  conn        = new MySqlConnection(connStr);
                    string           selectQuery = "SELECT * FROM produk WHERE NAMA_PRODUK = '" + txtCari.Text + "'";
                    MySqlCommand     command     = new MySqlCommand(selectQuery, conn);
                    MySqlDataAdapter da          = new MySqlDataAdapter(command);
                    DataTable        table       = new DataTable();
                    da.Fill(table);

                    if (table.Rows.Count == 0)
                    {
                        MessageBox.Show("Pencarian Tidak Ditemukan");
                        da.Dispose();
                        throw null;
                    }
                    else
                    {
                        dataGridViewTampil.DataSource = table;
                        DataGridViewImageColumn imageColumn = new DataGridViewImageColumn();
                        imageColumn = (DataGridViewImageColumn)dataGridViewTampil.Columns[9];
                        dataGridViewTampil.Columns[8].Visible = false;
                        imageColumn.ImageLayout = DataGridViewImageCellLayout.Stretch;
                        da.Dispose();
                    }
                }
                else if (stat == "supplier")
                {
                    var ctrl = new SupplierControl();
                    if (ctrl.SearchSupplier(txtCari.Text) == null)
                    {
                        MessageBox.Show("Pencarian Tidak Ditemukan");
                        throw null;
                    }
                    else
                    {
                        List <Supplier> SupplierList = new List <Supplier>();
                        SupplierList.Add(ctrl.SearchSupplier(txtCari.Text));
                        dataGridViewTampil.DataSource = SupplierList;
                    }
                }
                else if (stat == "ukuranhewan")
                {
                    var ctrl = new UkuranHewanControl();
                    if (ctrl.SearchUkuran(txtCari.Text) == null)
                    {
                        MessageBox.Show("Pencarian Tidak Ditemukan");
                        throw null;
                    }
                    else
                    {
                        List <UkuranHewan> UkuranHewanList = new List <UkuranHewan>();
                        UkuranHewanList.Add(ctrl.SearchUkuran(txtCari.Text));
                        dataGridViewTampil.DataSource = UkuranHewanList;
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }
Esempio n. 27
0
 private void btnOrderLog_Click(object sender, EventArgs e)
 {
     if (m_customerID > 0) //If takeaway type order then shows the customer information
     {
         g_ItemSelectionFlowLayoutPanel.Controls.Clear();
         CustomerControl objCustomer = new CustomerControl(orderID, this, m_objOrderLogInfo);
         g_ItemSelectionFlowLayoutPanel.Controls.Add(objCustomer);
     }
     else //For table order
     {
         g_ItemSelectionFlowLayoutPanel.Controls.Clear();
         TableInformationControl objTableInfo = new TableInformationControl(orderID, this, m_objOrderLogInfo);
         g_ItemSelectionFlowLayoutPanel.Controls.Add(objTableInfo);
     }
 }
Esempio n. 28
0
 public CustomerService()
 {
     customerControl = new CustomerControl();
 }
Esempio n. 29
0
 public void AddWaitingCustomer(CustomerControl newCus)
 {
     listCustomerWaiting.Add(newCus);
 }
Esempio n. 30
0
        /// <summary>
        /// Loading the customer information for the takeaway order.
        /// </summary>
        private void FillSummary()
        {
            try
            {
                CCustomerManager tempCustomerManager = new CCustomerManager();
                CCustomerInfo tempCustomerInfo = new CCustomerInfo();
                CResult oResult = tempCustomerManager.GetCustomerTakeawayInfo(orderID);
                tempCustomerInfo = (CCustomerInfo)oResult.Data;

                m_customerID = tempCustomerInfo.CustomerID;

                if (m_orderUserName.Replace(" ", "").ToUpper() != "Web User".Replace(" ", "").ToUpper())
                {
                    m_objOrderLog = tempCustomerManager.GetOrderLogInformation(orderID);
                    m_objOrderLogInfo = (List<OrderLogInformation>)m_objOrderLog.Data;
                }
                else
                {
                    m_objOrderLog = tempCustomerManager.GetOnlineOrderLogInformation(orderID);
                    m_objOrderLogInfo = (List<OrderLogInformation>)m_objOrderLog.Data;
                }

                if (tempCustomerInfo.CustomerID > 0) //If takeaway type order then shows the customer information
                {
                    g_ItemSelectionFlowLayoutPanel.Controls.Clear();
                    CustomerControl objCustomer = new CustomerControl(orderID, this, m_objOrderLogInfo);
                    g_ItemSelectionFlowLayoutPanel.Controls.Add(objCustomer);
                }
                else //For table order
                {
                    g_ItemSelectionFlowLayoutPanel.Controls.Clear();
                    TableInformationControl objTableInfo = new TableInformationControl(orderID, this, m_objOrderLogInfo);
                    g_ItemSelectionFlowLayoutPanel.Controls.Add(objTableInfo);
                }
            }
            catch (Exception exp)
            {
                throw exp;
            }
        }