コード例 #1
0
ファイル: FrThemkhoanchi.cs プロジェクト: thachgiasoft/test1
        public void LoadLoaiChi()
        {
            SpendSpeciesDAO dt = new SpendSpeciesDAO();

            cbbLoaichi.DataSource    = dt.ListSpendSpecy();
            cbbLoaichi.ValueMember   = "SpendSpeciesID";
            cbbLoaichi.DisplayMember = "Name";
        }
コード例 #2
0
 public void laodCacloaichi()
 {
     try
     {
         SpendSpeciesDAO dt = new SpendSpeciesDAO();
         grcCacLoaiChi.DataSource = dt.ListSpendSpecy();
     }
     catch
     {
     }
 }
コード例 #3
0
        private void btnLuu_Click(object sender, EventArgs e)
        {
            SpendSpeciesDAO dt = new SpendSpeciesDAO();
            SpendSpecy      a  = new SpendSpecy();

            a.Name        = txtTenDanhMuc.Text;
            a.CreatedDate = DateTime.Now;
            a.Note        = txtGhichu.Text;
            if (dt.Insert(a) == true)
            {
                MessageBox.Show("Lưu thành công");
                //btnThoat.PerformClick();
                this.Close();
            }
        }
コード例 #4
0
        private void btnXoa_Click(object sender, EventArgs e)
        {
            SpendSpeciesDAO dt = new SpendSpeciesDAO();

            if (MessageBox.Show("Bạn có muốn xóa danh mục " + SpendSpeciesDAO.spend.Name + "", "Cảnh báo", MessageBoxButtons.YesNo, MessageBoxIcon.Error) == DialogResult.Yes)
            {
                if (dt.Remove(SpendSpeciesDAO.spend) == true)
                {
                    MessageBox.Show("Xóa thành công");
                }
                else
                {
                    MessageBox.Show("Không thể xóa ");
                }
            }
        }
コード例 #5
0
        private void btnLuu_Click(object sender, EventArgs e)
        {
            SpendSpeciesDAO dt = new SpendSpeciesDAO();

            SpendSpeciesDAO.spend.Name = txtTenDanhMuc.Text;
            SpendSpeciesDAO.spend.Note = txtGhichu.Text;
            if (cbTinhtrang.Checked == true)
            {
                SpendSpeciesDAO.spend.Status = true;
            }
            else
            {
                SpendSpeciesDAO.spend.Status = false;
            }
            if (dt.Edit(SpendSpeciesDAO.spend) == true)
            {
                MessageBox.Show("Lưu thành công");
            }
            else
            {
                MessageBox.Show("Lưu không thành công");
            }
            this.Close();
        }