Пример #1
0
 // Use this for initialization
 void Start()
 {
     anim = GetComponent <Animator>();
     cc   = GetComponent <ComponentController>();
 }
Пример #2
0
 public void Setup()
 {
     this.recipeController    = new RecipeController();
     this.componentController = new ComponentController();
 }
Пример #3
0
        private void RenderBriefDescriptionDiv(ComponentController paComponentController, OrderInfoRow paOrderInfoRow, DataRow[] paOrderDetailList, int paTotalQuantity, Decimal paTotalAmount)
        {
            OrderDetailRow lcOrderDetailRow;
            int            lcOverrideStatus;
            int            lcEffectiveStatus;

            paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSBriefDescriptionDiv);
            paComponentController.RenderBeginTag(HtmlTag.Div);

            if (paOrderDetailList != null)
            {
                lcOrderDetailRow = new OrderDetailRow(null);
                lcOverrideStatus = paOrderInfoRow.OrderStatus;

                for (int lcCount = 0; lcCount < paOrderDetailList.Length; lcCount++)
                {
                    lcOrderDetailRow.Row = paOrderDetailList[lcCount];
                    if (!String.IsNullOrEmpty(lcOrderDetailRow.ItemName))
                    {
                        if (lcOverrideStatus < 0)
                        {
                            lcEffectiveStatus = lcOverrideStatus;
                        }
                        else
                        {
                            lcEffectiveStatus = lcOrderDetailRow.Status;
                        }

                        paComponentController.AddElementAttribute(ComponentController.ElementAttribute.ea_Appearance, ((OrderInfoManager.OrderUniversalStatus)lcEffectiveStatus).ToString().ToLower());

                        paComponentController.AddElementType(ComponentController.ElementType.Row);
                        paComponentController.AddElementAttribute(ComponentController.ElementAttribute.ea_DataID, lcOrderDetailRow.ItemID.ToString());
                        paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSEntryRow);
                        paComponentController.RenderBeginTag(HtmlTag.Div);

                        //paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSBullet);
                        //paComponentController.RenderBeginTag(HtmlTag.Span);
                        //paComponentController.Write(lcBullet);
                        //paComponentController.RenderEndTag();

                        paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSItemName);
                        paComponentController.RenderBeginTag(HtmlTag.Span);
                        paComponentController.Write(lcOrderDetailRow.ItemName);
                        paComponentController.RenderEndTag();

                        paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSQuantity);
                        paComponentController.RenderBeginTag(HtmlTag.Span);
                        paComponentController.Write(lcOrderDetailRow.Quantity.ToString("F0"));
                        paComponentController.RenderEndTag();

                        paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSPrice);
                        paComponentController.RenderBeginTag(HtmlTag.Span);
                        paComponentController.Write((lcOrderDetailRow.UnitPrice * lcOrderDetailRow.Quantity).ToString("F0"));
                        paComponentController.RenderEndTag();

                        if (lcEffectiveStatus == (int)OrderInfoManager.OrderUniversalStatus.Reject)
                        {
                            if (!String.IsNullOrWhiteSpace(lcOrderDetailRow.RejectReason))
                            {
                                paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSRejectReason);
                                paComponentController.RenderBeginTag(HtmlTag.Span);
                                paComponentController.Write(lcOrderDetailRow.RejectReason);
                                paComponentController.RenderEndTag();
                            }
                        }
                        else
                        {
                            if (!String.IsNullOrWhiteSpace(lcOrderDetailRow.Remark))
                            {
                                paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSItemRemark);
                                paComponentController.RenderBeginTag(HtmlTag.Span);
                                paComponentController.Write(lcOrderDetailRow.Remark);
                                paComponentController.RenderEndTag();
                            }
                        }

                        paComponentController.RenderEndTag();
                    }
                }

                paComponentController.AddElementType(ComponentController.ElementType.Summary);
                paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSTotalSummary);
                paComponentController.RenderBeginTag(HtmlTag.Div);

                paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSTotalQuantity);
                paComponentController.RenderBeginTag(HtmlTag.Span);
                paComponentController.Write(paTotalQuantity.ToString("F0"));
                paComponentController.RenderEndTag();

                paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSTotalPrice);
                paComponentController.RenderBeginTag(HtmlTag.Span);
                paComponentController.Write(paTotalAmount.ToString("F0"));
                paComponentController.RenderEndTag();

                if (paOrderInfoRow.OrderStatus == (int)OrderInfoManager.OrderUniversalStatus.Reject)
                {
                    paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSOrderRemark);
                    paComponentController.RenderBeginTag(HtmlTag.Div);
                    paComponentController.Write(paOrderInfoRow.RejectReason);
                    paComponentController.RenderEndTag();
                }
                else
                {
                    if (!String.IsNullOrEmpty(paOrderInfoRow.OrderRemark))
                    {
                        paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSOrderRemark);
                        paComponentController.RenderBeginTag(HtmlTag.Div);
                        paComponentController.Write(paOrderInfoRow.OrderRemark);
                        paComponentController.RenderEndTag();
                    }
                }

                paComponentController.RenderEndTag();
            }

            paComponentController.RenderEndTag();
        }
Пример #4
0
 public void RenderChildMode(ComponentController paComponentController)
 {
     RenderBrowserMode(paComponentController);
 }
Пример #5
0
        private void RenderInfoPanel(ComponentController paComponentController)
        {
            String lcBusinessName;
            String lcAddress;
            String lcContactNo;
            String lcOperatingHour;

            if (clSubscriberRow != null)
            {
                lcBusinessName  = clSubscriberRow.BusinessName;
                lcAddress       = UILogic.CompileAddress(clSubscriberRow.Row);
                lcContactNo     = clSubscriberRow.ContactNo;
                lcOperatingHour = clSubscriberRow.OperatingHour;
            }
            else
            {
                lcBusinessName  = String.Empty;
                lcAddress       = String.Empty;
                lcContactNo     = String.Empty;
                lcOperatingHour = String.Empty;
            }

            paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSInfoPanel);
            paComponentController.RenderBeginTag(HtmlTag.Div);

            paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSInfoIcon);
            paComponentController.RenderBeginTag(HtmlTag.Div);
            paComponentController.Write(ComponentController.UnicodeStr((int)Fontawesome.info_sign));
            paComponentController.RenderEndTag();

            paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSInfoText);
            paComponentController.RenderBeginTag(HtmlTag.Div);
            paComponentController.Write(lcBusinessName);
            paComponentController.RenderEndTag();

            paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSInfoIcon);
            paComponentController.RenderBeginTag(HtmlTag.Div);
            paComponentController.Write(ComponentController.UnicodeStr((int)Fontawesome.envelope));
            paComponentController.RenderEndTag();

            paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSInfoText);
            paComponentController.RenderBeginTag(HtmlTag.Div);
            paComponentController.Write(lcAddress);
            paComponentController.RenderEndTag();

            paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSInfoIcon);
            paComponentController.RenderBeginTag(HtmlTag.Div);

            paComponentController.Write(ComponentController.UnicodeStr((int)Fontawesome.phone));
            paComponentController.RenderEndTag();

            paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSInfoText);
            paComponentController.RenderBeginTag(HtmlTag.Div);
            paComponentController.Write(lcContactNo);
            paComponentController.RenderEndTag();

            paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSInfoIcon);
            paComponentController.RenderBeginTag(HtmlTag.Div);
            paComponentController.Write(ComponentController.UnicodeStr((int)Fontawesome.time));
            paComponentController.RenderEndTag();

            paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSInfoText);
            paComponentController.RenderBeginTag(HtmlTag.Div);
            paComponentController.Write(lcOperatingHour);
            paComponentController.RenderEndTag();

            paComponentController.RenderEndTag();
        }
Пример #6
0
        private void RenderContentList(ComponentController paComponentController, DataRow[] paDataRowList, EntryType paEntryType)
        {
            POSItemCatalogueRow lcPOSItemCatalogueRow;

            lcPOSItemCatalogueRow = new POSItemCatalogueRow(null);

            for (int lcCount = 0; lcCount < paDataRowList.Length; lcCount++)
            {
                lcPOSItemCatalogueRow.Row = paDataRowList[lcCount];

                if ((paEntryType == EntryType.Category) || (!clStockOnlyMode) || (lcPOSItemCatalogueRow.EntryAttribute != "STATIC"))
                {
                    paComponentController.AddElementType(ComponentController.ElementType.Element);
                    paComponentController.AddElementAttribute(ComponentController.ElementAttribute.gpos_EntryType, lcPOSItemCatalogueRow.EntryType.ToLower());
                    paComponentController.AddElementAttribute(ComponentController.ElementAttribute.gpos_EntryAttribute, lcPOSItemCatalogueRow.EntryAttribute.ToLower());
                    paComponentController.AddElementAttribute(ComponentController.ElementAttribute.gpos_ItemID, lcPOSItemCatalogueRow.ItemID.ToString());
                    paComponentController.AddElementAttribute(ComponentController.ElementAttribute.gpos_Category, lcPOSItemCatalogueRow.Category.ToString());
                    paComponentController.AddElementAttribute(ComponentController.ElementAttribute.gpos_Attribute, lcPOSItemCatalogueRow.Favourite ? "favourite" : "");
                    paComponentController.AddElementAttribute(ComponentController.ElementAttribute.gpos_ItemText, lcPOSItemCatalogueRow.ItemName);

                    if (paEntryType != EntryType.Category)
                    {
                        paComponentController.AddElementAttribute(ComponentController.ElementAttribute.gpos_ItemCode, lcPOSItemCatalogueRow.ItemCode.ToUpper());
                        paComponentController.AddElementAttribute(ComponentController.ElementAttribute.gpos_MajorUnitName, lcPOSItemCatalogueRow.MajorUnitName);
                        paComponentController.AddElementAttribute(ComponentController.ElementAttribute.gpos_MinorUnitName, lcPOSItemCatalogueRow.MinorUnitName);
                        paComponentController.AddElementAttribute(ComponentController.ElementAttribute.gpos_UnitRelationship, lcPOSItemCatalogueRow.UnitRelationship.ToString());
                        paComponentController.AddElementAttribute(ComponentController.ElementAttribute.gpos_ItemStatus, lcPOSItemCatalogueRow.Status.ToLower());

                        if (clPriceMode == PriceMode.PriceShow)
                        {
                            paComponentController.AddElementAttribute(ComponentController.ElementAttribute.gpos_MajorPrice, lcPOSItemCatalogueRow.MajorPrice.ToString(clSettingManager.BareCurrencyFormatString));
                            paComponentController.AddElementAttribute(ComponentController.ElementAttribute.gpos_MinorPrice, lcPOSItemCatalogueRow.MinorPrice.ToString(clSettingManager.BareCurrencyFormatString));
                            paComponentController.AddElementAttribute(ComponentController.ElementAttribute.gpos_MajorMSP, lcPOSItemCatalogueRow.MajorMSP.ToString(clSettingManager.BareCurrencyFormatString));
                            paComponentController.AddElementAttribute(ComponentController.ElementAttribute.gpos_MinorMSP, lcPOSItemCatalogueRow.MinorMSP.ToString(clSettingManager.BareCurrencyFormatString));
                        }
                    }
                    paComponentController.RenderBeginTag(HtmlTag.A);

                    paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSItemName);
                    paComponentController.RenderBeginTag(HtmlTag.Span);
                    paComponentController.Write(lcPOSItemCatalogueRow.ItemName);
                    paComponentController.RenderEndTag();

                    if (paEntryType != EntryType.Category)
                    {
                        paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSItemInfo);
                        paComponentController.RenderBeginTag(HtmlTag.Span);

                        if ((clItemCodeMode) && (!String.IsNullOrWhiteSpace(lcPOSItemCatalogueRow.ItemCode)))
                        {
                            paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSItemCode);
                            paComponentController.RenderBeginTag(HtmlTag.Span);
                            paComponentController.Write(clLanguageManager.ConvertNumber(lcPOSItemCatalogueRow.ItemCode));
                            paComponentController.RenderEndTag();
                        }

                        if (clPriceMode == PriceMode.PriceShow)
                        {
                            if (lcPOSItemCatalogueRow.MajorPrice > 0)
                            {
                                paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSMajorPrice);
                                paComponentController.RenderBeginTag(HtmlTag.Span);
                                paComponentController.Write(clLanguageManager.ConvertNumber(lcPOSItemCatalogueRow.MajorPrice.ToString(clSettingManager.CurrencyFormatString)));
                                paComponentController.RenderEndTag();
                            }


                            if (lcPOSItemCatalogueRow.MinorPrice > 0)
                            {
                                paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSMinorPrice);
                                paComponentController.RenderBeginTag(HtmlTag.Span);
                                paComponentController.Write(clLanguageManager.ConvertNumber(lcPOSItemCatalogueRow.MinorPrice.ToString(clSettingManager.CurrencyFormatString)));
                                paComponentController.RenderEndTag();
                            }
                        }

                        paComponentController.RenderEndTag();
                    }

                    paComponentController.RenderEndTag();
                }
            }
        }
Пример #7
0
 private void bwLoad_DoWork(object sender, DoWorkEventArgs e)
 {
     componentCurrentList = ComponentController.Select();
 }
Пример #8
0
 private void RenderExternalComponents(ComponentController paComponentController)
 {
     RenderImageUploader(paComponentController);
     RenderReceiptOutput(paComponentController);
 }
Пример #9
0
        private void RenderBriefDescriptionDiv(ComponentController paComponentController, OrderInfoRow paOrderInfoRow, DataRow[] paOrderDetailList, int paTotalQuantity, Decimal paTotalAmount)
        {
            OrderDetailRow lcOrderDetailRow;
            int            lcOverrideStatus;
            int            lcEffectiveStatus;

            paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSBriefDescriptionDiv);
            paComponentController.RenderBeginTag(HtmlTag.Div);

            if (paOrderDetailList != null)
            {
                lcOrderDetailRow = new OrderDetailRow(null);
                lcOverrideStatus = paOrderInfoRow.OrderStatus;

                for (int lcCount = 0; lcCount < paOrderDetailList.Length; lcCount++)
                {
                    lcOrderDetailRow.Row = paOrderDetailList[lcCount];
                    if (!String.IsNullOrEmpty(lcOrderDetailRow.ItemName))
                    {
                        if (lcOverrideStatus < 0)
                        {
                            lcEffectiveStatus = lcOverrideStatus;
                        }
                        else
                        {
                            lcEffectiveStatus = lcOrderDetailRow.Status;
                        }

                        if ((lcEffectiveStatus >= 0) && (lcOrderDetailRow.Quantity <= 0))
                        {
                            lcEffectiveStatus = (int)OrderInfoManager.OrderUniversalStatus.Cancel;
                        }

                        //   paComponentController.AddElementAttribute(ComponentController.ElementAttribute.ea_Appearance, ((OrderInfoManager.OrderUniversalStatus) lcEffectiveStatus).ToString().ToLower());
                        paComponentController.AddElementAttribute(ComponentController.ElementAttribute.ea_DataID, lcOrderDetailRow.ItemID.ToString());
                        paComponentController.AddElementAttribute(ComponentController.ElementAttribute.ea_Status, lcEffectiveStatus.ToString());
                        paComponentController.AddElementType(ComponentController.ElementType.Row);
                        paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSEntryRow);
                        paComponentController.RenderBeginTag(HtmlTag.Div);


                        paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSItemName);
                        paComponentController.RenderBeginTag(HtmlTag.Span);
                        paComponentController.Write(lcOrderDetailRow.ItemName);
                        paComponentController.RenderEndTag();

                        paComponentController.AddElementType(ComponentController.ElementType.Quantity);
                        paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSQuantity);
                        paComponentController.RenderBeginTag(HtmlTag.Span);
                        paComponentController.Write(lcOrderDetailRow.Quantity.ToString("F0"));
                        paComponentController.RenderEndTag();

                        paComponentController.AddElementType(ComponentController.ElementType.Total);
                        paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSPrice);
                        paComponentController.RenderBeginTag(HtmlTag.Span);
                        paComponentController.Write((lcOrderDetailRow.UnitPrice * lcOrderDetailRow.Quantity).ToString("F0"));
                        paComponentController.RenderEndTag();

                        if (lcEffectiveStatus >= 0)
                        {
                            paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSButtonDiv);
                            paComponentController.RenderBeginTag(HtmlTag.Div);

                            paComponentController.AddAttribute(HtmlAttribute.Href, ctCMDRejectItem);
                            paComponentController.AddAttribute(HtmlAttribute.Src, ResourceManager.GetInstance().GetFoundationIconUrl(ctICOCross));
                            paComponentController.RenderBeginTag(HtmlTag.Img);
                            paComponentController.RenderEndTag();

                            paComponentController.RenderEndTag();
                        }

                        if ((!String.IsNullOrWhiteSpace(lcOrderDetailRow.Remark)) && (lcEffectiveStatus != (int)OrderInfoManager.OrderUniversalStatus.Reject))
                        {
                            paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSItemRemark);
                            paComponentController.RenderBeginTag(HtmlTag.Span);
                            paComponentController.Write(lcOrderDetailRow.Remark);
                            paComponentController.RenderEndTag();
                        }

                        paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSRejectReason);
                        paComponentController.RenderBeginTag(HtmlTag.Span);
                        paComponentController.Write(lcOrderDetailRow.RejectReason);
                        paComponentController.RenderEndTag();


                        paComponentController.RenderEndTag();
                    }
                }

                paComponentController.AddElementType(ComponentController.ElementType.Quantity);
                paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSTotalQuantity);
                paComponentController.RenderBeginTag(HtmlTag.Span);
                paComponentController.Write(paTotalQuantity.ToString("F0"));
                paComponentController.RenderEndTag();

                paComponentController.AddElementType(ComponentController.ElementType.Total);
                paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSTotalPrice);
                paComponentController.RenderBeginTag(HtmlTag.Span);
                paComponentController.Write(paTotalAmount.ToString("F0"));
                paComponentController.RenderEndTag();
            }

            RenderFloatButtonBar(paComponentController);

            paComponentController.RenderEndTag();
        }
Пример #10
0
 protected void RenderOverlayPanel(ComponentController paComponentController)
 {
     paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSOverlayDiv);
     paComponentController.RenderBeginTag(HtmlTag.Div);
     paComponentController.RenderEndTag();
 }
Пример #11
0
 protected void RenderExternalComponents(ComponentController paComponentController)
 {
     RenderCalendar(paComponentController);
     RenderSearchPopUp(paComponentController);
     RenderReceiptOutput(paComponentController);
 }
Пример #12
0
 private void RenderExternalComponents(ComponentController paComponentController)
 {
     RenderSelectionPanel(paComponentController);
     RenderReceiptOutput(paComponentController);
 }
Пример #13
0
 // Use this for initialization
 void Start()
 {
     sr = GetComponent <SpriteRenderer>();
     cc = GetComponent <ComponentController>();
 }
Пример #14
0
        public static WidgetRenderingEngine <TWidControl> CreateInstance(CompositeFormInterface paCompositeForm, FormInfoManager paFormInfoManager, ComponentController paComponentController)
        {
            WidgetRenderingEngine <TWidControl> lcWidgetRenderingEngine;

            lcWidgetRenderingEngine = new WidgetRenderingEngine <TWidControl>(paCompositeForm, paFormInfoManager, paComponentController);

            return(lcWidgetRenderingEngine);
        }
Пример #15
0
        public void ComponentListPartial()
        {
            // Arrange
            var components = new List <Component>()
            {
                new Component()
                {
                    Name = "Ser"
                },
                new Component()
                {
                    Name = "Salami pepperoni"
                },
                new Component()
                {
                    Name = "Kurczak"
                },
                new Component()
                {
                    Name = "Szynka"
                },
                new Component()
                {
                    Name = "Pieczarki"
                },
                new Component()
                {
                    Name = "Ananas"
                },
                new Component()
                {
                    Name = "Papryka"
                },
                new Component()
                {
                    Name = "Czosnek"
                },
                new Component()
                {
                    Name = "Sałata lodowa"
                },
                new Component()
                {
                    Name = "Pomidory"
                },
                new Component()
                {
                    Name = "Ogórki"
                },
                new Component()
                {
                    Name = "Czarne oliwki"
                },
                new Component()
                {
                    Name = "Sos"
                },
                new Component()
                {
                    Name = "Kukurydza"
                },
                new Component()
                {
                    Name = "Czerwona cebula"
                }
            };
            var componentRepository = Substitute.For <IComponentRepository>();
            var mapper = Substitute.For <IMapper>();
            ComponentController controller = new ComponentController(componentRepository, mapper);

            // Act
            componentRepository.GetAll().Returns(components);
            var result   = controller.ComponentListPartial() as PartialViewResult;
            var viewName = result.ViewName;
            var model    = result.Model as List <Component>;

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual("_ComponentsPartial", viewName);
            Assert.IsNotNull(model);
            Assert.That(15, Is.EqualTo(model.Count));
        }
Пример #16
0
 protected void RenderExternalComponents(ComponentController paComponentController)
 {
     RenderPopUp(paComponentController, ctTIDStaticCostInfo, ctIIGStaticCostInfo);
     RenderCalendarPopUp(paComponentController);
 }
Пример #17
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag == "Component")
     {
         canInteract  = true;
         interactable = other.gameObject;
         currComp     = interactable.GetComponent <ComponentController>();
         if (currComp.isBroken)
         {
             bool canWeFixIt = false;
             foreach (Statics.Items item in currComp.currRepairItems)
             {
                 if (item != Statics.Items.NONE && !canWeFixIt)
                 {
                     foreach (Statics.Items playerItem in inventory)
                     {
                         if (item == playerItem)
                         {
                             canWeFixIt = true;
                             break;
                         }
                     }
                 }
             }
             if (canWeFixIt)
             {
                 CanvasManager.Instance.ShowBottomLeftText("Press Q to repair");
             }
             else
             {
                 CanvasManager.Instance.ShowBottomLeftText("Unable to repair!");
             }
         }
     }
     else if (other.tag == "Item")
     {
         canInteract      = true;
         prevInteractable = interactable;
         if (numItemsHeld == MAX_ITEMS_HELD && !other.name.Contains("Can"))
         {
             CanvasManager.Instance.ShowBottomLeftText("Inventory full!");
         }
         else
         {
             interactable = other.gameObject;
             CanvasManager.Instance.ShowBottomLeftText("Press Q to pick up");
         }
     }
     else if (other.tag == "Recycling")
     {
         canInteract = true;
         if (numItemsHeld != 0)
         {
             interactable = other.gameObject;
             CanvasManager.Instance.ShowBottomLeftText("Press Q to dump all items");
         }
     }
     else if (other.tag == "MainSpring")
     {
         canInteract  = true;
         interactable = other.gameObject;
         if (interactable.GetComponent <Gearbox>().isBroken())
         {
             currComp = interactable.GetComponent <ComponentController>();
             bool canWeFixIt = false;
             foreach (Statics.Items item in currComp.currRepairItems)
             {
                 if (item != Statics.Items.NONE && !canWeFixIt)
                 {
                     foreach (Statics.Items playerItem in inventory)
                     {
                         if (item == playerItem)
                         {
                             canWeFixIt = true;
                             break;
                         }
                     }
                 }
             }
             if (canWeFixIt)
             {
                 CanvasManager.Instance.ShowBottomLeftText("Press Q to repair");
             }
             else
             {
                 CanvasManager.Instance.ShowBottomLeftText("Unable to repair!");
             }
         }
         else
         {
             CanvasManager.Instance.ShowBottomLeftText("Press Q to wind the main spring");
         }
     }
 }
Пример #18
0
        public void Print()
        {
            ComponentController outputPaneController = new ComponentController();

            outputPaneController.PrintToOutputPane("Message", "Message from Node " + sourceNode.GetNodeID() + " to Node " + destinationNode.GetNodeID() + ".");
        }
Пример #19
0
 // Use this for initialization
 void Start()
 {
     componentScript = this.gameObject.GetComponent <ComponentController>();
 }
Пример #20
0
 private void RenderExternalComponents(ComponentController paComponentController)
 {
     RenderSelectionPanel(paComponentController, ctPNTTimeZone, ctDYTTimeZoneListTitle, TimeZoneManager.GetInstance().GetTimeZoneDictionary());
     RenderSelectionPanel(paComponentController, ctPNTDateFormat, ctDYTDateFormatListTitle, clSettingManager.GetDateFormatOptionDictionary());
     RenderImagePopUp(paComponentController);
 }
Пример #21
0
 public CSSStyleManager(ComponentController paComponentController)
 {
     clStyleList = new ArrayList();
     clIncludedStyleSheetList = new ArrayList();
     clComponentController    = paComponentController;
 }
Пример #22
0
        static void Main(string[] args)
        {
            Console.WriteLine("Вас приветствует приложение MedicalProduct!");
            Console.WriteLine("Введите, пожалуйста, Ваше имя.");
            var userName       = Console.ReadLine();
            var userController = new UserController(userName);

            if (userController.IsNewUser == true)
            {
                userController.Save();
            }

            while (true)
            {
                Console.WriteLine();
                Console.WriteLine("Какое действие Вы хотите выполнить?");
                Console.WriteLine("A - Закрыть приложение.");
                Console.WriteLine("B - Посмотреть список изделий медицинского назначения.");
                Console.WriteLine("С - Добавить новую покупку.");
                Console.WriteLine("D - Найти и посмотреть конкретное изделие медицинского назначения по Id.");
                Console.WriteLine("E - Посмотреть список покупок.");
                Console.WriteLine("F - Найти и посмотреть конкретную покупку.");
                Console.WriteLine("G - Добавить изделие медицинского назначения в аптечку.");
                Console.WriteLine("H - Изменить количество единиц препарата в аптечке.");
                Console.WriteLine("I - Удалить все данные.");
                Console.WriteLine();

                var key = Console.ReadKey();
                Console.WriteLine();

                switch (key.Key)
                {
                    #region A - Закрыть приложение.
                case ConsoleKey.A:
                    Environment.Exit(0);
                    break;

                    #endregion
                    #region B - Посмотреть список изделий медицинского назначения.
                case ConsoleKey.B:
                    var medicineShow = new MedicineController();
                    medicineShow.Show();
                    break;

                    #endregion
                    #region С - Добавить новую покупку.
                case ConsoleKey.C:
                    var moment             = ParseDate("покупки.");
                    var purchaseController = new PurchaseController(userController.CurrentUser, moment);
                    var numberPosition     = ParseInt("Количество препаратов в чеке.");
                    for (var j = 0; j < numberPosition; j++)
                    {
                        Console.WriteLine($"Заполняем {j+1} позицию.");
                        Console.WriteLine("Введите наименование препарата.");
                        var medNamePos  = Console.ReadLine();
                        var numPos      = ParseInt("Количество единиц в упаковке.");
                        var price       = ParseDecimal("Цена за 1 упаковку.");
                        var quantity    = ParseInt("Количество купленных упаковок.");
                        var numTotal    = numPos * quantity;
                        var medContrPos = new MedicineController(medNamePos, numTotal);
                        #region Заполнение компонентов и показаний к применению, если лекарство новое.
                        if (medContrPos.IsNewMedicine == true)
                        {
                            //Компоненты.
                            Console.WriteLine("Заполняем состав медицинского изделия.");
                            var numberOfComponents = ParseInt("Количество компонентов в составе.");
                            for (var i = 0; i < numberOfComponents; i++)
                            {
                                Console.WriteLine("Введите наименование компонента.");
                                var componentName       = Console.ReadLine();
                                var componentController = new ComponentController(medContrPos.CurrentMedicine, componentName);
                            }
                            //Показания к применению.
                            Console.WriteLine("Заполняем показания к применению.");
                            var numberOfIndications = ParseInt("Количество показаний к применению.");
                            for (var i = 0; i < numberOfIndications; i++)
                            {
                                Console.WriteLine("Введите наименование показания.");
                                string indicationName       = Console.ReadLine();
                                var    indicationController = new IndicationsForUseController(medContrPos.CurrentMedicine, indicationName);
                            }
                        }
                        #endregion
                        var positionContr = new PositionController(purchaseController.CurrentPurchase, medContrPos.CurrentMedicine, price, quantity);
                        positionContr.Save();
                    }
                    purchaseController.Total(purchaseController.CurrentPurchase.Id);
                    Console.WriteLine("Покупка создана.");
                    purchaseController.ShowOne(purchaseController.CurrentPurchase.Id);
                    break;

                    #endregion
                    #region D - Найти и посмотреть конкретное изделие медицинского назначения.
                case ConsoleKey.D:
                    var currentMedicineID = ParseInt("Id изделия медицинского назначения.");
                    var showOne           = new MedicineController();
                    showOne.ShowOne(currentMedicineID);
                    break;

                    #endregion
                    #region E - Посмотреть список покупок.
                case ConsoleKey.E:
                    var purchase = new PurchaseController();
                    purchase.Show();
                    break;

                    #endregion
                    #region F - Найти и посмотреть конкретную покупку.
                case ConsoleKey.F:
                    var currentPurchaseID = ParseInt("Id покупки.");
                    var showOnePur        = new PurchaseController();
                    showOnePur.ShowOne(currentPurchaseID);
                    break;

                    #endregion
                    #region G - Добавить изделие медицинского назначения в аптечку.
                case ConsoleKey.G:
                    Console.WriteLine("Введите наименование изделия медицинского назначения.");
                    var medicineName       = Console.ReadLine();
                    var number             = ParseInt("Количество единиц препарата.");
                    var medicineController = new MedicineController(medicineName, number);
                    //Заполнение компонентов и показаний к применению, если лекарство новое.
                    if (medicineController.IsNewMedicine == true)
                    {
                        //Компоненты.
                        Console.WriteLine("Заполняем состав медицинского изделия.");
                        var numberOfComponents = ParseInt("Количество компонентов в составе.");
                        for (var i = 0; i < numberOfComponents; i++)
                        {
                            Console.WriteLine("Введите наименование компонента.");
                            var componentName       = Console.ReadLine();
                            var componentController = new ComponentController(medicineController.CurrentMedicine, componentName);
                        }
                        //Показания к применению.
                        Console.WriteLine("Заполняем показания к применению.");
                        var numberOfIndications = ParseInt("Количество показаний к применению.");
                        for (var i = 0; i < numberOfIndications; i++)
                        {
                            Console.WriteLine("Введите наименование показания.");
                            string indicationName       = Console.ReadLine();
                            var    indicationController = new IndicationsForUseController(medicineController.CurrentMedicine, indicationName);
                        }
                        Console.WriteLine($"{medicineController.CurrentMedicine.Name} создан. ");
                    }
                    break;

                    #endregion
                    #region H - Изменить количество единиц препарата в аптечке по Id.
                case ConsoleKey.H:
                    var medicineID   = ParseInt("Id изделия медицинского назначения.");
                    var changeNumber = ParseInt("Итоговое количество единиц препарата.");
                    var change       = new MedicineController();
                    change.ChangeNumber(medicineID, changeNumber);
                    break;

                    #endregion
                    #region I - Удалить все данные.
                case ConsoleKey.I:
                    var u = new UserController();
                    u.RemoveRange();
                    var pu = new PurchaseController();
                    pu.RemoveRange();
                    var po = new PositionController();
                    po.RemoveRange();
                    var m = new MedicineController();
                    m.RemoveRange();
                    var c = new ComponentController();
                    c.RemoveRange();
                    var ind = new IndicationsForUseController();
                    ind.RemoveRange();
                    Console.WriteLine("Необходимо перезапустить приложение.");
                    Console.ReadLine();
                    Environment.Exit(0);
                    break;
                    #endregion
                }
            }
        }
Пример #23
0
 public CrossBrowserStyleManager(ComponentController paComponentController)
 {
     clComponentController = paComponentController;
 }
Пример #24
0
 public WidgetRenderingManager(CompositeFormInterface paCompositeForm, FormInfoManager paFormInfoManager, ComponentController paComponentController) : base(paCompositeForm, paFormInfoManager, paComponentController)
 {
 }
Пример #25
0
 public JavaScriptManager(ComponentController paComponentController)
 {
     clComponentController = paComponentController;
 }
Пример #26
0
 public void Setup()
 {
     this.componentController = new ComponentController();
 }
Пример #27
0
 public WidgetRenderingEngine(CompositeFormInterface paCompositeForm, FormInfoManager paFormInfoManager, ComponentController paComponentController)
 {
     clCompositeForm       = paCompositeForm;
     clFormInfoManager     = paFormInfoManager;
     clComponentController = paComponentController;
 }
Пример #28
0
 public void RenderChildMode(ComponentController paComponentController, String paRenderMode = null)
 {
     RenderBrowserMode(paComponentController);
 }
Пример #29
0
        private void RenderTable(ComponentController paComponentController, POSTableListRow paTableListRow)
        {
            POSReceiptRow lcPOSReceiptRow;
            Decimal       lcTotalPrice;

            if ((lcPOSReceiptRow = GetPendingReceiptRow(paTableListRow.TableID)) != null)
            {
                paComponentController.AddElementAttribute(ComponentController.ElementAttribute.gpos_ReceiptID, lcPOSReceiptRow.ReceiptID.ToString());
                paComponentController.AddElementAttribute(ComponentController.ElementAttribute.ea_Lastmodified, lcPOSReceiptRow.LastModified.ToString("yyyy-MM-dd HH:mm:ss.fff"));
                lcTotalPrice = lcPOSReceiptRow.PaymentCash;
            }
            else
            {
                lcTotalPrice = 0;
            }

            paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSTableElement);
            paComponentController.AddElementAttribute(ComponentController.ElementAttribute.ea_DataID, paTableListRow.TableID.ToString());
            paComponentController.AddElementAttribute(ComponentController.ElementAttribute.ea_Type, paTableListRow.EntryType.ToLower());
            paComponentController.AddElementAttribute(ComponentController.ElementAttribute.gpos_Reference, ctTableReferencePrefix + paTableListRow.TableID.ToString());
            paComponentController.AddElementAttribute(ComponentController.ElementAttribute.gpos_DisplayName, paTableListRow.DisplayName);
            paComponentController.AddElementType(ComponentController.ElementType.Element);
            paComponentController.RenderBeginTag(HtmlTag.Div);

            paComponentController.AddElementAttribute(ComponentController.ElementAttribute.ea_Command, ctCMDToggleActive);
            paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSInnerArea);
            paComponentController.RenderBeginTag(HtmlTag.Div);

            paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSTableElementTitle);
            paComponentController.RenderBeginTag(HtmlTag.Div);

            paComponentController.RenderBeginTag(HtmlTag.Span);
            paComponentController.Write(paTableListRow.DisplayName);
            paComponentController.RenderEndTag();

            paComponentController.AddElementAttribute(ComponentController.ElementAttribute.ea_Command, ctCMDAddOrder);
            paComponentController.RenderBeginTag(HtmlTag.Div);
            paComponentController.Write(ComponentController.UnicodeStr((int)Fontawesome.plus));
            paComponentController.RenderEndTag();

            paComponentController.AddElementAttribute(ComponentController.ElementAttribute.ea_Command, ctCMDMove);
            paComponentController.RenderBeginTag(HtmlTag.Div);
            paComponentController.Write(ComponentController.UnicodeStr((int)Fontawesome.move));
            paComponentController.RenderEndTag();

            paComponentController.RenderEndTag();

            paComponentController.AddAttribute(HtmlAttribute.Class, ctCLSTableElementContent);
            paComponentController.RenderBeginTag(HtmlTag.Div);

            paComponentController.AddElementType(ComponentController.ElementType.Total);
            paComponentController.RenderBeginTag(HtmlTag.Div);

            if (lcTotalPrice > 0)
            {
                paComponentController.Write(clLanguageManager.ConvertNumber(lcTotalPrice.ToString(clSettingManger.CurrencyFormatString)));
            }

            paComponentController.RenderEndTag();

            paComponentController.RenderEndTag();

            RenderButtonPanel(paComponentController);

            paComponentController.RenderEndTag();

            paComponentController.RenderEndTag();
        }