コード例 #1
0
 public ProductListUserControl()
 {
     InitializeComponent();
     this.products                 = new ObservableCollection <Product>();
     this.productManager           = new MySQLManager <Product>(DataConnectionResource.LOCALMYQSL);
     this.ListProductL.ItemsSource = this.products;
 }
コード例 #2
0
 public OrderListUserControl()
 {
     InitializeComponent();
     this.orders                 = new ObservableCollection <Order>();
     this.orderManager           = new MySQLManager <Order>(DataConnectionResource.LOCALMYQSL);
     this.ListOrderL.ItemsSource = this.orders;
 }
コード例 #3
0
ファイル: GameViewModel.cs プロジェクト: Edrenn/Clickers
        private GameViewModel()
        {
            MySQLManager <Castle> MySQLCastle = new MySQLManager <Castle>();

            this.MainCastle = MySQLCastle.Get(1).Result;
            this.MainCastle.GoldProducers     = new List <RessourceProducer>();
            this.MainCastle.SoldiersProducers = new Dictionary <string, SoldiersProducer>();
            this.MainCastle.ShieldStock       = new List <Models.Items.Shield>();
            this.MainCastle.WeaponStock       = new List <Models.Items.Weapon>();
            this.MainCastle.PotionStock       = new List <Models.Items.Potion>();
            this.MainCastle.Heroes            = new List <Hero>();
            this.MainCastle.Army = new Army();
            MySQLManager <HealerHouse> MyHealerHouseSQLManager = new MySQLManager <HealerHouse>();

            MainCastle.Healer = MyHealerHouseSQLManager.Get(1).Result;
            MySQLHealerHouse mySQLHealerHouse = new MySQLHealerHouse();

            mySQLHealerHouse.GetHealerHouse(MainCastle.Healer);


            MySQLManager <Blacksmith> MyBlacksmithSQLManager = new MySQLManager <Blacksmith>();

            MainCastle.Blacksmith = MyBlacksmithSQLManager.Get(1).Result;
            MySQLBlacksmith toto = new MySQLBlacksmith();

            toto.SetItems(MainCastle.Blacksmith);

            getAllHero();
            GetAllSoldierProducer();
            GetAllGoldProducer();
            ennemyCastle     = new Castle("Méchant Chato");
            this.goldCounter = this.MainCastle.Golds;
        }
コード例 #4
0
        public TaverneViewModel()
        {
            MySQLManager <Hero> mySQLHeroManager = new MySQLManager <Hero>();

            Heros     = new Dictionary <string, Hero>();
            this.View = new TaverneView();
            int         heroNumber = 1;
            bool        isOk       = true;
            List <Hero> herosList  = new List <Hero>();

            while (isOk)
            {
                Task <Hero> allHeros = mySQLHeroManager.Get(heroNumber);
                if (allHeros.Result != null)
                {
                    herosList.Add(allHeros.Result);
                    Hero      test          = allHeros.Result;
                    MySQLHero testReference = new MySQLHero();
                    test        = testReference.GetSkills(test);
                    heroNumber += 1;
                }
                else
                {
                    isOk = false;
                }
            }

            foreach (Hero hero in herosList)
            {
                Heros.Add(hero.Name, hero);
                NewHeroView(hero);
            }

            EventGenerator();
        }
コード例 #5
0
 public CategoryListUserControl()
 {
     InitializeComponent();
     this.categories                = new ObservableCollection <Category>();
     this.categoryManager           = new MySQLManager <Category>(DataConnectionResource.LOCALMYQSL);
     this.ListCategoryL.ItemsSource = this.categories;
 }
コード例 #6
0
ファイル: MySQLGridTest.cs プロジェクト: AlphaStaxLLC/taiga
        public void Init()
        {
            SuperInit();
            // If we manage to connect to the database with the user
            // and password above it is our test database, and run
            // these tests.  If anything goes wrong, ignore these
            // tests.
            try
            {
                database = new MySQLManager(connect);
                db = new MySQLGridData();
                db.Initialise(connect);
            }
            catch (Exception e)
            {
                m_log.Error("Exception {0}", e);
                Assert.Ignore();
            }

            // This actually does the roll forward assembly stuff
            Assembly assem = GetType().Assembly;

            using (MySqlConnection dbcon = new MySqlConnection(connect))
            {
                dbcon.Open();
                Migration m = new Migration(dbcon, assem, "AssetStore");
                m.Update();
            }
        }
コード例 #7
0
        public void Init()
        {
            SuperInit();

            // If we manage to connect to the database with the user
            // and password above it is our test database, and run
            // these tests.  If anything goes wrong, ignore these
            // tests.
            try
            {
                database = new MySQLManager(connect);

                // clear db incase to ensure we are in a clean state
                ClearDB(database);

                regionDb = new MySQLDataStore();
                regionDb.Initialise(connect);
                db = new MySQLEstateStore();
                db.Initialise(connect);
            }

            catch (Exception e)
            {
                m_log.Error("Exception {0}", e);
                Assert.Ignore();
            }
        }
コード例 #8
0
 public ClientListUserControl()
 {
     InitializeComponent();
     this.clients                 = new ObservableCollection <Client>();
     this.clientManager           = new MySQLManager <Client>(DataConnectionResource.LOCALMYQSL);
     this.ListClientL.ItemsSource = this.clients;
 }
コード例 #9
0
ファイル: Army.cs プロジェクト: Edrenn/Clickers
        public void GenerateHero()
        {
            Random random = new Random();
            MySQLManager <Hero> MyHeroSQLManager = new MySQLManager <Hero>();
            Hero      newHero      = null;
            MySQLHero heroSQL      = new MySQLHero();
            int       testTypeHero = random.Next(0, 40);

            if (testTypeHero <= 10)
            {
                Task <Hero> TaskHero = MyHeroSQLManager.Get(1);
                newHero = TaskHero.Result;
                newHero = heroSQL.GetSkills(newHero);
            }
            else if (testTypeHero >= 20 && testTypeHero < 30)
            {
                Task <Hero> TaskHero = MyHeroSQLManager.Get(2);
                newHero = TaskHero.Result;
                newHero = heroSQL.GetSkills(newHero);
            }
            else if (testTypeHero > 40)
            {
            }
            else
            {
                Task <Hero> TaskHero = MyHeroSQLManager.Get(3);
                newHero = TaskHero.Result;
                newHero = heroSQL.GetSkills(newHero);
            }
            GameViewModel.Instance.EnnemyCastle.Army.Hero = newHero;
        }
コード例 #10
0
 public ShopUserControl()
 {
     InitializeComponent();
     this.DataContext    = this;
     this.shopWebService = new WebServiceManager <Shop>(DataConnectionResource.LOCALAPI);
     this.shopManager    = new MySQLManager <Shop>(DataConnectionResource.LOCALMYQSL);
 }
コード例 #11
0
 public AddressUserControl()
 {
     InitializeComponent();
     this.DataContext       = this;
     this.addressWebService = new WebServiceManager <Address>(DataConnectionResource.LOCALAPI);
     this.addressManager    = new MySQLManager <Address>(DataConnectionResource.LOCALMYQSL);
 }
コード例 #12
0
 public ShopListUserControl()
 {
     InitializeComponent();
     this.shops                 = new ObservableCollection <Shop>();
     this.shopManager           = new MySQLManager <Shop>(DataConnectionResource.LOCALMYQSL);
     this.ListShopL.ItemsSource = this.shops;
 }
コード例 #13
0
 public CategoryUserControl()
 {
     InitializeComponent();
     this.DataContext        = this;
     this.categoryManager    = new MySQLManager <Category>(DataConnectionResource.LOCALMYQSL);
     this.categoryWebService = new WebServiceManager <Category>(DataConnectionResource.LOCALAPI);
 }
コード例 #14
0
ファイル: SQLReader.cs プロジェクト: lixing1993122/ResetCore
        public SQLReader(string database, string tableName = "", string id = "root", string pwd = "123456", string host = "127.0.0.1", string port = "3306")
        {
            this.database            = database;
            this.id                  = id;
            this.pwd                 = pwd;
            this.host                = host;
            this.port                = port;
            this.currentDataTypeName = tableName;

            MySQLManager.OpenSql(host, database, id, pwd, port);

            if (string.IsNullOrEmpty(currentDataTypeName))
            {
                string name = MySQLManager.GetAllTableName().GetRow(0).TryGet(0);
                currentDataTypeName = name;
            }

            fieldDict = new Dictionary <string, Type>();
            List <string> members = GetMemberNames();
            List <Type>   types   = GetMemberTypes();

            for (int i = 0; i < members.Count; i++)
            {
                fieldDict.Add(members[i], types[i]);
            }
        }
コード例 #15
0
ファイル: MySQLRegionTest.cs プロジェクト: boodie/Opensim2
        public void Init()
        {
            SuperInit();

            // If we manage to connect to the database with the user
            // and password above it is our test database, and run
            // these tests.  If anything goes wrong, ignore these
            // tests.
            try
            {
                database = new MySQLManager(connect);

                // this is important in case a previous run ended badly
                ClearDB(database);

                db = new MySQLDataStore();
                db.Initialise(connect);
            }

            catch (Exception e)
            {
                m_log.Error("Exception {0}", e);
                Assert.Ignore();
            }
        }
コード例 #16
0
        // GET: User
        private static async Task <List <User> > GetAllUsers()
        {
            MySQLManager <User> manager;

            manager = new MySQLManager <User>(DataConnectionResource.LOCALMYSQL);
            return(await manager.Get() as List <User>);
        }
コード例 #17
0
        private async void BtnValidate_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            try
            {
                String json = this.dataInsertView.txtBoxJson.Text;
                json = json.Replace("\r\n", " ");
                json = json.Replace("\n", " ");
                json = json.Replace("\\", " ");
                JsonConvert.DeserializeObject <Object>(json);

                MySQLManager <User> userManager = new MySQLManager <User>(DataConnectionResource.LOCALMYSQL);
                User currentUser = await userManager.Get(LoggedUser.UserId);

                MySQLManager <Data> dataManager = new MySQLManager <Data>(DataConnectionResource.LOCALMYSQL);
                Data data = new Data();
                data.JsonData = this.dataInsertView.txtBoxJson.Text;
                data.User     = currentUser;
                await dataManager.Insert(data);

                MessageBox.Show("Data Inserted");

                DataInsertViewModel viewModel = new DataInsertViewModel(currentUser);
            }
            catch (Exception ex)
            {
                this.dataInsertView.txtBoxJson.Text = ex.Message;
            }
        }
コード例 #18
0
        private async void BtnNewMap_Click(object sender, RoutedEventArgs e)
        {
            // Create OpenFileDialog
            Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();

            // Set filter for file extension and default file extension
            dlg.DefaultExt = ".png";
            dlg.Filter     = "JPEG Files (*.jpeg)|*.jpeg|PNG Files (*.png)|*.png|JPG Files (*.jpg)|*.jpg|GIF Files (*.gif)|*.gif";


            // Display OpenFileDialog by calling ShowDialog method
            Nullable <bool> result = dlg.ShowDialog();



            if (result == true)
            {
                // Get the selected file name
                string filename = dlg.FileName;

                // Copy the file to local app directory
                string folderpath = System.IO.Directory.GetParent(Environment.CurrentDirectory).Parent.FullName + "\\Images\\";

                if (!Directory.Exists(folderpath))
                {
                    Directory.CreateDirectory(folderpath);
                }

                string newPath = folderpath + System.IO.Path.GetFileName(filename);
                System.IO.File.Copy(filename, newPath, true);
                filename = newPath;

                // Open dialog to get a name for the file
                string       name;
                DialogWindow inputDialog = new DialogWindow("Please enter a name for your map:", "new map");
                if (inputDialog.ShowDialog() == true)
                {
                    name = inputDialog.Answer;
                }
                else
                {
                    name = "new map" + DateTime.Now.ToString();
                }

                if (name == "new map")
                {
                    name += DateTime.Now.ToString();
                }

                // Save the new Map
                currentMap          = new Map();
                currentMap.FileName = filename;
                currentMap.Name     = name;
                MySQLManager <Map> mapManager = new MySQLManager <Map>();
                await mapManager.Insert(currentMap);

                this.mainAdmin.ListMapUC.AddItem(currentMap);
            }
        }
コード例 #19
0
 private async void BtnOk_Click(object sender, RoutedEventArgs e)
 {
     if (TestValue())
     {
         MySQLManager <StreetNumber> streetNumberManager = new MySQLManager <StreetNumber>();
         await streetNumberManager.Update(this.streetNumberAdmin.ucStreetNumber.StreetNumber);
     }
 }
コード例 #20
0
 public CategoryListViewModel(CategoryListView categoryListView)
 {
     this.categoryListView = categoryListView;
     this.categoryManager = new MySQLManager<Category>(DataConnectionResource.LOCALMYQSL);
     this.categoryListView.AddB.Click += AddB_Click;
     this.categoryListView.EditBtn.Click += EditBtn_Click;
     Load();
 }
コード例 #21
0
 public OrderUserControl()
 {
     InitializeComponent();
     this.DataContext     = this;
     this.orderManager    = new MySQLManager <Order>(DataConnectionResource.LOCALMYQSL);
     this.productManager  = new MySQLManager <Product>(DataConnectionResource.LOCALMYQSL);
     this.orderWebService = new WebServiceManager <Order>(DataConnectionResource.LOCALAPI);
 }
コード例 #22
0
        public StudentViewModel(PageStudent pageStudent)
        {
            this.pageStudent = pageStudent;
            student1         = new MySQLManager <Student>(DataConnectionResource.LOCALMYQSL);

            LoadItems();
            LinkItems();
        }
コード例 #23
0
 public OwnerUserControl()
 {
     InitializeComponent();
     this.DataContext     = this;
     this.ownerWebService = new WebServiceManager <Owner>(DataConnectionResource.LOCALAPI);
     this.ownerManager    = new MySQLManager <Owner>(DataConnectionResource.LOCALMYQSL);
     Load();
 }
コード例 #24
0
        public MusicClassViewModel(PageSchool pageSchool)
        {
            this.pageSchool = pageSchool;
            musicClass1     = new MySQLManager <MusicClass>(DataConnectionResource.LOCALMYQSL);

            LoadItems();
            LinkItems();
        }
コード例 #25
0
 public ProductUserControl()
 {
     InitializeComponent();
     //this.CategoryUserControl.Category = this.product.Category;
     this.DataContext       = this;
     this.productManager    = new MySQLManager <Product>(DataConnectionResource.LOCALMYQSL);
     this.productWebService = new WebServiceManager <Product>(DataConnectionResource.LOCALAPI);
 }
コード例 #26
0
 public static void deleteAllDB()
 {
     if (SelectUserID != 0)
     {
         MySQLManager dddMySQLManager = new MySQLManager();
         bool         boolddd         = dddMySQLManager.ExecuteSqlCmd("update medicaluser set   IsDeleted=1,ModifyTime=now(),ModifyBy='delete' where id=" + SelectUserID);
     }
 }
コード例 #27
0
 public ListStructureUserControl()
 {
     InitializeComponent();
     mySQLManager = new MySQLManager <Structure>();
     Obs          = new ObservableCollection <Structure>();
     this.itemList.ItemsSource = Obs;
     this.ItemsList            = this.itemList;
 }
コード例 #28
0
 public ProductListViewModel(ProductListView productListView)
 {
     this.productListView = productListView;
     this.productListView.SearchProductBtn.Click += SearchProductBtn_Click;
     this.productListView.AddB.Click             += AddB_Click;
     this.productListView.EditBtn.Click          += EditBtn_Click;
     this.categoryManager = new MySQLManager <Category>(DataConnectionResource.LOCALMYQSL);
     this.productListView.CategoryListUserControl.LoadItems(Session.Shop.Id);
 }
コード例 #29
0
 public ChoosePrinterWindowFullHD(String Login)
 {
     InitializeComponent();
     _managers          = Managers.CreateManagers();
     _mysqlManager      = _managers.GetMySQLManager();
     _buttonListManager = _managers.GetButtonListManager();
     _login             = Login;
     txtLabel.Focus();
 }
コード例 #30
0
 public ProductViewModel(ProductView productView, Product product)
 {
     this.productView = productView;
     this.productView.ValidateB.Click += ValidateB_Click;
     this.product = product;
     this.productView.ProductUserControl.Load(product);
     this.productManager    = new MySQLManager <Product>(DataConnectionResource.LOCALMYQSL);
     this.productWebService = new WebServiceManager <Product>(DataConnectionResource.LOCALAPI);
 }
コード例 #31
0
ファイル: GameViewModel.cs プロジェクト: Edrenn/Clickers
        public async void Save()
        {
            MySQLManager <Castle> CastleManager = new MySQLManager <Castle>();
            await CastleManager.Update(MainCastle);

            //await CastleManager.Update(EnnemyCastle);
            //await CastleManager.DbSetT.SqlQuery("UPDATE castles SET Life = " + EnnemyCastle.Life.ToString() + " WHERE Name = \"" + EnnemyCastle.Name + "\";").ToListAsync();
            //await CastleManager.DbSetT.SqlQuery("UPDATE castles SET Life = " + EnnemyCastle.Life.ToString() + " WHERE Id = 2;").ToListAsync();
        }
コード例 #32
0
ファイル: MySQLInventoryTest.cs プロジェクト: kf6kjg/halcyon
 public void Init()
 {
     SuperInit();
     // If we manage to connect to the database with the user
     // and password above it is our test database, and run
     // these tests.  If anything goes wrong, ignore these
     // tests.
     try 
     {
         database = new MySQLManager(connect);
         db = new MySQLInventoryData();
         db.Initialise(connect);
     } 
     catch (Exception e)
     {
         m_log.Error("Exception {0}", e);
         Assert.Ignore();
     }
 }
コード例 #33
0
ファイル: MySQLRegionTest.cs プロジェクト: kf6kjg/halcyon
 private void ClearDB(MySQLManager manager) 
 {
     if (manager != null)
     {
         manager.ExecuteSql("drop table if exists migrations");
         manager.ExecuteSql("drop table if exists prims");
         manager.ExecuteSql("drop table if exists primshapes");
         manager.ExecuteSql("drop table if exists primitems");
         manager.ExecuteSql("drop table if exists terrain");
         manager.ExecuteSql("drop table if exists land");
         manager.ExecuteSql("drop table if exists landaccesslist");
         manager.ExecuteSql("drop table if exists regionban");
         manager.ExecuteSql("drop table if exists regionsettings");
         manager.ExecuteSql("drop table if exists estate_managers");
         manager.ExecuteSql("drop table if exists estate_groups");
         manager.ExecuteSql("drop table if exists estate_users");
         manager.ExecuteSql("drop table if exists estateban");
         manager.ExecuteSql("drop table if exists estate_settings");
         manager.ExecuteSql("drop table if exists estate_map");
     }
 }
コード例 #34
0
ファイル: MySQLRegionTest.cs プロジェクト: kf6kjg/halcyon
        public void Init()
        {
            SuperInit();
            // If we manage to connect to the database with the user
            // and password above it is our test database, and run
            // these tests.  If anything goes wrong, ignore these
            // tests.
            try 
            {
                database = new MySQLManager(connect);
                // this is important in case a previous run ended badly
                ClearDB(database);

                db = new MySQLDataStore();
                db.Initialise(connect);
            } 
            catch (Exception e)
            {
                m_log.Error("Exception {0}", e);
                Assert.Ignore();
            }
        }
コード例 #35
0
ファイル: MySQLEstateTest.cs プロジェクト: kf6kjg/halcyon
        public void Init()
        {
            SuperInit();
            // If we manage to connect to the database with the user
            // and password above it is our test database, and run
            // these tests.  If anything goes wrong, ignore these
            // tests.
            try 
            {
                database = new MySQLManager(connect);
                // clear db incase to ensure we are in a clean state
                ClearDB(database);

                regionDb = new MySQLDataStore();
                regionDb.Initialise(connect);
                db = new MySQLEstateStore();
                db.Initialise(connect);
            } 
            catch (Exception e)
            {
                m_log.Error("Exception {0}", e);
                Assert.Ignore();
            }
        }