Example #1
0
        public List <MyCountry> GetCountryMasterRecord(MyCountry Data)
        {
            DataTable dt = GetCountryRecord(Data);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                int St = 0;
                if (dt.Rows[i]["Status"].ToString() != "")
                {
                    St = Int32.Parse(dt.Rows[i]["Status"].ToString());
                }
                else
                {
                    St = 0;
                }
                ListCountry.Add(new MyCountry
                {
                    ID          = Int32.Parse(dt.Rows[i]["ID"].ToString()),
                    CountryCode = dt.Rows[i]["CountryCode"].ToString(),
                    CountryName = dt.Rows[i]["CountryName"].ToString(),
                    Status      = St
                });
            }


            return(ListCountry);
        }
Example #2
0
        public List <MyCountry> Countryviewparticular(MyCountry Data)
        {
            MasterManager    cm = new MasterManager();
            List <MyCountry> st = cm.GetCountryMasterRecord(Data);

            return(st);
        }
Example #3
0
        public List <MyCountry> Countryview(MyCountry Data)
        {
            MasterManager    cm = new MasterManager();
            List <MyCountry> st = cm.GetCountryMaster(Data);

            return(st);
        }
Example #4
0
        public List <MyCountry> countryBind(MyCountry Data)
        {
            MasterManager    cm = new MasterManager();
            List <MyCountry> st = cm.GetCommonCountryMaster(Data);

            return(st);
        }
Example #5
0
    public ActionResult Index()
    {
        var model = new ViewModel();
        var c1    = new MyCountry {
            Country = "South Africa", CountryCode = 1
        };
        var c2 = new MyCountry {
            Country = "Russia", CountryCode = 2
        };

        model.Country = new List <MyCountry> {
            c1, c2
        };
        var r1 = new Region {
            RegionName = "Gauteng", CountryCode = 1
        };
        var r2 = new Region {
            RegionName = "Western Cape", CountryCode = 1
        };
        var r3 = new Region {
            RegionName = "Siberia", CountryCode = 2
        };

        model.Region = new List <Region> {
            r1, r2, r3
        };
        return(View(model));
    }
Example #6
0
    public bool SpawnWorldAgentInThisCity()
    {
        if (worldAgentDock == null)
        {
            WorldAgent worldAgent = MyCountry.SpawnWorldAgent(entrance.position, MyCountry.isPlayerCountry);
            OnThisObjectReached(worldAgent);
            return(true);
        }

        return(false);
    }
Example #7
0
    private void OnDestroy()
    {
        MyCountry.RemoveAgentFromList(this);
        AgentManager.instance.RemoveFromList(this);

        if (MyCountry.isPlayerCountry)
        {
            ActionManager.instance.CreateAction(ActionManager.ActionInformationContent.PlayerWorldAgentDestroyed);
            UIManager.instance.WorldAgentPanel.Close();
            WorldAgentWorldInfoPanelUI.instance.Close();
        }
    }
Example #8
0
 private void Update()
 {
     foreach (ProduceItem item in produceItem)
     {
         item.UpdateMe(CountryManager.instance.IsItDefaultCountry(MyCountry) == false);
         if (item.GetCumulatedItemsAmount() > 0)
         {
             Item takenItem = item.TakeItem();
             MyCountry.AddItem(takenItem);
         }
     }
 }
Example #9
0
    public void SetItem(CountryUpgradeObject item)
    {
        country = GameManager.instance.globalCountryManager.myCountry;

        upgradeObject = item;

        if (upgradeObject.upgradeType == UpgradeObject.UpgradeType.Increment)
        {
            upgradeObject.Apply(country); //change this later
        }

        RefreshItem();
    }
Example #10
0
        public List <MyCountry> GetCommonCountryMaster(MyCountry Data)
        {
            DataTable dt = GetCommonCountryValues(Data);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                ListCountry.Add(new MyCountry
                {
                    ID          = Int32.Parse(dt.Rows[i]["ID"].ToString()),
                    CountryName = dt.Rows[i]["CountryName"].ToString(),
                });
            }
            return(ListCountry);
        }
Example #11
0
        public DataTable GetCountryValues(MyCountry Data)
        {
            string strWhere = "";

            string _Query = " select * from NVO_CountryMaster";

            if (Data.CountryCode != "")
            {
                if (strWhere == "")
                {
                    strWhere += _Query + " where CountryCode like '%" + Data.CountryCode + "%'";
                }
                else
                {
                    strWhere += " and CountryCode like '%" + Data.CountryCode + "%'";
                }
            }

            if (Data.CountryName != "")
            {
                if (strWhere == "")
                {
                    strWhere += _Query + " where CountryName like '%" + Data.CountryName + "%'";
                }
                else
                {
                    strWhere += " and CountryName like '%" + Data.CountryName + "%'";
                }
            }

            if (Data.Status.ToString() == "1")
            {
                if (strWhere == "")
                {
                    strWhere += _Query + " where Status =" + Data.Status.ToString();
                }
            }


            if (strWhere == "")
            {
                strWhere = _Query;
            }

            return(GetViewData(strWhere, ""));
        }
Example #12
0
    private void InitiateCountries()
    {
        if (!gameState.isInitialized())
        {
            return;
        }

        Country.countryCounter = gameState.countryCounter;

        var countries = gameState.GetCountries();

        myCountry = gameState.myCountry;

        if (myCountry == null)
        {
            myCountry = new MyCountry("New Country");

            //should jump to create country scene
        }

        List <Country> countryToDelete = new List <Country>();

        foreach (var country in countries)
        {
            if (!GameManager.instance.gamedatabaseManager.currentMap.countryDataObjectDictionary.ContainsKey(country.countryID))
            {
                //country never existed in the first place, remove it
                countryToDelete.Add(country);
                continue;
            }

            AddCountry(country, false);
        }

        foreach (var country in countryToDelete)
        {
            DeleteCountry(country);
        }

        AddMapDataCountries();
    }
Example #13
0
        public DataTable GetCommonCountryValues(MyCountry Data)
        {
            string _Query = "Select * from NVO_CountryMaster";

            return(GetViewData(_Query, ""));
        }
 private void Start()
 {
     country = GameManager.instance.globalCountryManager.myCountry;
 }
Example #15
0
 private void OnDrawGizmos()
 {
     Gizmos.color = MyCountry.GetCountryColor();
     Gizmos.DrawWireSphere(transform.position, blackboard.sightDistance);
 }
Example #16
0
 public GameState(string countryName)
 {
     myCountry = new MyCountry(countryName);
     myShip    = new Ship();
 }
Example #17
0
        public List <MyCountry> InsertCountryMaster(MyCountry Data)
        {
            DbConnection  con = null;
            DbTransaction trans;

            try
            {
                con = _dbFactory.GetConnection();
                con.Open();
                trans = _dbFactory.GetTransaction(con);
                DbCommand Cmd = _dbFactory.GetCommand();
                Cmd.Connection  = con;
                Cmd.Transaction = trans;

                try
                {
                    Cmd.CommandText = " IF((select count(*) from NVO_CountryMaster where ID=@ID)<=0) " +
                                      " BEGIN " +
                                      " INSERT INTO  NVO_CountryMaster(CountryCode,CountryName,Status) " +
                                      " values (@CountryCode,@CountryName,@Status) " +
                                      " END  " +
                                      " ELSE " +
                                      " UPDATE NVO_CountryMaster SET CountryCode=@CountryCode,CountryName=@CountryName,Status=@Status where ID=@ID";

                    Cmd.Parameters.Add(_dbFactory.GetParameter("@ID", Data.ID));
                    Cmd.Parameters.Add(_dbFactory.GetParameter("@CountryCode", Data.CountryCode));
                    Cmd.Parameters.Add(_dbFactory.GetParameter("@CountryName", Data.CountryName));
                    Cmd.Parameters.Add(_dbFactory.GetParameter("@Status", Data.Status));

                    int result = Cmd.ExecuteNonQuery();

                    Cmd.CommandText = "select ident_current('NVO_CountryMaster')";
                    if (Data.ID == 0)
                    {
                        Data.ID = Int32.Parse(Cmd.ExecuteScalar().ToString());
                    }
                    else
                    {
                        Data.ID = Data.ID;
                    }

                    trans.Commit();
                    return(ListCountry);
                }
                catch (Exception ex)
                {
                    string ss = ex.ToString();
                    trans.Rollback();
                    return(ListCountry);
                }
            }


            catch (Exception ex)
            {
                throw ex;
            }

            finally
            {
                if (con != null && con.State != ConnectionState.Closed)
                {
                    con.Close();
                }
            }
        }
Example #18
0
        public DataTable GetCountryRecord(MyCountry Data)
        {
            string _Query = "Select * from NVO_CountryMaster where ID=" + Data.ID;

            return(GetViewData(_Query, ""));
        }