Пример #1
0
        private void btnSnipe_Click(object sender, EventArgs e)
        {
            VillageList list = (VillageList)villageListsBindingSource.Current;

            if (list == null)
            {
                return;
            }

            foreach (VillageInfo startVill in list.Villages)
            {
                AttackOrder order = new AttackOrder();

                DateTime time = dtpArrivle.Value;
                int      ms   = (int)numMs.Value;
                time = time.AddMilliseconds(-time.Millisecond + ms);

                order.StartLocation  = startVill.Location;
                order.TargetLocation = ucTargetVillageSelector.SelectedVillage.Location;
                order.UnitId         = (int)cbSlowestUnit.SelectedValue;
                order.Comment        = txtNote.Text;
                m_AttackHandler.CurrentAttackPlan.AttackOrders.Add(order);
                //attackOrderBindingSource.Add(order);

                order.ArrivleTime = time;
            }
        }
Пример #2
0
        public VillageList LoadVillageData(string pSubcountyId)
        {
            OracleConnection cnn = new OracleConnection(AppConfiguration.ConnectionString);
            OracleCommand    cmd;
            string           proc = "USP_MST_GET_VILLAGE";

            cmd             = new OracleCommand(proc, cnn);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@SubcountyIDIN", pSubcountyId);
            cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output;
            cmd.Connection.Open();
            OracleDataReader dr       = cmd.ExecuteReader(CommandBehavior.CloseConnection);
            VillageBO        obMaster = null;
            VillageList      Master   = new VillageList();

            while (dr.Read())
            {
                obMaster             = new VillageBO();
                obMaster.VillageID   = dr.GetInt32(dr.GetOrdinal("VILLAGEID"));
                obMaster.VillageName = dr.GetString(dr.GetOrdinal("VILLAGENAME"));
                Master.Add(obMaster);
            }
            dr.Close();
            return(Master);
        }
Пример #3
0
        /// <summary>
        /// To Get Village
        /// </summary>
        /// <param name="subcountyID"></param>
        /// <returns></returns>
        public VillageList GetVillage(string subcountyID)
        {
            OracleConnection con = new OracleConnection(AppConfiguration.ConnectionString);
            OracleCommand    cmd;
            string           proc = "USP_MST_GET_VILLAGE";

            cmd             = new OracleCommand(proc, con);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@SubcountyIDIN", subcountyID);
            cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output;
            cmd.Connection.Open();
            OracleDataReader dr       = cmd.ExecuteReader(CommandBehavior.CloseConnection);
            VillageBO        objvBO   = null;
            VillageList      objvlist = new VillageList();

            while (dr.Read())
            {
                objvBO             = new VillageBO();
                objvBO.VillageID   = (Convert.ToInt32(dr.GetValue(dr.GetOrdinal("VILLAGEID"))));
                objvBO.VillageName = dr.GetValue(dr.GetOrdinal("VILLAGENAME")).ToString();
                objvlist.Add(objvBO);
            }

            dr.Close();
            return(objvlist);
        }
Пример #4
0
        public Global()
        {
            villageList = new VillageList();
            request     = new DataRequest();
            res         = new ResourcesUpdate();
            build       = new BuildingsUpdate();
            sqlMap      = new SqlMap();

            loginThread = new BackgroundWorker();
            loginThread.WorkerSupportsCancellation = true;
            loginThread.DoWork += new DoWorkEventHandler(loginProgress);

            dorfThread = new BackgroundWorker();
            dorfThread.WorkerSupportsCancellation = true;
            dorfThread.DoWork += new DoWorkEventHandler(dorfProgress);

            incomingTroopThread = new BackgroundWorker();
            incomingTroopThread.WorkerSupportsCancellation = true;
            incomingTroopThread.DoWork += new DoWorkEventHandler(incomingTroopProgress);

            outgoingTroopThread = new BackgroundWorker();
            outgoingTroopThread.WorkerSupportsCancellation = true;
            outgoingTroopThread.DoWork += new DoWorkEventHandler(outgoingTroopProgress);

            sqlmapThread = new BackgroundWorker();
            sqlmapThread.WorkerSupportsCancellation = true;
            sqlmapThread.DoWork += new DoWorkEventHandler(sqlmapProgress);
        }
Пример #5
0
 private void cbVillageList_TextUpdate(object sender, EventArgs e)
 {
     if (villageListsBindingSource.Current != null)
     {
         VillageList list = (VillageList)villageListsBindingSource.Current;
         list.Name = cbVillageList.Text;
     }
 }
Пример #6
0
 private void btnDeleteList_Click(object sender, EventArgs e)
 {
     if (villageListsBindingSource.Current != null)
     {
         VillageList list = (VillageList)villageListsBindingSource.Current;
         m_AttackHandler.VillageLists.Remove(list);
     }
 }
Пример #7
0
        private void btnNewVillageList_Click(object sender, EventArgs e)
        {
            VillageList newList = new VillageList();

            m_AttackHandler.VillageLists.Add(newList);

            //cbVillageList.SelectedIndex = cbVillageList.Items.Count - 1;
        }
Пример #8
0
        private async void ShowWeatherExecute()
        {
            Debug.WriteLine($"De gemeente is {Village}");

            Item item = await YahooWeatherRepository.Get(Village);

            VillageList.Add(item);
            SQLiteCommandos(item);
        }
Пример #9
0
        /// <summary>
        /// To Get All Village
        /// </summary>
        /// <param name="SUBCOUNTYID"></param>
        /// <returns></returns>
        public VillageList GetAllVillage(int SUBCOUNTYID)
        {
            VillageList objVillageList = null;

            using (cnn = new OracleConnection(connStr))
            {
                using (cmd = new OracleCommand("USP_MST_GET_VILLAGE_ALL", cnn))
                {
                    cmd.CommandType = CommandType.StoredProcedure;

                    cmd.Parameters.Add("SubcountyIDIN", SUBCOUNTYID);
                    cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output;
                    cmd.Connection.Open();

                    OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);

                    VillageBO objVillageBO = null;
                    objVillageList = new VillageList();

                    while (dr.Read())
                    {
                        objVillageBO = new VillageBO();
                        if (!dr.IsDBNull(dr.GetOrdinal("VILLAGEID")))
                        {
                            objVillageBO.VillageID = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("VILLAGEID")));
                        }
                        if (!dr.IsDBNull(dr.GetOrdinal("VILLAGENAME")))
                        {
                            objVillageBO.VillageName = dr.GetValue(dr.GetOrdinal("VILLAGENAME")).ToString();
                        }
                        if (!dr.IsDBNull(dr.GetOrdinal("ISDELETED")))
                        {
                            objVillageBO.IsDeleted = dr.GetString(dr.GetOrdinal("ISDELETED"));
                        }
                        if (!dr.IsDBNull(dr.GetOrdinal("SUBCOUNTYNAME")))
                        {
                            objVillageBO.SubCountyName = dr.GetValue(dr.GetOrdinal("SUBCOUNTYNAME")).ToString();
                        }
                        if (!dr.IsDBNull(dr.GetOrdinal("COUNTYNAME")))
                        {
                            objVillageBO.CountyName = dr.GetValue(dr.GetOrdinal("COUNTYNAME")).ToString();
                        }
                        if (!dr.IsDBNull(dr.GetOrdinal("DISTRICTNAME")))
                        {
                            objVillageBO.DistrictName = dr.GetValue(dr.GetOrdinal("DISTRICTNAME")).ToString();
                        }
                        objVillageList.Add(objVillageBO);
                    }

                    dr.Close();
                }
            }

            return(objVillageList);
        }
Пример #10
0
 private void lbVillages_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Delete)
     {
         if (villageListsBindingSource.Current != null)
         {
             if (lbVillages.SelectedItem != null && lbVillages.SelectedItem is VillageInfo)
             {
                 VillageList list = (VillageList)villageListsBindingSource.Current;
                 list.Villages.Remove((VillageInfo)lbVillages.SelectedItem);
             }
         }
     }
 }
Пример #11
0
        private void btnImportVillages_Click(object sender, EventArgs e)
        {
            if (!Clipboard.ContainsText())
            {
                if (Program.Language == LanguageType.English)
                {
                    MessageBox.Show("To import first load a list of villages by using:\nStrg + c or Right Click -> Copy");
                }
                else
                {
                    MessageBox.Show("Zum importieren erst eine Liste mit Dörfern in die Zwischenablage laden:\nStrg + c oder Rechtsklick -> Kopieren");
                }
                return;
            }

            if (villageListsBindingSource.Current == null)
            {
                if (Program.Language == LanguageType.English)
                {
                    MessageBox.Show("Select a list first");
                }
                else
                {
                    MessageBox.Show("Bitte erst eine Liste auswählen");
                }
                return;
            }
            VillageList        list     = (VillageList)villageListsBindingSource.Current;
            AttackImportHelper import   = new AttackImportHelper();
            List <VillageInfo> villages = import.ImportVillages(Clipboard.GetText());

            foreach (VillageInfo v in villages)
            {
                villagesBindingSource.Add(v);
            }
        }