Пример #1
0
        public void R8()
        {
            Time = 200;//下一波攻擊時間

            MakeMonster("B1", new MONSTER7_C(new Vector2(50, 0)), 3 + GamePage.HERO_S);
            MakeMonster("B1", new MONSTER7_C(new Vector2(350, 0)), 3 + GamePage.HERO_S);


            MakeMonster("B1", new MONSTER41_B(new Vector2(100, 300)), 3 + GamePage.HERO_S);

            MakeMonster("C1", new MONSTER31_C(new Vector2(0, 0)), 5);



            //中間攻擊法
            for (int i = 0; i < 3 + GamePage.HERO_S; i++)
            {
                MONSTER11_C MMM = new MONSTER11_C(new Vector2(40 * i + 480 - 50, 500));
                MMM.Yn = 500;


                MMM.N2     = GamePage.randObj.Next(50, 120);
                MMM.ADD_X2 = -1f;
                MMM.ADD_Y2 = -2f;


                MMM.N3     = 500;
                MMM.ADD_X3 = -1f;
                MMM.ADD_Y3 = 1f;



                BOX.Add(MMM);
            }
        }
Пример #2
0
        public void R2()
        {
            Time = 100;//下一波攻擊時間


            for (int i = 0; i < 3; i++)
            {
                MONSTER11_B MMM = new MONSTER11_B(new Vector2(40 * i + 480 - 50, 750));
                MMM.Yn = 0;



                MMM.N2     = 250;
                MMM.ADD_X2 = -1f;
                MMM.ADD_Y2 = -2f;


                MMM.N3     = 500;
                MMM.ADD_X3 = -1f;
                MMM.ADD_Y3 = 2f;



                BOX.Add(MMM);
            }
        }
Пример #3
0
        public void R3()
        {
            Time = 300;//下一波攻擊時間
            MakeMonster("A1", new MONSTER51_B(new Vector2(20, 0)), 5);

            for (int i = 0; i < 20; i++)
            {
                MONSTER11_B MMM = new MONSTER11_B(new Vector2(380, -60 * i));
                MMM.N2     = 120;
                MMM.ADD_X2 = -2.5f;
                MMM.ADD_Y2 = 0;

                MMM.N3     = 85;
                MMM.ADD_X3 = 0;
                MMM.ADD_Y3 = -2.5f;

                MMM.N4     = 85;
                MMM.ADD_X4 = 2.5f;
                MMM.ADD_Y4 = 0;


                MMM.N5     = 500;
                MMM.ADD_X5 = 0;
                MMM.ADD_Y5 = 2.5f;

                BOX.Add(MMM);
            }
        }
Пример #4
0
        public void R3()
        {
            Time = 300;//下一波攻擊時間
            MakeMonster("C1", new MONSTER3(new Vector2(0, 0)), 3);



            for (int i = 0; i < 10; i++)
            {
                MONSTER11 MMM = new MONSTER11(new Vector2(430, -60 * i));
                MMM.Yn = 250;

                MMM.N2     = 120;
                MMM.ADD_X2 = -1f;
                MMM.ADD_Y2 = 2f;

                MMM.N3     = 500;
                MMM.ADD_X3 = 0f;
                MMM.ADD_Y3 = 2f;

                BOX.Add(MMM);
            }


            MakeMonster("B1", new MONSTER3(new Vector2(0, 100)), 3);
            MakeMonster("B1", new MONSTER7(new Vector2(200, 100)), 3);
        }
Пример #5
0
        /// <summary>
        /// Получает ДЕЙСТВУЮЩУЮ цену на бумагу по отправленному ISIN и записывает в Storage.CurrentQuoteAll
        /// </summary>
        /// <param name="currentISIN"></param>
        internal static void StorageISINandQuoteSave(List <string> currentISIN)
        {
            int           i          = 0;
            List <object> AllXMLMass = new List <object>();

            try
            {
                WebRequest request = WebRequest.Create(XMLFTPFILE);
                request.Credentials = new NetworkCredential(userftp, passftp);
                using (WebResponse responce = request.GetResponse())
                {
                    using (var reader = XmlReader.Create(responce.GetResponseStream()))
                    {
                        while (reader.ReadToFollowing("Data"))
                        {
                            if (reader.GetAttribute("Type", "urn:schemas-microsoft-com:office:spreadsheet") == "String" || reader.GetAttribute("Type", "urn:schemas-microsoft-com:office:spreadsheet") == "Number")
                            {
                                i++;
                                if (i > 4)
                                {
                                    AllXMLMass.Add(reader.ReadElementContentAsString());
                                }
                            }
                        }
                    }
                }
                AddQuoteintoStorageCurrentQuoteAll(AllXMLMass, currentISIN);
            }
            catch (ArgumentOutOfRangeException) { }
            catch (FormatException) { BOX.ShowInformation("Failed to get topical values from XML"); }
            catch (Exception ex)
            {
                BOX.ShowError(ex.Message, ex.Source);
            }
        }
 private void HoldingsTable()
 {
     try
     {
         Holdings = new DataTable();
         var          holdings          = ClientReportVM.InvestCollection;
         DataColumn[] ColumnsCollection = new DataColumn[10]
         {
             new DataColumn("Type", typeof(String)),
             new DataColumn("Currency", typeof(String)),
             new DataColumn("Date", typeof(String)),
             new DataColumn("Units", typeof(String)),
             new DataColumn("Aq. Prise", typeof(String)),
             new DataColumn("Isin", typeof(String)),
             new DataColumn("Marced Value", typeof(String)),
             new DataColumn("Marced Value USD", typeof(String)),
             new DataColumn("Profit", typeof(String)),
             new DataColumn("Weight", typeof(String))
         };
         Holdings.ColumnCollectionAdd(ColumnsCollection);
         var list = holdings.MassObjToList();
         foreach (var item in list)
         {
             Holdings.Rows.Add(item.Type, item.Value, item.Date, item.Units,
                               item.AqPr, item.Isin, item.Markedvalue, item.MarkedvalueUSD, item.profit, item.Percent);
         }
     }
     catch (Exception ex) { BOX.ShowInformation(ex.Message); }
 }
Пример #7
0
 private void CloseT(object sender, RoutedEventArgs e)
 {
     if (BOX.ShowQuestion("Do you realy want to close Application ?", "Exit") == true)
     {
         Environment.Exit(0);
     }
 }
Пример #8
0
        public void R10()
        {
            MakeMonster("B1", new MONSTER6(new Vector2(0, -350)), 3);

            MakeMonster("B1", new MONSTER7_C(new Vector2(250, 0)), 3);

            Time = 300;//下一波攻擊時間
            for (int i = 0; i < 5; i++)
            {
                MONSTER11 MMM = new MONSTER11_C(new Vector2(50, -40 * i));
                MMM.Yn = GamePage.randObj.Next(0, 150);

                MMM.N2     = GamePage.randObj.Next(80, 320);
                MMM.ADD_X2 = (float)(GamePage.randObj.Next(0, 150) * 0.01);
                MMM.ADD_Y2 = 2f;


                MMM.N3     = 500;
                MMM.ADD_X3 = 0f;
                MMM.ADD_Y3 = 2f;



                BOX.Add(MMM);
            }
        }
Пример #9
0
        internal static void PrivateDownload(Documents doc)
        {
            try
            {
                string order = Storage.datasetKlient.Tables["ClientInfo"].Rows[0][6].ToString();
                GetInfoCorrectDownloadFolder();

                using (WebClient clientPDF = new WebClient())
                {
                    clientPDF.Credentials = new
                                            NetworkCredential(nameFTP, passwordFTP);
                    string ftpPath = pathFTP + "/" + order + "/" + "|" + doc.Name;
                    clientPDF.DownloadFile(ftpPath, downFolderName + doc.Name + ".PDF");

                    string exePath    = Directory.GetCurrentDirectory();
                    string openFolder = exePath + "Downloads";
                }
                Process.Start(@"Downloads");
            }
            catch (NullReferenceException)
            {
                // Срабатывает когда пользователь нажал не на ячейку с именем файла а пустое пространство
            }
            catch (Exception ex)
            {
                BOX.ShowError(ex.Message, ex.Source);
            }
        }
Пример #10
0
        private void worker_doWork(object sender, DoWorkEventArgs e)
        {
            BOX items = e.Argument as BOX;

            int timeout = (int)Properties.Settings.Default.Timeout;

            try
            {
                items.process.Start();

                for (int elapsedTime = 250; !cancelState && !items.process.HasExited && (timeout == 0 ? true : (elapsedTime < timeout)); elapsedTime += 250)
                {
                    items.process.WaitForExit(250);
                }
                if (!items.process.HasExited)
                {
                    items.process.Kill();
                }

                items.result = items.process.ExitCode;
                e.Result     = items;
            }
            catch
            {
                items.result = -1;
                e.Result     = items;
            }
        }
Пример #11
0
        public void R1()
        {
            Time = 100;//下一波攻擊時間
            for (int i = 0; i < 20; i++)
            {
                MONSTER11_A MMM = new MONSTER11_A(new Vector2(430, -60 * i));
                MMM.Yn = 250;

                MMM.N2     = 120;
                MMM.ADD_X2 = -1f;
                MMM.ADD_Y2 = 2f;

                MMM.N3     = 500;
                MMM.ADD_X3 = 0f;
                MMM.ADD_Y3 = 2f;

                BOX.Add(MMM);
            }

            for (int i = 0; i < 20; i++)
            {
                MONSTER11_A MMM = new MONSTER11_A(new Vector2(50, -60 * i));
                MMM.Yn = 250;

                MMM.N2     = 120;
                MMM.ADD_X2 = 1f;
                MMM.ADD_Y2 = 2f;

                MMM.N3     = 500;
                MMM.ADD_X3 = 0f;
                MMM.ADD_Y3 = 2f;

                BOX.Add(MMM);
            }
        }
Пример #12
0
 /// <summary>
 /// Получает ДЕЙСТВУЮЩУЮ цену на бумагу по отправленному ISIN и записывает в Storage.CurrentQuoteAll
 /// </summary>
 /// <param name="currentISIN"></param>
 internal static void StorageISINandQuoteSave(List <string> currentISIN)
 {
     try
     {
         int cells = -1;
         using (var reader = XmlReader.Create("http://castle-privatesolutions.sg/assets/quotes/book1.xml"))
         {
             while (reader.ReadToFollowing("Data"))
             {
                 if (reader.GetAttribute("Type", "urn:schemas-microsoft-com:office:spreadsheet") == "Number")
                 {
                     cells++;
                     if (cells % 2 == 0)
                     {
                         Qoute = reader.ReadElementContentAsDecimal();
                     }
                     if (cells % 2 != 0)
                     {
                         ISIN = reader.ReadElementContentAsString();
                         if (currentISIN.Contains(ISIN))
                         {
                             Storage.CurrentQuoteAll.Add(Qoute.ToString());
                         }
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         BOX.ShowError(ex.Message, ex.Source);
     }
 }
Пример #13
0
        public void R9()
        {
            Time = 500;//下一波攻擊時間
            MakeMonster("B1", new MONSTER6(new Vector2(400, -200)), 3);


            MakeMonster("B1", new MONSTER7(new Vector2(50, 200)), 3 + GamePage.HERO_S);

            for (int i = 0; i < 5; i++)
            {
                MONSTER11 MMM = new MONSTER11_C(new Vector2(450, -40 * i));
                MMM.Yn = GamePage.randObj.Next(0, 150);

                MMM.N2     = GamePage.randObj.Next(80, 320);
                MMM.ADD_X2 = (float)(GamePage.randObj.Next(-150, 0) * 0.01);
                MMM.ADD_Y2 = 2f;


                MMM.N3     = 500;
                MMM.ADD_X3 = 0f;
                MMM.ADD_Y3 = 2f;



                BOX.Add(MMM);
            }
        }
Пример #14
0
        public override List <MONSTER_IF> getMonster(int group)
        {
            BOX.Clear();
            switch (group)
            {
            case 1: R1(); break;

            case 2: R2(); break;

            case 3: R3(); break;

            case 4: R4(); break;

            case 5: R5(); break;

            case 6: R6(); break;

            case 7: R7(); break;

            case 8: R8(); break;

            case 9: R9(); break;

            case 10: R10(); break;

            case 11: R11(); break;
            }
            return(BOX);
        }
Пример #15
0
        }//Edit a box with the specified by the DTO ID

        public BoxDTO Get(int id)
        {
            ATPEntities _dbContext = new ATPEntities();                                                //Create connection
            BOX         box        = _dbContext.BOX.Where(entity => entity.ID == id).FirstOrDefault(); //Find box with id or return null

            return(Convert(box));                                                                      //Convert to DTO and return
        }//Gets a box with the specified ID
Пример #16
0
        public void R8()
        {
            Time = 400;//下一波攻擊時間


            //中間
            for (int i = 0; i < 30; i++)
            {
                MONSTER11_B MMM = new MONSTER11_B(new Vector2(240, -40 * i));
                MMM.Yn = 100;

                MMM.N2     = GamePage.randObj.Next(50, 200);
                MMM.ADD_X2 = (float)(GamePage.randObj.Next(-150, 150) * 0.01);
                MMM.ADD_Y2 = 2f;


                MMM.N3     = 500;
                MMM.ADD_X3 = 0f;
                MMM.ADD_Y3 = 2f;



                BOX.Add(MMM);
            }
        }
Пример #17
0
        public void R4()
        {
            Time = 300;//下一波攻擊時間
            for (int i = 0; i < 12; i++)
            {
                MONSTER11 MMM = new MONSTER11(new Vector2(100, -60 * i));
                MMM.N2     = 120;
                MMM.ADD_X2 = 2.5f;
                MMM.ADD_Y2 = 0;

                MMM.N3     = 85;
                MMM.ADD_X3 = 0;
                MMM.ADD_Y3 = -2.5f;

                MMM.N4     = 85;
                MMM.ADD_X4 = -2.5f;
                MMM.ADD_Y4 = 0;


                MMM.N5     = 500;
                MMM.ADD_X5 = 0;
                MMM.ADD_Y5 = 2.5f;

                BOX.Add(MMM);
            }
        }
Пример #18
0
        public ActionResult AddBox(string code, string name, decimal price, decimal bookprice, int type)
        {
            BOX box = RemotingHelp.GetModelObject <BOX>();

            return(Json(
                       box.AddBox(code, name, price, bookprice, type),
                       JsonRequestBehavior.AllowGet
                       ));
        }
Пример #19
0
        public ActionResult UpdateBox(int boxid, BoxState state, string name, decimal price, decimal bookprice)
        {
            BOX box = RemotingHelp.GetModelObject <BOX>();

            return(Json(
                       box.UpdateBox(boxid, state, name, price, bookprice),
                       JsonRequestBehavior.AllowGet
                       ));
        }
Пример #20
0
        public ActionResult DeleteBox(int boxid)
        {
            BOX box = RemotingHelp.GetModelObject <BOX>();

            return(Json(
                       box.DeleteBox(boxid),
                       JsonRequestBehavior.AllowGet
                       ));
        }
Пример #21
0
 public override List <MONSTER_IF> getMonster(int group)
 {
     BOX.Clear();
     switch (group)
     {
     case 1: R1(); break;
     }
     return(BOX);
 }
Пример #22
0
        }//Gets all boxes as an IEnumerable

        #region Mappers
        public BoxDTO Convert(BOX box)
        => new BoxDTO
        {
            Colour   = box.COLOR,
            Height   = box.HEIGHT,
            Length   = box.LENGTH,
            Material = box.MATERIAL,
            Weight   = box.WEIGHT,
            Width    = box.WIDTH,
            ID       = box.ID
        };
Пример #23
0
 /// <summary>
 /// Загружает документ на сервер через FTP
 /// </summary>
 /// <param name="URLpath"></param>
 /// <param name="Pass"></param>
 /// <param name="username"></param>
 /// <param name="filePath"></param>
 /// <param name="fileOnFTPName"> Указывать папку с именем клиента для приватной загрузки. Например fileOnFTPName + '//order'. Расширение (.PDF) указывать во время вызова метода </param>
 /// <param name="delimiter"></param>
 internal static void FTPLoadFileOnly(string URLpath, string Pass, string username, string filePath, string fileOnFTPName)
 {
     using (WebClient client = new WebClient())
     {
         client.Credentials = new NetworkCredential(username, Pass);
         client.BaseAddress = URLpath;
         client.UploadFile(fileOnFTPName,
                           WebRequestMethods.Ftp.UploadFile, filePath);
         BOX.ShowInformation("File was successful upload");
     }
 }
Пример #24
0
        }//Removes a box with the specified ID

        public void Edit(BoxDTO dto)
        {
            ATPEntities _dbContext = new ATPEntities();                                                    //Create connection
            BOX         old        = _dbContext.BOX.Where(entity => entity.ID == dto.ID).FirstOrDefault(); //Get the old box
            BOX         newBOX     = Convert(dto);                                                         //Create a new box from a conversion

            foreach (PropertyInfo property in old.GetType().GetProperties().Where(property => property.Name != "ID"))
            {
                property.SetValue(old, property.GetValue(newBOX)); // set the values of the old box to the values of the new one
            }
            _dbContext.SaveChanges();                              //Save Changes to the database
        }//Edit a box with the specified by the DTO ID
        private void OperationButtonClick(object sender, EventArgs e)
        {
            var s  = (sender as Button).Text;
            var s1 = BOX.Text.Substring(0, BOX.SelectionStart);

            var s2 = BOX.Text.Substring(BOX.SelectionStart + BOX.SelectionLength,
                                        BOX.Text.Length - BOX.SelectionStart - BOX.SelectionLength);

            BOX.Text            = s1 + s + s2;
            BOX.SelectionStart  = s1.Length + s.Length;
            BOX.SelectionLength = 0;
            BOX.Focus();
        }
Пример #26
0
        public void R7()
        {
            Time = 500;//下一波攻擊時間

            MakeMonster("B1", new MONSTER7_C(new Vector2(50, 0)), 3);
            MakeMonster("B1", new MONSTER7_C(new Vector2(350, 0)), 3);


            for (int i = 0; i < 3; i++)
            {
                MONSTER11 MMM = new MONSTER11_C(new Vector2(40 * i + 480 - 50, 750));
                MMM.Yn = 0;



                MMM.N2     = 250;
                MMM.ADD_X2 = -1f;
                MMM.ADD_Y2 = -2f;


                MMM.N3     = 500;
                MMM.ADD_X3 = -1f;
                MMM.ADD_Y3 = 2f;



                BOX.Add(MMM);
            }


            for (int i = 0; i < 3; i++)
            {
                MONSTER11 MMM = new MONSTER11_C(new Vector2(-40 * i + 50, 750));
                MMM.Yn = 0;



                MMM.N2     = 250;
                MMM.ADD_X2 = 1f;
                MMM.ADD_Y2 = -2f;


                MMM.N3     = 500;
                MMM.ADD_X3 = 1f;
                MMM.ADD_Y3 = 2f;



                BOX.Add(MMM);
            }
        }
Пример #27
0
        /// <summary>
        /// Поиск названия фирмы и текущей акции по ISIN компании
        /// </summary>
        /// <param name="getisin">ISIN</param>
        /// <returns></returns>
        internal static string[] TitleQuoteByISIN(string getisin)
        {
            try
            {
                int      cells  = 1;
                string[] counts = { "", "" };
                using (var reader = XmlReader.Create("http://castle-privatesolutions.sg/assets/quotes/book1.xml"))
                {
                    while (reader.ReadToFollowing("Data"))
                    {
                        while (!isin.Contains(getisin))
                        {
                            if (reader.GetAttribute("Type", "urn:schemas-microsoft-com:office:spreadsheet") == "Number")
                            {
                                cells++;
                                if (cells % 2 != 0)
                                {
                                    isin.Add((reader.ReadElementContentAsString()));
                                }
                                if (cells % 2 == 0)
                                {
                                    quoe.Add((reader.ReadElementContentAsDecimal()));
                                }
                            }
                            else if (reader.GetAttribute("Type", "urn:schemas-microsoft-com:office:spreadsheet") == "String")
                            {
                                names.Add(reader.ReadElementContentAsString().ToString());
                            }
                            break;
                        }
                    }
                    if (isin.Contains(getisin))
                    {
                        int index = isin.IndexOf(getisin);
                        counts[0] = quoe[index].ToString("0.00", System.Globalization.CultureInfo.GetCultureInfo("ru-RU"));
                        counts[1] = names[index].ToString();
                        isin.Clear();
                        names.Clear();
                        quoe.Clear();
                        return(counts);
                    }
                }
            }

            catch (Exception ex)
            {
                BOX.ShowError(ex.Message, ex.Source);
            }
            string[] notFound = { "isin Not found", "isin Not found" };
            return(notFound);
        }
Пример #28
0
        public void R5()
        {
            Time = 200;//下一波攻擊時間
            MakeMonster("B1", new MONSTER3_C(new Vector2(350, 0)), 3);



            for (int i = 0; i < 3; i++)
            {
                MONSTER11 MMM = new MONSTER11_C(new Vector2(40 * i + 480 - 50, 500));
                MMM.Yn = 500;



                MMM.N2     = GamePage.randObj.Next(50, 120);
                MMM.ADD_X2 = -1f;
                MMM.ADD_Y2 = -2f;


                MMM.N3     = 500;
                MMM.ADD_X3 = -1f;
                MMM.ADD_Y3 = 2f;



                BOX.Add(MMM);
            }


            for (int i = 0; i < 3; i++)
            {
                MONSTER11 MMM = new MONSTER11_C(new Vector2(-40 * i + 50, 500));
                MMM.Yn = 500;



                MMM.N2     = GamePage.randObj.Next(50, 120);
                MMM.ADD_X2 = 1f;
                MMM.ADD_Y2 = -2f;


                MMM.N3     = 500;
                MMM.ADD_X3 = 1f;
                MMM.ADD_Y3 = 2f;



                BOX.Add(MMM);
            }
        }
Пример #29
0
        public void R7()
        {
            Time = 30;//下一波攻擊時間
            MakeMonster("A1", new BOSS5_G(new Vector2(240, 150)), 2);
            MakeMonster("C1", new MONSTER7_B(new Vector2(0, 0)), 10);



            //右邊
            for (int i = 0; i < 15; i++)
            {
                MONSTER11_A MMM = new MONSTER11_A(new Vector2(450, -40 * i));
                MMM.Yn = GamePage.randObj.Next(0, 150);

                MMM.N2     = GamePage.randObj.Next(80, 320);
                MMM.ADD_X2 = (float)(GamePage.randObj.Next(-150, 0) * 0.01);
                MMM.ADD_Y2 = 2f;


                MMM.N3     = 500;
                MMM.ADD_X3 = 0f;
                MMM.ADD_Y3 = 2f;



                BOX.Add(MMM);
            }



            //左邊
            for (int i = 0; i < 15; i++)
            {
                MONSTER11_A MMM = new MONSTER11_A(new Vector2(50, -40 * i));
                MMM.Yn = GamePage.randObj.Next(0, 150);

                MMM.N2     = GamePage.randObj.Next(80, 320);
                MMM.ADD_X2 = (float)(GamePage.randObj.Next(0, 150) * 0.01);
                MMM.ADD_Y2 = 2f;


                MMM.N3     = 500;
                MMM.ADD_X3 = 0f;
                MMM.ADD_Y3 = 2f;



                BOX.Add(MMM);
            }
        }
Пример #30
0
        public void R3()
        {
            Time = 10;//下一波攻擊時間
            MakeMonster("A1", new BOSS5(new Vector2(200, -800)), 1);

            for (int i = 0; i < 3; i++)
            {
                MONSTER11_A MMM = new MONSTER11_A(new Vector2(40 * i + 480 - 50, 750));
                MMM.Yn = 0;



                MMM.N2     = 250;
                MMM.ADD_X2 = -1f;
                MMM.ADD_Y2 = -2f;


                MMM.N3     = 500;
                MMM.ADD_X3 = -1f;
                MMM.ADD_Y3 = 2f;



                BOX.Add(MMM);
            }



            for (int i = 0; i < 3; i++)
            {
                MONSTER11_A MMM = new MONSTER11_A(new Vector2(-40 * i + 50, 750));
                MMM.Yn = 0;



                MMM.N2     = 250;
                MMM.ADD_X2 = 1f;
                MMM.ADD_Y2 = -2f;


                MMM.N3     = 500;
                MMM.ADD_X3 = 1f;
                MMM.ADD_Y3 = 2f;



                BOX.Add(MMM);
            }
        }