Ejemplo n.º 1
0
        //****************************************************************************************************
        //显示数据
        private void showData()
        {
            DataTable dt = new ModCardType().setWhere("id > 0", true).getSelect();

            if (dt == null)
            {
                btnUpdate.Enabled = false;
            }
            else
            {
                btnUpdate.Enabled = true;

                int intIndex = 0;
                if (grd.Rows.Count > 0)
                {
                    intIndex = grd.CurrentRow.Index;
                }

                grd.AutoGenerateColumns = false;
                grd.DataSource          = dt;
                grd.Rows[intIndex].Cells[1].Selected = true;
            }
        }
Ejemplo n.º 2
0
        //****************************************************************************************************
        //加载
        private void FrmCardTypeEdit_Load(object sender, EventArgs e)
        {
            if (intId == 0)
            {
                this.Text = "添加" + this.Text;
            }
            else
            {
                this.Text = "修改" + this.Text;

                DataRow dr = new ModCardType().setWhere("id > 0", true).getFind(intId);
                if (dr == null)
                {
                    Function.showMessage("记录为空");
                    this.Close();
                }
                else
                {
                    txtCardType.Text  = dr["cardType"].ToString();
                    chkIsPass.Checked = Convert.ToBoolean(dr["isPass"]);
                }
            }
        }