标签:end dex card rgs jin car price sele info
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";
}
}
标签:end dex card rgs jin car price sele info
原文地址:http://www.cnblogs.com/wangyuxin123/p/7883290.html