Ejemplo n.º 1
0
        private void  制新图书信息_Load(object sender, EventArgs e)
        {
            try
            {
                if (bookid <= 0)
                {
                    MessageBox.Show("系统参数异常,请重新选择!");
                    this.Dispose();
                }

                DataTable dt = ygw.GetBookinfoByBookid(bookid.ToString());
                if (dt.Rows.Count != 1)
                {
                    MessageBox.Show("系统参数异常,请重新选择!");
                    this.Dispose();
                }
                else
                {
                    label9.Text   = dt.Rows[0]["name"].ToString();
                    label10.Text  = dt.Rows[0]["author"].ToString();
                    label8.Text   = dt.Rows[0]["press"].ToString();
                    label7.Text   = dt.Rows[0]["isbn"].ToString();
                    textBox1.Text = dt.Rows[0]["price"].ToString();
                }
            }
            catch
            {
                this.Dispose();
            }
        }
Ejemplo n.º 2
0
        public void HandleChoseResult(string bookid)
        {
            DataTable dt = ygw.GetBookinfoByBookid(bookid);
            DataRow   dr = g_dt_n.NewRow();

            dr["bookid"]     = dt.Rows[0]["id"].ToString();
            dr["name"]       = dt.Rows[0]["name"].ToString();
            dr["press"]      = dt.Rows[0]["press"].ToString();
            dr["price"]      = dt.Rows[0]["price"].ToString();
            dr["type"]       = "新书";
            dr["count"]      = "1";
            dr["off"]        = "0.8";
            dr["totalprice"] = (Convert.ToDouble(dt.Rows[0]["price"].ToString()) * 0.8).ToString();
            g_dt_n.Rows.Add(dr);
            BindingDataTable();
        }