Beispiel #1
0
        private void Btn_Connection_Click(object sender, EventArgs e)
        {
            if (JudgeLogin())
            {
                if (Drop_DataBase.Text == "暂未连接")
                {
                    MessageBox.Show("请先测试连接,选择目标数据库!");
                    Btn_TestConnect.Focus();
                    return;
                }
                if (checkBox1.Checked)
                    SaveSettings();
                else
                    DeleteSettings();
                Config.DataBase = Drop_DataBase.SelectedValue.ToString();
                Config.Pwd = Tb_Pwd.Text;
                Config.Server = Tb_Server.Text;
                Config.User = Tb_User.Text;
                Config.Conn = CONN;
                this.Visible = false;

                if (rbo_Assembly.Checked)
                {
                    Main_Assembly m = new Main_Assembly();
                    m.Show();
                }
                else if (rbo_WCF_Restful.Checked)
                {
                    Main f1 = new Main();
                    f1.Show();
                }
            }
        }
Beispiel #2
0
 public Sim(Main main)
 {
     _Main = main;
     _Min = Convert.ToInt32(main.tb_drop.Text);
     _Max = Convert.ToInt32(main.tb_win.Text);
     _Step = Convert.ToInt32(main.tb_min.Text);
     _Adv = Convert.ToDouble(main.tb_ha.Text);
     _Start = Convert.ToInt32(main.tb_start.Text);
 }
Beispiel #3
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            string args = System.Environment.CommandLine;
            Main m = new Main();
            Parse p = new Parse(args);
            m.URL = p.ImageURL;
            if (m.URL != null) {
                Application.Run(m);
            } else {
                MessageBox.Show("Not found: " + args);
            }
        }
        private void btnlogin_Click(object sender, EventArgs e)
        {
            /*MySqlConnection con = new MySqlConnection(@"Server=192.168.0.24;Database=inventory_items;Uid=tina;Pwd=!ojt2015;");
            MySqlDataAdapter sda = new MySqlDataAdapter("Select acct_type from users where uname  ='"+textBox1.Text+"' and pword ='"+txtpword.Text+"'", con);
            DataTable dt = new System.Data.DataTable();
            sda.Fill(dt);
            if(dt.Rows.Count ==1)
            {

            }
            else
            {

            }*/

            this.Hide();
            Main main = new Main();
            main.Show();
        }
        public UpravaPostavyDialog(Main nparent, String njmeno, String nrasa, String npohlavi, String npovolani, String druzina)
        {
            InitializeComponent();
            parent = nparent;
            this.database = Program.getDB();

            this.druzina = druzina;

            //pridani controls do array
            captionL[0] = (Label)this.Controls.Find("SilL", true)[0];
            captionL[1] = (Label)this.Controls.Find("ObrL", true)[0];
            captionL[2] = (Label)this.Controls.Find("ZrcL", true)[0];
            captionL[3] = (Label)this.Controls.Find("VolL", true)[0];
            captionL[4] = (Label)this.Controls.Find("IntL", true)[0];
            captionL[5] = (Label)this.Controls.Find("ChrL", true)[0];
            vlastnostL[0] = (Label)this.Controls.Find("Sil", true)[0];
            vlastnostL[1] = (Label)this.Controls.Find("Obr", true)[0];
            vlastnostL[2] = (Label)this.Controls.Find("Zrc", true)[0];
            vlastnostL[3] = (Label)this.Controls.Find("Vol", true)[0];
            vlastnostL[4] = (Label)this.Controls.Find("Int", true)[0];
            vlastnostL[5] = (Label)this.Controls.Find("Chr", true)[0];
            zbyvaL[0] = (Label)this.Controls.Find("zSilL", true)[0];
            zbyvaL[1] = (Label)this.Controls.Find("zObrL", true)[0];
            zbyvaL[2] = (Label)this.Controls.Find("zZrcL", true)[0];
            zbyvaL[3] = (Label)this.Controls.Find("zVolL", true)[0];
            zbyvaL[4] = (Label)this.Controls.Find("zIntL", true)[0];
            zbyvaL[5] = (Label)this.Controls.Find("zChrL", true)[0];

            //kontrola "mužství", jinak opravy za pohlavi
            if (npohlavi == "Muž")
            {
                opravyPohlaviCh.Checked = false;
                opravyPohlaviCh.Enabled = false;
            }
            else
            {
                opravyPohlaviCh.Checked = true;
                opravyPohlaviCh.Enabled = true;
            }
            //inicializace
            jmenoPos.Text = njmeno;
            rasaPos.Text = nrasa;
            pohlaviPos.Text = npohlavi;
            povolaniPos.Text = npovolani;

            //konstituce postavy
            konstituce[0] = (int)Program.getRasyCell(nrasa, "vel");
            konstituce[1] = (int)Program.getRasyCell(nrasa, "hmt");
            konstituce[2] = (int)Program.getRasyCell(nrasa, "vyska");

            pKonstituce[0] = konstituce[0];
            pKonstituce[1] = konstituce[1];
            pKonstituce[2] = konstituce[2];

            vyskaN.Maximum = pKonstituce[2] + 15;
            vyskaN.Minimum = pKonstituce[2] - 15;
            vyskaN.Value = pKonstituce[2];

            //určení názvů (zkratek) vlastnosti
            nazvy[0] = "Sil";
            nazvy[1] = "Obr";
            nazvy[2] = "Zrč";
            nazvy[3] = "Vol";
            nazvy[4] = "Int";
            nazvy[5] = "Chr";

            // 3 body ke kazde vlastnosti
            for (int i = 0; i < 6; i++)
            {
                zbyva[i] = 3;
            }
            //zakladni vlastnosti podle rasy
            for (int i = 0, j = 2; i < 6; i++, j++)
            {
                vlastnosti[i] = int.Parse(Program.getRasyCell(nrasa, j).ToString());
            }
            //oprava podle pohlavi
            if (npohlavi == "Žena")
            {
                for (int i = 0, j = 22; i < 6; i++, j++)
                {
                    vlastnosti[i] += opravyPohlavi[i] = int.Parse(Program.getRasyCell(nrasa, j).ToString());
                }
            }
            //hlavni vlastnosti podle povolani
            vlast1 = Program.getPovolaniCell(npovolani, "vlast1").ToString();
            vlast2 = Program.getPovolaniCell(npovolani, "vlast2").ToString();
            for (int i = 0; i < 6; i++)
            {
                if (vlast1 == nazvy[i])
                {
                    vlastnosti[i]++;
                    zbyva[i]--;
                    captionL[i].Font = new Font(captionL[i].Font, FontStyle.Bold);
                }
                if (vlast2 == nazvy[i])
                {
                    vlastnosti[i]++;
                    zbyva[i]--;
                    captionL[i].Font = new Font(captionL[i].Font, FontStyle.Bold);
                }

                // minima/maxima
                min[i] = vlastnosti[i];
                max[i] = zbyva[i] + vlastnosti[i];
                pmin[i] = vlastnosti[i];
                pmax[i] = zbyva[i] + vlastnosti[i];
            }

            hracR.Checked = true;
            nahodneB.Visible = false;
            kombinaceR.Checked = true;

            nahazeno = false;

            setVlastnosti();
        }