Exemple #1
0
        private void frmDetail_Load(object sender, EventArgs e)
        {
            AccountDAL adal = new AccountDAL();
            DetailDAL  ddal = new DetailDAL();

            Account acc = adal.GetAccountById(Convert.ToInt32(this.Tag));

            txt_Money.Text  = acc.Money.ToString();
            txt_Remark.Text = acc.Remark;

            if (acc.IsOut == "否")
            {
                cbo_IsOut.Text = "收入";
            }

            grid_detail.DataSource = ddal.GetDetialList(acc.Id);
        }
Exemple #2
0
        private void frmAddAccount_Load(object sender, EventArgs e)
        {
            TypesDAL tdal = new TypesDAL();

            cbo_Type.ValueMember   = "Id";
            cbo_Type.DisplayMember = "Name";
            cbo_Type.DataSource    = tdal.GetAllType();

            if (this.Tag != null)
            {
                AccountDAL adal = new AccountDAL();
                Account    acc  = adal.GetAccountById(Convert.ToInt32(this.Tag));

                cbo_Type.SelectedValue = acc.Type;
                txt_Money.Text         = acc.Money.ToString();
                com_Isout.Text         = acc.IsOut == "是" ? "支出" : "收入";
                date_datetime.Value    = acc.DateTime;

                DetailDAL ddal = new DetailDAL();
                grid_detail.DataSource = ddal.GetDetialList(acc.Id);
            }
        }