Example #1
0
 public Client(Fabric fabric)
 {
     scooterWheel     = fabric.CreateWheel();
     scooterSticker   = fabric.CreateSticker();
     scooterBreak     = fabric.CreateBreak();
     scooterHandleBar = fabric.CreateHandleBar();
 }
Example #2
0
    static void Main(string[] args)
    {
        OptionFeature optionFeature = new OptionFeature();

        optionFeature.material = new Material();
        Fabric fabric = (Fabric)optionFeature.material;
    }
Example #3
0
        /// <summary>
        /// 获得实体
        /// </summary>
        /// <returns></returns>
        private Fabric EntityGet()
        {
            Fabric entity = new Fabric();

            entity.ID = HTDataID;
            return(entity);
        }
Example #4
0
    // Use this for initialization
    void Start()
    {
        panel = GameObject.Find("Panel");
        gameoverPanel = GameObject.Find("gameoverPanel");

        NGUITools.SetActive(gameoverPanel, false);
        NGUITools.SetActive(panel, true);

        Time.timeScale = 1.0f;

        gameover = false;

        timer = GameProperties.timeAmount;
        score = 0;

        spawnObject = Resources.Load<clickObjectScript>("clickObjectPref");

        objectFabric = new Fabric(spawnObject);

        scoreLabel = GameObject.Find("scoreLabel").GetComponent<UILabel>();
        scoreLabel.text = "Score: " + score.ToString();

        timerLabel = GameObject.Find("timerLabel").GetComponent<UILabel>();
        timerLabel.text = "Time: " + Mathf.CeilToInt(timer).ToString();
    }
Example #5
0
 public void OrderDetails(Color color, Size size, Fabric fabric)
 {
     Color  = color;
     Size   = size;
     Fabric = fabric;
     Console.WriteLine("You are choose a product with color {0} , size {1} and fabric {2}", Color, size, fabric);
 }
Example #6
0
 /// <summary>
 /// Claim will be made onto the big square
 /// </summary>
 /// <param name="fabric"></param>
 private void Stitch(Fabric fabric)
 {
     for (int x = 0; x < fabric.FabricSideX; x++)
     {
         for (int y = 0; y < fabric.FabricSideY; y++)
         {
             var index = fabric.LeftMargin + x + ((fabric.TopMargin + y) * Stride);
             var currentSquareValue = SquareValues[index];
             if (currentSquareValue.HasValue)
             {
                 if (OverlappingIDs.Contains(fabric.ID))
                 {
                     OverlappingIDs.Remove(fabric.ID);
                 }
                 if (OverlappingIDs.Contains(currentSquareValue.Value))
                 {
                     OverlappingIDs.Remove(currentSquareValue.Value);
                 }
                 currentSquareValue = 0;
             }
             else
             {
                 currentSquareValue = fabric.ID;
             }
             SquareValues[index] = currentSquareValue;
         }
     }
 }
Example #7
0
        public static void BuyShirt()
        {
            List <IVariationStrategy> variationStrategies = new List <IVariationStrategy>()
            {
                new ColorVariation(),
                new FabricVariation(),
                new SizeVariation()
            };

            Color  color  = ChooseVariation <Color>();
            Size   size   = ChooseVariation <Size>();
            Fabric fabric = ChooseVariation <Fabric>();

            Tshirt shirt = new Tshirt(color, size, fabric);

            Console.WriteLine();
            Console.ForegroundColor = ConsoleColor.Cyan;
            Console.WriteLine($"Your order is a {color}, {fabric}, {size} t-shirt");
            Console.ForegroundColor = ConsoleColor.White;
            Console.WriteLine();
            EshopContext eshop = new EshopContext();

            eshop.SetVariationStrategy(variationStrategies);

            // Payment Method

            PaymentMethod paymentMethod = ChoosePaymentMethod();

            eshop.SelectPaymentMethod(paymentMethod);
            eshop.TotalCostShirt(shirt);

            tshirts.Add(shirt);
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Code,Content,Description,LastUpdated,MinThreshold,Quantity,Title")] Fabric fabric)
        {
            var user = _userManger.GetUserName(HttpContext.User);

            fabric.LastUpdated = DateTime.Now;
            if (id != fabric.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(fabric);
                    await _context.SaveChangesAsync();

                    logger.Info(user + " Edited Fabric: " + fabric.Title + " to quantity of: " + fabric.Quantity);
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!FabricExists(fabric.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            return(View(fabric));
        }
 public Tshirt(Color color, Size size, Fabric fabric)
 {
     Price  = 10;
     Color  = color;
     Size   = size;
     Fabric = fabric;
 }
Example #10
0
        private void button1_Click(object sender, EventArgs e)
        {
            GetUser tmp = null;

            login    = textBox1.Text.ToString();
            password = textBox2.Text.ToString();

            IDataBaseAccess db = Fabric.GetDataBaseAccess();


            IObjects req = new GetUser(login, password);

            tmp = (GetUser)db.SEND(ref req);


            //   if (tmp == null) MessageBox.Show("Пара логин / пароль неверна.\nПроверьве правильность указанных данных.");

            if (tmp == null)
            {
                answer = null;
            }
            else
            {
                answer = tmp.Answer;
                this.Close();
            }
        }
Example #11
0
        /// <summary>
        /// 更新布種
        /// </summary>
        /// <param name="fabric"></param>
        /// <returns></returns>
        public int EditFabric(Fabric fabric)
        {
            fabric.UpdateDate = DateTime.Now;
            int count = FabricAdapter.EditFabric(fabric);

            return(count);
        }
Example #12
0
 public Fabric GetFabric(Fabric fabric)
 {
     using (var context = new ManufacturingDataContext(_connectionString))
     {
         return(context.Fabrics.FirstOrDefault(f => f.MaterialId == fabric.MaterialId && f.ColorId == fabric.ColorId));
     }
 }
Example #13
0
        public Version Install(Fabric fabric)
        {
            _logService.Info(nameof(FabricInstallService), $"Installing fabric for \"{fabric.Intermediary.Version}\". Version: {fabric.Loader.Version} Build: {fabric.Loader.Build}");

            var jver = new JVersion
            {
                id           = $"{fabric.Intermediary.Version}-fabric-{fabric.Loader.Version}",
                inheritsFrom = fabric.Intermediary.Version,
                type         = "release",
                mainClass    = "net.fabricmc.loader.launch.knot.KnotClient",
                arguments    = new JArguments(),
                libraries    = fabric.LauncherMeta.Libraries.Common
                               .Concat(fabric.LauncherMeta.Libraries.Client)
                               .Concat(fabric.LauncherMeta.Libraries.Server)
                               .Append(new JLibrary {
                    name = fabric.Intermediary.Maven, url = FABRIC_MAVEN_URL
                })
                               .Append(new JLibrary {
                    name = fabric.Loader.Maven, url = FABRIC_MAVEN_URL
                })
                               .ToList(),
            };

            jver.arguments.game = new List <JsonElement>(0);

            string jsonPath = $"{_gamePathService.VersionsDir}/{jver.id}/{jver.id}.json";

            byte[] json = JsonSerializer.SerializeToUtf8Bytes(jver, _jsonOptions);

            Directory.CreateDirectory(Path.GetDirectoryName(jsonPath));
            File.WriteAllBytes(jsonPath, json);
            return(_versionService.AddNew(jsonPath));
        }
 public TShirt(string name, Color color, Size size, Fabric fabric)
 {
     Name   = name;
     Color  = color;
     Size   = size;
     Fabric = fabric;
 }
Example #15
0
 private void Start()
 {
     Fabric.With(this, new Crashlytics());
     App.Instance.Start();
     AppTools.AppContext = ApplicationContext;
     InitFontCollection();
 }
Example #16
0
        public async Task <int> CreateAsync(CreateFabricCommand command)
        {
            var producer = await _context.Producers.FirstOrDefaultAsync(x => x.Id == command.ProducerId);

            if (producer == null)
            {
                throw new GfsException(ErrorCode.ProducerNotFound, _dictionary.ProducerNotFound);
            }

            var fabric = new Fabric
            {
                Thickness    = command.Thickness,
                Name         = command.Name,
                ImageUrl     = command.ImageUrl,
                ProducerCode = command.ProducerCode,
                Producer     = producer,
                ProducerId   = command.ProducerId
            };

            await _context.Fabrics.AddAsync(fabric);

            await _context.SaveChangesAsync();

            return(fabric.Id);
        }
        public ActionResult CreateFabricPurchase(int id)
        {
            Fabric fabric = db.Fabrics.Find(id);

            if (fabric == null)
            {
                return(HttpNotFound());
            }
            ViewBag.FabricName  = fabric.Name;
            ViewBag.FabricImage = fabric.ImagePath;
            ViewBag.sFabricId   = fabric.FabricId;
            ViewBag.FabricId    = id;

            List <Receipt> lstReceipts = db.Receipts.ToList();

            ViewBag.ReceiptId = new SelectList(lstReceipts, "ReceiptId", "ReceiptImagePath", "RecepitId");
            //List<Receipt> lstReceipts = db.Receipts.ToList();

            //ViewBag.ReceiptId = new SelectList(lstReceipts, "ReceiptId", "ReceiptId", "ReceiptId");

            //List<Source> lstSources = db.Sources.ToList();

            //ViewBag.SourceId = new SelectList(lstSources, "SourceId", "SourceName", "SourceId");

            return(View());
        }
Example #18
0
        public static List <ProtectableItem> GetUnprotectedItems(
            this SiteRecoveryManagementClient client,
            Fabric primaryFabric,
            ProtectionContainer container)
        {
            List <ProtectableItem>      protectableItemList         = new List <ProtectableItem>();
            ProtectableItemListResponse protectableItemListResponse = client.ProtectableItem.List(
                primaryFabric.Name,
                container.Name,
                "Unprotected",
                null,
                "1000",
                GetRequestHeaders());

            protectableItemList.AddRange(protectableItemListResponse.ProtectableItems);
            while (protectableItemListResponse.NextLink != null)
            {
                protectableItemListResponse = client.ProtectableItem.ListNext(
                    protectableItemListResponse.NextLink,
                    GetRequestHeaders());
                protectableItemList.AddRange(protectableItemListResponse.ProtectableItems);
            }

            return(protectableItemList);
        }
Example #19
0
        public void GetProtectedContainerTest()
        {
            using (UndoContext context = UndoContext.Current)
            {
                context.Start();
                var client = GetSiteRecoveryClient(CustomHttpHandler);

                var responseServers = client.Fabrics.List(RequestHeaders);

                Fabric selectedfabric = null;
                foreach (var fabric in responseServers.Fabrics)
                {
                    if (fabric.Properties.CustomDetails.InstanceType.Contains("VMM"))
                    {
                        selectedfabric = fabric;
                        break;
                    }
                }

                var protectionContainerList = client.ProtectionContainer.List(selectedfabric.Name, RequestHeaders);
                var response = client.ProtectionContainer.Get(selectedfabric.Name,
                                                              protectionContainerList.ProtectionContainers[0].Name,
                                                              RequestHeaders);

                Assert.NotNull(response.ProtectionContainer);
                Assert.NotNull(response.ProtectionContainer.Name);
                Assert.NotNull(response.ProtectionContainer.Id);
                Assert.Equal(HttpStatusCode.OK, response.StatusCode);
            }
        }
Example #20
0
        // GET: Fabric/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Fabric fabric = db.Fabrics.Find(id);

            if (fabric == null)
            {
                return(HttpNotFound());
            }

            List <MainCategory> lstMainCategories = db.MainCategories.ToList();

            lstMainCategories.Insert(0, new MainCategory {
                MainCategoryId = 0, Name = "--Select Category--"
            });

            List <SubCategory1> lstSubCategories1 = new List <SubCategory1>();

            ViewBag.MainCategoryId = new SelectList(lstMainCategories, "MainCategoryId", "Name", fabric.MainCategoryId);
            lstSubCategories1      = db.SubCategories1.OrderBy(n => n.Name).Where(s => s.MainCategoryId == fabric.MainCategoryId).ToList();

            ViewBag.SubCategory1Id = new SelectList(lstSubCategories1, "SubCategory1Id", "Name");

            fabric.AddQuantity = 0;
            return(View(fabric));
        }
Example #21
0
    public void InitObject(Fabric objF, ClickObjectType t, ClickObjectTrajectory tr, float vel)
    {
        if(convertObject == null)
        {
            convertObject = GameObject.Find("ConvertObject").GetComponent<ConvertObject>();
        }

        if (rb == null)
        {
            rb = GetComponent<Rigidbody2D>();
        }

        if (r == null)
        {
            r = GetComponent<SpriteRenderer>();
        }
        if(targetCollider == null)
        {
            targetCollider = GetComponent<Collider2D>();
        }

        objectFabric = objF;

        clickObject = new ClickObjectController(this, t, tr, vel);
    }
Example #22
0
    private void GenerateLaundry()
    {
        Basket basket = new Basket();

        pants = new GarmentPants(new Fabric(FabricType.Denim), GarmentColor.Sky);

        Fabric cotton = new Fabric(FabricType.Cotton);

        basket.AddGarment(pants);
        basket.AddGarment(new GarmentUnderwear(cotton, GarmentColor.White));
        basket.AddGarment(new GarmentSock(cotton, GarmentColor.Red));
        basket.AddGarment(new GarmentUnderwear(cotton, GarmentColor.White));
        basket.AddGarment(new GarmentSock(cotton, GarmentColor.Red));
        basket.AddGarment(new GarmentShirt(cotton, GarmentColor.Teal));
        basket.AddGarment(new GarmentTop(cotton, GarmentColor.White));
        basket.AddGarment(new GarmentTop(cotton, GarmentColor.Salmon));

        ollie.basket = basket;

        ollie.garments = new List <Garment>();

        for (int i = 0; i < basket.contents.Count; i++)
        {
            ollie.garments.Add(basket.contents[i]);
        }
    }
Example #23
0
        /// <summary>
        /// 修改
        /// </summary>
        public override void EntityUpdate()
        {
            FabricRule rule   = new FabricRule();
            Fabric     entity = EntityGet();

            rule.RUpdate(entity);
        }
 public Tshirt(string name, Color color, Size size, Fabric fabric)
 {
     this.Name   = name;
     this.Color  = color;
     this.Size   = size;
     this.Fabric = fabric;
 }
Example #25
0
        private void btnUpdateO_Click(object sender, EventArgs e)
        {
            FabricRule rule   = new FabricRule();
            Fabric     entity = EntityGet();

            rule.RUpdate(entity);
        }
Example #26
0
        private void btnDelete_Click_1(object sender, EventArgs e)
        {
            FabricRule rule   = new FabricRule();
            Fabric     entity = EntityGet();

            rule.RDelete(entity);
        }
        public async void InstallSelected(Fabric fabric)
        {
            bool hasLocal = _versionService.GetAll()
                            .Where(v => v.Type == VersionType.Fabric && v.JarID == GameVersion)
                            .Any(v => v.ID.EndsWith(fabric.Loader.Version));

            if (hasLocal)
            {
                _windowManager.ShowMessageBox("${VersionAlreadyExists}", "${FabricInstallFailed}",
                                              MessageBoxButton.OK, MessageBoxImage.Error);

                Status = FabricInstallStatus.ListLoaded;
                return;
            }

            var version = _fabricInstallService.Install(fabric);

            var missingLibs = await _libraryService.CheckIntegrityAsync(version.Libraries);

            var downloads = _libraryService.GetDownloads(missingLibs);

            if (!await StartDownloadAsync(DownloadType.InstallFabric, downloads))
            {
                _windowManager.ShowMessageBox("${TryCompleteDependenciesOnLaunch}", "${VersionDependenciesIncomplete}",
                                              MessageBoxButton.OK, MessageBoxImage.Information);
            }

            _windowManager.ShowMessageBox("${FabricInstallSuccessful} " + version.ID, "${InstallSuccessful}");
            this.RequestClose();
        }
Example #28
0
        /// <summary>
        /// 获得实体
        /// </summary>
        /// <returns></returns>
        private Fabric EntityGet()
        {
            Fabric entity = new Fabric();

            entity.ID = HTDataID;
            entity.SelectByID();
            entity.ISN        = txtISN.Text.Trim();//编码
            entity.PNum       = txtPNum.Text.Trim();
            entity.MakeOPName = ParamConfig.LoginName;
            entity.MakeDate   = SysConvert.ToDateTime(txtMakeDate.DateTime);
            entity.VendorID   = SysConvert.ToString(drpVendorID.EditValue);
            entity.StyleNo    = txtStyleNo.Text.Trim();
            entity.ItemCode   = SysConvert.ToString(drpItemCode.EditValue);
            entity.ItemName   = txtItemName.Text.Trim();
            entity.ItemStd    = txtItemStd.Text.Trim();
            entity.ColorName  = txtColorName.Text.Trim();
            entity.ColorNum   = txtColorNum.Text.Trim();
            entity.FlowerType = SysConvert.ToString(drpFlowerType.EditValue);
            entity.JarNum     = txtJarNum.Text.Trim();
            entity.Remark     = txtRemark.Text.Trim();         //备注
            entity.MF         = txtMF.Text.Trim();
            entity.Length     = SysConvert.ToDecimal(txtLength.Text.Trim());
            entity.Weight     = SysConvert.ToDecimal(txtWeight.Text.Trim());
            entity.Shop       = SysConvert.ToString(drpShop.EditValue);
            entity.JTNum      = SysConvert.ToString(drpJTNum.EditValue);



            return(entity);
        }
Example #29
0
 public TShirt(Color color, Fabric fabric, Size size)
 {
     this.color  = color;
     this.fabric = fabric;
     this.size   = size;
     TShirtPrice = (Colors.Cost[color] + Fabrics.Cost[fabric] + Sizes.Cost[size]);
 }
Example #30
0
        public ActionResult Edit([Bind(Include = "FabricId,ItemNumber,MainCategory,MainCategoryId, SubCategory1Id,SubCategory1,SubCategory2,Name,ImagePath,ImagePath2,Location,Type,Weight,Content,Design,Brand,AddQuantity,MinusQuantity,TotalInches,Width,Source,Notes")] Fabric fabric, HttpPostedFileBase file)
        {
            if (ModelState.IsValid)
            {
                if (file != null && file.ContentLength > 0)
                {
                    var filename1 = Path.GetFileName(file.FileName);
                    var path      = Path.Combine(Server.MapPath("~/images"), filename1);
                    fabric.ImagePath = filename1;
                    file.SaveAs(path);
                }
                else
                {
                    fabric.ImagePath = db.Fabrics.AsNoTracking().Single(x => x.FabricId == fabric.FabricId).ImagePath;
                }

                //if (fabric.TotalInches >= 0)
                //{
                //    fabric.TotalInches = fabric.TotalInches + (fabric.AddQuantity / 36);

                //}
                //if (fabric.TotalQty >= fabric.MinusQuantity)
                db.Entry(fabric).State = EntityState.Modified;
                db.SaveChanges();

                return(RedirectToAction("Index"));
            }
            return(View(fabric));
        }
Example #31
0
        public static MappingOperationResponse PairCloudToAzure(
            this SiteRecoveryManagementClient client,
            Fabric primaryFabric,
            ProtectionContainer primaryContainer,
            Policy policy,
            string armResourceName)
        {
            CreateProtectionContainerMappingInputProperties pairingProps =
                new CreateProtectionContainerMappingInputProperties()
            {
                PolicyId = policy.Id,
                TargetProtectionContainerId = "Microsoft Azure",
                ProviderSpecificInput       = new ReplicationProviderContainerMappingInput()
            };

            CreateProtectionContainerMappingInput pairingInput =
                new CreateProtectionContainerMappingInput()
            {
                Properties = pairingProps
            };

            return(client.ProtectionContainerMapping.ConfigureProtection(
                       primaryFabric.Name,
                       primaryContainer.Name,
                       armResourceName,
                       pairingInput,
                       GetRequestHeaders()) as MappingOperationResponse);
        }
Example #32
0
        public ActionResult Create([Bind(Include = "FabricId,ItemNumber,MainCategory,MainCategoryId, SubCategory1Id,SubCategory1,SubCategory2,Name,ImagePath,ImagePath2,Location,Type,Weight,Content,Design,Brand,Width,TotalInches,Source,Notes")] Fabric fabric, IEnumerable <HttpPostedFileBase> files)
        {
            if (ModelState.IsValid)
            {
                var filename1 = Path.GetFileName(files.ElementAt(0).FileName);
                var path1     = Path.Combine(Server.MapPath("~/images"), filename1);
                fabric.ImagePath = filename1;
                files.ElementAt(0).SaveAs(path1);
                //if (files.ElementAt(1) != null) {

                //    var filename2 = Path.GetFileName(files.ElementAt(1).FileName);
                //    var path2 = Path.Combine(Server.MapPath("~/images"), filename2);
                //    fabric.ImagePath2 = filename2;
                //    files.ElementAt(1).SaveAs(path2);
                //}
                Guid   theGuid1 = Guid.NewGuid();
                Guid   theGuid2 = Guid.NewGuid();
                string guidString1;
                string guidString2;
                guidString1       = theGuid1.ToString().Replace("-", "").Substring(0, 4).ToUpper();
                guidString2       = theGuid2.ToString().Replace("-", "").Substring(0, 1).ToUpper();
                fabric.ItemNumber = guidString1 + "-" + guidString2;

                db.Fabrics.Add(fabric);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            return(View(fabric));
        }
Example #33
0
 public Controller(Fabric.Internal.Editor.API.V1 api)
 {
 }
        private void Button_Click_2(object sender, RoutedEventArgs e)
        {
           
            if (getemptyValidation())
                System.Windows.MessageBox.Show("Need to fill all the fields", "Empty Fields", MessageBoxButton.OK, MessageBoxImage.Warning);
            else
            {
                string fabtype = cmbFOBPAddFabType.Text;
                decimal priperyard = Convert.ToDecimal(txtFOBPAddFabPricePerYard.Text);
                float yardage = (float)Convert.ToDouble(txtFOBPAddFabYardage.Text);
                decimal transport = Convert.ToDecimal(txtFOBPAddFabCourierTransport.Text);
                DateTime date = dtsFOBPAddFab.SelectedDate.Value;

                calFab();
                if (btnFOBPAddFab.Content.ToString() == "Add")//code to add data to the fabric table is here
                {
                    try {                       
                            Fabric fab1 = new Fabric();
                            fab1.Category = fabtype;
                            fab1.PricePerYard = priperyard;
                            fab1.Yardage = yardage;
                            fab1.TransportCost = transport;
                            fab1.Date = date;

                            _context.Fabrics.Add(fab1);
                            _context.SaveChanges();

                            this.fabricDataGrid.Items.Refresh();
                            _context.Fabrics.Load();
                              System.Windows.MessageBox.Show("Succesfully Added", "Done", MessageBoxButton.OK, MessageBoxImage.Information);

                              fobpdao.populateFabCat(cmbFOBPFabEditCatogery);
                              fobpdao.populateFabCat(cmbFOBPAddFabType);
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.InnerException.ToString());
                    }                   
                }
                else // code to edit data in fabric tbale is here
                {
                  
                    try
                    {
                        string fabid = lbleditFabID.Content.ToString();
                       
                        Fabric f = _context.Fabrics.First(i => i.FabID == fabid);
                        f.Category = fabtype;
                        f.PricePerYard = priperyard;
                        f.Yardage = yardage;
                        f.TransportCost = transport;
                        f.Date = date;

                        _context.SaveChanges();
                        this.fabricDataGrid.Items.Refresh();
                        _context.Fabrics.Load();

                        fobpdao.populateFabCat(cmbFOBPFabEditCatogery);
                        System.Windows.MessageBox.Show("Succesfully Updated", "Done", MessageBoxButton.OK, MessageBoxImage.Information);
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.InnerException.ToString());
                    }
                }
                fobpdao.populateFabCat(cmbFOBPFabEditCatogery);
                fobpdao.populateFabCat(cmbFOBPAddFabType);

               
                resetFab();
               
               

            }
        }