Esempio n. 1
0
        public int losemoney(string shop_name)//购买物品减少金钱
        {
            SSHOP  shop1      = new SSHOP();
            PERSON person     = new PERSON();
            int    allmoney   = person.Tiqu_person_money();
            int    lose_money = shop1.Tiqu_shop_money(shop_name);

            if (allmoney >= lose_money)
            {
                sql.Open();
                string     lose_money1       = "update person set person_money-=" + lose_money;
                SqlCommand command_losemoney = new SqlCommand(lose_money1, sql);
                try
                {
                    command_losemoney.ExecuteNonQuery();
                }
                catch
                {
                    MessageBox.Show("减少金钱失败");
                }
                finally
                {
                    sql.Close();
                }
                return(1);
            }
            else
            {
                return(0);
            }
        }
Esempio n. 2
0
        private void shop_FormClosing(object sender, FormClosingEventArgs e)
        {
            PERSON pERSON = new PERSON();
            int    xy     = pERSON.Tiqu_person_grade();

            Form1.form1.label1.Text  = "人物属性\r\n名字:红凯 等级 : " + Convert.ToString(xy) + "\r\n血量 : " + Convert.ToString(pERSON.Tiqu_person_hp()) + "\r\n攻击力 : " + Convert.ToString(pERSON.Tiqu_person_wuli()) + "\r\n";
            Form1.form1.label1.Text += "金钱:" + pERSON.Tiqu_person_money();
        }
Esempio n. 3
0
      private void Form1_Load(object sender, EventArgs e)
      {
          Form1 a = new Form1();

          music.PlayMusic();
          label1.BackColor     = Color.Transparent;
          label1.Parent        = pictureBox1;
          progressBar1.Visible = false;
          Image picture1 = Resources.背景;

          pictureBox1.Image = picture1;
          //  pictureBox2.Image = Image.FromFile("剑士.jpg");
          PERSON pERSON = new PERSON();
          int    xy     = pERSON.Tiqu_person_grade();

          label1.Text  = "人物属性\r\n名字:红凯 等级 : " + Convert.ToString(xy) + "\r\n血量 : " + Convert.ToString(pERSON.Tiqu_change_hp()) + "\r\n攻击力 : " + Convert.ToString(pERSON.Tiqu_person_wuli()) + "\r\n";
          label1.Text += "金钱:" + pERSON.Tiqu_person_money();
      }
Esempio n. 4
0
      private void button1_Click_1(object sender, EventArgs e)
      {
          progressBar1.Visible = true;
          progressBar1.Maximum = 10;
          //  progressBar1.Value = 0;
          progressBar1.Minimum = 0;
          for (int i = progressBar1.Minimum; i <= progressBar1.Maximum; i++)
          {
              System.Threading.Thread.Sleep(100);
              progressBar1.Value = i;
              this.Refresh();
          }
          PERSON pERSON = new PERSON();

          pERSON.blood_return();

          int xy = pERSON.Tiqu_person_grade();

          label1.Text  = "人物属性\r\n名字:红凯 等级 : " + Convert.ToString(xy) + "\r\n血量 : " + Convert.ToString(pERSON.Tiqu_person_hp()) + "\r\n攻击力 : " + Convert.ToString(pERSON.Tiqu_person_wuli()) + "\r\n";
          label1.Text += "金钱:" + pERSON.Tiqu_person_money();
          MessageBox.Show("恢复成功", "提示");

          progressBar1.Visible = false;
      }