Exemplo n.º 1
0
 public void AutoBattleStart()
 {
     _typePrint = TypePrint.AutoStart;
     BattleAuto();
 }
Exemplo n.º 2
0
 private void AutoButton_Click(object sender, RoutedEventArgs e)
 {
     _typePrint = TypePrint.AUTO;
 }
Exemplo n.º 3
0
 private void Fly_Click(object sender, RoutedEventArgs e)
 {
     _typePrint = TypePrint.Fly;
     countTick  = TimeStrelkaY = TimeStrelkaX = 0;
     Attack(p2, 3);
 }
Exemplo n.º 4
0
 private void RainButton_Click(object sender, RoutedEventArgs e)
 {
     _typePrint = TypePrint.Rain;
     countTick  = TimeStrelkaY = TimeStrelkaX = 0;
     ActivCanvas.Children.Clear();
 }
        public async Task <IActionResult> uploadAsync(OrderPrint orderPrint, OrderDetailPrint orderDetailPrint, Print print, TypePrint typePrint)
        {
            orderDetailPrint.PrintId = orderDetailPrint.PrintId.Trim();
            string wwwRootPath = _webHostEnvironment.WebRootPath;
            string fileName    = Path.GetFileNameWithoutExtension(Uploadfile.FileName);
            string extension   = Path.GetExtension(Uploadfile.FileName);

            if (extension == ".jpg" || extension == ".png" || extension == ".gif")
            {
                fileName = fileName + DateTime.Now.ToString("yymmssfff") + extension;
                orderDetailPrint.OrdPrintFile = "images/" + fileName;
                fileName = Path.Combine(wwwRootPath, "images", fileName);

                using (var fileStream = new FileStream(fileName, FileMode.Create))
                {
                    await Uploadfile.CopyToAsync(fileStream);
                }
            }
            var printid = _graphiczoneDBContext.Print.Where(x => x.PrintId == orderDetailPrint.PrintId).FirstOrDefault();

            orderDetailPrint.OrdPrintPriceset = printid.PrintPrice;
            float area       = (float)(orderDetailPrint.OrdPrintHeight * orderDetailPrint.OrdPrintWidth) / 10000;
            float printtotal = (float)(area * orderDetailPrint.OrdPrintPriceset * orderDetailPrint.OrdPrintNum);

            orderDetailPrint.OrdPrintTotal = printtotal;
            var genId = _graphiczoneDBContext.OrderDetailPrint.Count();

            orderDetailPrint.OrdPrintId = DateTime.Now.ToString("yyMMddHHmmssf") + "0" + (genId + 1).ToString();
            orderDetailPrint.OrPrintId  = HttpContext.Session.GetString("Cart"); // เพิ่ม
            _graphiczoneDBContext.OrderDetailPrint.Add(orderDetailPrint);
            _graphiczoneDBContext.SaveChanges();

            return(RedirectToAction("CreateOrder"));
        }