private void btnCategory_Click(object sender, EventArgs e)
        {
            frmPubSelectCategory frm = new frmPubSelectCategory();

            if (frm.ShowDialog() == DialogResult.OK)
            {
                txtCategory.Tag  = frm.CategoryID;
                txtCategory.Text = frm.CategoryName;
            }
        }
Exemple #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            frmPubSelectCategory frm = new frmPubSelectCategory();

            if (frm.ShowDialog() == DialogResult.OK)
            {
                string          ID   = frm.CategoryID;
                string          Name = frm.CategoryName;
                DataTableReader dr   = null;
                dr = db.GetDataReader(Pub.GetSQL(DBCode.DB_004003, new string[] { "110", ID }));
                if (dr.Read())
                {
                    cbbCategory.Tag   = ID;
                    cbbCategory.Text  = Name;
                    cbbVarieties.Tag  = dr["ProductsID"].ToString();
                    cbbVarieties.Text = dr["ProductsName"].ToString();
                    cbbMoney.Text     = Convert.ToDouble(dr["ProductsPrice"]).ToString("#0.00");
                }
                else
                {
                    Pub.MessageBoxShow(Pub.GetResText(formCode, "Error07", ""), MessageBoxIcon.Error);;
                }
            }
        }