Exemplo n.º 1
0
        void Edit(int n, object item)
        {
            switch (n)
            {
            //case 0:
            //    BillWindow bw = new BillWindow(db, (Bill)item);
            //    bw.ShowDialog();
            //    break;
            //case 1:
            //    EntryWindow ew = new EntryWindow(db, (Entry)item);
            //    ew.ShowDialog();
            //    break;
            case 2:
                ProductWindow pw = new ProductWindow(db, (Product)item);
                pw.ShowDialog();
                break;

            case 3:
                ServiceWindow sw = new ServiceWindow(db, (Service)item);
                sw.ShowDialog();
                break;

            case 4:
                ClientWindow cw = new ClientWindow(db, (Client)item);
                cw.ShowDialog();
                break;

            case 5:
                CarWashWindow cww = new CarWashWindow(db, (CarWash)item);
                cww.ShowDialog();
                break;
            }
            Refresh(n);
        }
Exemplo n.º 2
0
        private void Stock()
        {
            var serviceWindow = new ServiceWindow();

            serviceWindow.ContentControl.Content = new ServiceControl();
            serviceWindow.ShowDialog();
        }
        internal static ServiceWindow TransformModel(Microsoft.BizTalk.ExplorerOM.TransportInfo omTransportInfo)
        {
            var serviceWindow = new ServiceWindow();

            serviceWindow.Enabled  = omTransportInfo.ServiceWindowEnabled;
            serviceWindow.FromTime = omTransportInfo.FromTime;
            serviceWindow.ToTime   = omTransportInfo.ToTime;

            return(serviceWindow);
        }
Exemplo n.º 4
0
        public bool Run()
        {
            ServiceWindow sw = new ServiceWindow();

            sw.DataContext = this;
            if (sw.ShowDialog() == true)
            {
                return(true);
            }
            return(false);
        }
Exemplo n.º 5
0
        private void EditButton_Click(object sender, RoutedEventArgs e)
        {
            var SelectedService   = MainDataGrid.SelectedItem as Service;
            var EditServiceWindow = new ServiceWindow(SelectedService);

            if ((bool)EditServiceWindow.ShowDialog())
            {
                // при успешном завершении не забываем перерисовать список услуг
                PropertyChanged(this, new PropertyChangedEventArgs("ServiceList"));
                // и еще счетчики - их добавьте сами
            }
        }
Exemplo n.º 6
0
        private void AddService_Click(object sender, RoutedEventArgs e)
        {
            // создаем новую услугу
            var NewService = new Service();

            var NewServiceWindow = new ServiceWindow(NewService);

            if ((bool)NewServiceWindow.ShowDialog())
            {
                // список услуг нужно перечитать с сервера
                ServiceList = Core.DB.Service.ToList();
                PropertyChanged(this, new PropertyChangedEventArgs("FilteredProductsCount"));
                PropertyChanged(this, new PropertyChangedEventArgs("ProductsCount"));
            }
        }
        public void EditMethodCommand()
        {
            try
            {
                MessageBox.Show("Stop feature has not been added yet. Please wait for the next version.", "Information", MessageBoxButton.OK, MessageBoxImage.Information);

                // this is in progress
                return;

                ServiceWindow serviceWindow = new ServiceWindow(this);
                serviceWindow.ShowDialog();
            }
            catch (Exception exception)
            {
                MessageBox.Show(string.Format("Unable to edit service. {0} {1}", exception.Message, exception.StackTrace), "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Exemplo n.º 8
0
        private void ButtonAddService_Click(object sender, RoutedEventArgs e)
        {
            this.edit = false;
            ServiceWindow serviceWindow = new ServiceWindow(edit, selRow);

            serviceWindow.ShowDialog();

            clsPrestaciones obj_p = new clsPrestaciones();

            dt_prestaciones = obj_p.CargarPrestaciones();

            dt_prestaciones.Columns[0].ColumnName = "SERVICE CODE";
            dt_prestaciones.Columns[1].ColumnName = "DESCRIPTION";
            dt_prestaciones.Columns[2].ColumnName = "UNIT";
            dt_prestaciones.Columns[3].ColumnName = "VALUE";

            ServicesDataGrid.ItemsSource = dt_prestaciones.DefaultView;
        }
Exemplo n.º 9
0
        void Create(int n)
        {
            bool flag = false;

            switch (n)
            {
            case 0:
                BillWindow bw = new BillWindow(db);
                flag = bw.ShowDialog();
                break;

            case 1:
                EntryWindow ew = new EntryWindow(db);
                flag = ew.ShowDialog();
                break;

            case 2:
                ProductWindow pw = new ProductWindow(db);
                flag = pw.ShowDialog();
                break;

            case 3:
                ServiceWindow sw = new ServiceWindow(db);
                flag = sw.ShowDialog();
                break;

            case 4:
                ClientWindow cw = new ClientWindow(db);
                flag = cw.ShowDialog();
                break;

            case 5:
                CarWashWindow cww = new CarWashWindow(db);
                flag = cww.ShowDialog();
                break;
            }
            if (flag)
            {
                Refresh(n);
            }
        }
Exemplo n.º 10
0
        private void buttonDependencies_Click(object sender, EventArgs e)
        {
            try
            {
                using (ServiceController controller = new ServiceController(listServices.SelectedItems[0].Name))
                {
                    List <string> dependencies = new List <string>();

                    foreach (var service in controller.ServicesDependedOn)
                    {
                        dependencies.Add(service.ServiceName);
                    }

                    ServiceWindow sw = new ServiceWindow(dependencies.ToArray());

                    sw.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                PhUtils.ShowException("Unable to show dependencies of the service", ex);
            }
        }
Exemplo n.º 11
0
 private void lvwTimes_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (lvwTimes.SelectedItems.Count == 1)
     {
         ListViewItem lvi = lvwTimes.SelectedItems[0];
         fromTimeMaskedTextBox.Text = lvi.Text;
         toTimeMaskedTextBox.Text   = lvi.SubItems[1].Text;
         if (lvi.SubItems[2].Text == "All")
         {
             chkAll.Checked = true;
         }
         else
         {
             ServiceWindow currentSW = (ServiceWindow)lvi.Tag;
             chkSun.Checked  = currentSW.Days.Contains(DayOfWeek.Sunday);
             chkMon.Checked  = currentSW.Days.Contains(DayOfWeek.Monday);
             chkTue.Checked  = currentSW.Days.Contains(DayOfWeek.Tuesday);
             chkWed.Checked  = currentSW.Days.Contains(DayOfWeek.Wednesday);
             chkThur.Checked = currentSW.Days.Contains(DayOfWeek.Thursday);
             chkFri.Checked  = currentSW.Days.Contains(DayOfWeek.Friday);
             chkSat.Checked  = currentSW.Days.Contains(DayOfWeek.Saturday);
         }
     }
 }
Exemplo n.º 12
0
        private void cmdUpdate_Click(object sender, EventArgs e)
        {
            DateTime testFromTm;

            if (!DateTime.TryParse(fromTimeMaskedTextBox.Text, out testFromTm))
            {
                MessageBox.Show("Invalid 'From' time specified!", "From time", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                fromTimeMaskedTextBox.Focus();
                return;
            }
            DateTime testToTm;

            if (!DateTime.TryParse(toTimeMaskedTextBox.Text, out testToTm))
            {
                MessageBox.Show("Invalid 'To' time specified!", "To time", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                toTimeMaskedTextBox.Focus();
                return;
            }
            if (testFromTm >= testToTm)
            {
                MessageBox.Show("'From' must be before 'To' time!", "Time", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                fromTimeMaskedTextBox.Focus();
                return;
            }

            ServiceWindow editSW;
            ListViewItem  lvi;
            string        days = "";

            if (lvwTimes.SelectedItems.Count == 1)
            {
                lvi    = lvwTimes.SelectedItems[0];
                editSW = (ServiceWindow)lvwTimes.SelectedItems[0].Tag;
            }
            else
            {
                lvi = new ListViewItem();
                lvi.SubItems.Add("");
                lvi.SubItems.Add("");
                editSW = new ServiceWindow();
            }

            editSW.From = testFromTm;
            editSW.To   = testToTm;
            editSW.Days.Clear();
            editSW.AllWeekDays = chkAll.Checked;
            if (chkSun.Checked)
            {
                editSW.Days.Add(DayOfWeek.Sunday);
            }
            if (chkMon.Checked)
            {
                editSW.Days.Add(DayOfWeek.Monday);
            }
            if (chkTue.Checked)
            {
                editSW.Days.Add(DayOfWeek.Tuesday);
            }
            if (chkWed.Checked)
            {
                editSW.Days.Add(DayOfWeek.Wednesday);
            }
            if (chkThur.Checked)
            {
                editSW.Days.Add(DayOfWeek.Thursday);
            }
            if (chkFri.Checked)
            {
                editSW.Days.Add(DayOfWeek.Friday);
            }
            if (chkSat.Checked)
            {
                editSW.Days.Add(DayOfWeek.Saturday);
            }

            lvi.Text             = editSW.From.ToString("HH:mm:ss");
            lvi.SubItems[1].Text = editSW.To.ToString("HH:mm:ss");
            if (editSW.AllWeekDays)
            {
                days = "All";
            }
            else
            {
                editSW.Days.ForEach(d => days += d.ToString().Substring(0, 2).ToLower() + ",");
                days = days.Trim(',');
            }
            lvi.SubItems[2].Text = days;
            lvi.Tag = editSW;

            if (!lvi.Selected)
            {
                foreach (ListViewItem curlvi in lvwTimes.Items)
                {
                    if (curlvi.Text == testFromTm.ToString("HH:mm:ss") && curlvi.SubItems[1].Text == testToTm.ToString("HH:mm:ss") && curlvi.SubItems[2].Text == days)
                    {
                        return;
                    }
                }
                lvwTimes.Items.Add(lvi);
            }
            else
            {
                lvi.Selected = true;
            }
        }
    // MOST OF THE INTERACTIONS HAPPEN HERE!! -----------------
    // while you are colliding with an item
    private void OnTriggerStay(Collider other)
    {
        //Debug.Log("PlayerAction is colliding with" + other.name);

        // collision with crates -----------------------------------
        if (other.gameObject.CompareTag("Crate"))
        {
            Crate crate = other.gameObject.GetComponent <Crate>();

            // if the player doesn't have an item and presses "J"
            if (!hasItem && Input.GetKeyDown(KeyCode.J))
            {
                // set item to the item from the crate
                SetItem(crate.ReturnItem());
            }
        }



        // using cutting board ---------------------------------------
        if (other.gameObject.CompareTag("CuttingBoard"))
        {
            CuttingBoard cuttingBoard = other.gameObject.GetComponent <CuttingBoard>();
            // if you have an item and the cutting board does not
            // OR
            // if you don't have an item but the cutting board does
            // AND
            // you're pressing down the "K" key
            if (hasItem && !cuttingBoard.hasItem && Input.GetKey(KeyCode.K) && currentItem.gameObject.CompareTag("FoodChoppable"))
            {
                Debug.Log("CURRENT ITEM NUMBER: " + currentItem.name);
                // give away item
                cuttingBoard.TakeInItem(currentItem);
                RemoveItem();
            }

            else if (!hasItem && cuttingBoard.hasItem && Input.GetKey(KeyCode.K))
            {
                // while the cutting is not done,
                if (!cuttingBoard.isCuttingDone)
                {
                    // cut
                    cuttingBoard.Cutting();
                    isChopping = true;
                }
            }

            if (!hasItem && cuttingBoard.isCuttingDone && Input.GetKeyDown(KeyCode.J))
            {
                SetItem(cuttingBoard.ReturnCuttedItem());
                cuttingBoard.ClearCuttingBoard();
            }
        }


        // Cooking with the Frying Pan -------------------------------------
        if (other.gameObject.CompareTag("FryingPan"))
        {
            FryingPan fryingPan = other.gameObject.GetComponent <FryingPan>();
            // if you have an item that can be cooked and the fryingPan is
            if (hasItem && !fryingPan.hasItem && Input.GetKeyDown(KeyCode.K) && currentItem.gameObject.CompareTag("FoodCookable"))
            {
                fryingPan.TakeInitem(currentItem);
                RemoveItem();
                fryingPan.CookFood();
            }

            if (!hasItem && fryingPan.isCooked && Input.GetKeyDown(KeyCode.J))
            {
                SetItem(fryingPan.ReturnCookedItem());
                fryingPan.ClearFryingPan();
            }
        }

        // Plate ----------------------------------------------------
        if (other.gameObject.CompareTag("Plate"))
        {
            Plate plate = other.gameObject.GetComponent <Plate>();
            // add item to plate
            if (hasItem && Input.GetKeyDown(KeyCode.K) && !currentItem.gameObject.CompareTag("Plate"))
            {
                plate.AddToPlate(currentItem);
                RemoveItem();
            }

            // pick up plate
            if (!hasItem && Input.GetKeyDown(KeyCode.J))
            {
                SetItem(plate.gameObject.GetComponent <Item>());
            }
        }

        // Service Window --------------------
        if (other.gameObject.CompareTag("ServiceWindow"))
        {
            ServiceWindow serviceWindow = other.gameObject.GetComponent <ServiceWindow>();

            if (hasItem && Input.GetKeyDown(KeyCode.K) && currentItem.gameObject.CompareTag("Plate"))
            {
                serviceWindow.GivePlateToWindow(currentItem.GetComponent <Plate>());
                // change plate position to x: -1     y: 3.3     z: -27
                RemoveItem();
            }
        }

        // Trash ----------------------------
        if (other.gameObject.CompareTag("Trash"))
        {
            Trash trash = other.gameObject.GetComponent <Trash>();



            if (hasItem && Input.GetKeyDown(KeyCode.K))
            {
                string tag = currentItem.gameObject.tag;
                trash.RemoveItem(currentItem);
                RemoveItem();
                if (tag == "Plate")
                {
                    CreateNewPlate();
                }
            }
        }
    }
        private void buttonDependencies_Click(object sender, EventArgs e)
        {
            try
            {
                using (ServiceController controller = new ServiceController(listServices.SelectedItems[0].Name))
                {
                    List<string> dependencies = new List<string>();

                    foreach (var service in controller.ServicesDependedOn)
                        dependencies.Add(service.ServiceName);

                    ServiceWindow sw = new ServiceWindow(dependencies.ToArray());

                    sw.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                PhUtils.ShowException("Unable to show dependencies of the service", ex);
            }
        }
 void ReleaseDesignerOutlets()
 {
     if (BottomMenu != null)
     {
         BottomMenu.Dispose();
         BottomMenu = null;
     }
     if (btnAll != null)
     {
         btnAll.Dispose();
         btnAll = null;
     }
     if (btnComments != null)
     {
         btnComments.Dispose();
         btnComments = null;
     }
     if (btnCost != null)
     {
         btnCost.Dispose();
         btnCost = null;
     }
     if (btnHalfYear != null)
     {
         btnHalfYear.Dispose();
         btnHalfYear = null;
     }
     if (btnMonth != null)
     {
         btnMonth.Dispose();
         btnMonth = null;
     }
     if (btnQuality != null)
     {
         btnQuality.Dispose();
         btnQuality = null;
     }
     if (btnQuarter != null)
     {
         btnQuarter.Dispose();
         btnQuarter = null;
     }
     if (btnRates != null)
     {
         btnRates.Dispose();
         btnRates = null;
     }
     if (btnService != null)
     {
         btnService.Dispose();
         btnService = null;
     }
     if (btnStatistic != null)
     {
         btnStatistic.Dispose();
         btnStatistic = null;
     }
     if (btnYear != null)
     {
         btnYear.Dispose();
         btnYear = null;
     }
     if (GraphicViewWindow != null)
     {
         GraphicViewWindow.Dispose();
         GraphicViewWindow = null;
     }
     if (MainBackGroubd != null)
     {
         MainBackGroubd.Dispose();
         MainBackGroubd = null;
     }
     if (ServiceWindow != null)
     {
         ServiceWindow.Dispose();
         ServiceWindow = null;
     }
     if (TopMenuView != null)
     {
         TopMenuView.Dispose();
         TopMenuView = null;
     }
 }