Exemplo n.º 1
0
 static public int Add(LoaiChiPhi item)
 {
     dbControl = new QlShop();
     dbControl.LoaiChiPhis.Add(item);
     dbControl.SaveChanges();
     return(item.LoaiChiPhiID);
 }
Exemplo n.º 2
0
        static public void Del(int intLoaiChiPhiID)
        {
            dbControl = new QlShop();
            LoaiChiPhi DelItem = dbControl.LoaiChiPhis.SingleOrDefault(p => p.LoaiChiPhiID == intLoaiChiPhiID);

            if (DelItem != null)
            {
                dbControl.LoaiChiPhis.Remove(DelItem);
                dbControl.SaveChanges();
            }
        }
Exemplo n.º 3
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            if (txtTenLoaiChiPhi.Text == string.Empty)
            {
                MessageBox.Show("Phải nhập tên loại chi phí");
                return;
            }
            LoaiChiPhi item = new LoaiChiPhi();

            item.TenLoaiChiPhi = txtTenLoaiChiPhi.Text;
            LoaiChiPhiController.Add(item);
            txtTenLoaiChiPhi.Text   = string.Empty;
            gridControl1.DataSource = LoaiChiPhiController.GetAllList();
            //DialogResult = System.Windows.Forms.DialogResult.OK;
        }