zoukankan      html  css  js  c++  java
  • 添加代码

    string xinghao = this.txtxinghao.Text.Trim();
    string chichun = this.txtchichun.Text.Trim();
    string kuanshi = this.txtkuanshi.Text.Trim();
    int jiage = Convert.ToInt32(this.txtjiage.Text.Trim());
    int pinpai = Convert.ToInt32(this.cbopinpai.SelectedIndex);
    int zhongliang = Convert.ToInt32(this.txtzhongliang.Text.Trim());
    SqlConnection conn = new SqlConnection(DBHelpercs.CONNECTION_STRING);
    conn.Open();
    string sql = string.Format("INSERT INTO MobileInfo(BrandID,Type,price,size,Weight ,Style) VALUES ('{0}','{1}','{2}','{3}','{4}','{5}')", pinpai, xinghao, jiage, chichun, zhongliang, kuanshi);
    SqlCommand comd = new SqlCommand(sql, conn);
    int count = Convert.ToInt32(comd.ExecuteNonQuery());
    if (count > 0)
    {
    MessageBox.Show("添加成功!");
    }
    else
    {
    MessageBox.Show("添加失败!");
    }
    }


    如果考到复选框的话
    string a = "";
    if (this.rbtnJinKa.Checked)
    {
    a = "金卡";
    }
    else if (this.rbtnBoJinKa.Checked)
    {
    a = "铂金卡";
    }
    else
    {
    a = "钻石卡";
    }

    更改选中卡别的时候
    private void CardType_CheckedChanged(object sender, EventArgs e)
    {
    if (this.rbtnJinKa.Checked)
    {
    this.txtScore.Text = "500";
    }
    else if (this.rbtnBoJinKa.Checked)
    {
    this.txtScore.Text = "2000";
    }
    else
    {
    this.txtScore.Text = "5000";
    }
    }

  • 相关阅读:
    WebRTC相关技术预研总结
    What is "jar.mn"?
    (FFOS Gecko & Gaia) OTA
    (FFOS Gecko & Gaia) OTA
    (FFOS Gecko & Gaia) OTA
    (FFOS Gecko & Gaia) OTA
    (FFOS Gecko & Gaia) OTA
    (FFOS Gecko & Gaia) OTA
    (FFOS Gecko & Gaia) OTA
    EF实体框架 5 性能注意事项
  • 原文地址:https://www.cnblogs.com/wangyuxin123/p/7883290.html
Copyright © 2011-2022 走看看