private void buttonInBaoHanh_Click(object sender, EventArgs e)
 {
     if (bh.Add(LayThongTinBaoHanh()) > 0)
     {
         MessageBox.Show("Thêm thành công"); //Mở bản in
     }
 }
예제 #2
0
        private void Them_Sua(string ChucNang)
        {
            if (!CheckDate())
            {
                return;
            }
            Prices price = new Prices();

            price.ID        = int.Parse(this.txt_ID.Text);
            price.ProductID = this.ProductId;
            price.Price     = float.Parse(this.txt_GiaTien.Text);
            price.DateStart = this.dtp_NgayBatDau.Value;
            price.DateEnd   = this.dtp_NgayKetThuc.Value;
            try
            {
                switch (ChucNang)
                {
                case "Them":
                    objPrice.Add(price);
                    break;

                case "Sua":
                    objPrice.Update(price);
                    break;
                }
                MessageBox.Show("Thành công , dữ liệu đã thay đổi");
                btn_LoadLai.PerformClick();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Lỗi đã sảy ra , vui lòng kiểm tra lại hoặc liên hệ kỹ thuật viên với mô tả lỗi dưới đây \n " + ex.Message, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void btnThemBan_Click(object sender, EventArgs e)
        {
            int soNguoi = 0;

            try
            {
                soNguoi = int.Parse(maskedTextBox_SoNguoi.Text);
            }
            catch
            {
            }
            frm_FormPhu_NhapSo f = new frm_FormPhu_NhapSo();

            f.ShowDialog();
            int SoBan = f.Number;

            if (SoBan <= 0)
            {
                return;
            }
            if (TimBanCoTrongHeThong(SoBan) == null)
            {
                Tables tempTable = new Tables(1, SoBan, this.txt_ViTriBan.Text, soNguoi);
                IDBanDangChon = Tables.AddWithOutput(tempTable);
                Orders tempOrder = new Orders(IDBanDangChon, this.txt_NhanVienOrder.Text, DateTime.Now, 0, 0, 0, 0);
                objOrder.Add(tempOrder);
                LoadDSBan();
                IDOrderDangChon = Orders.GetOrderByTableID(IDBanDangChon)[0].OrderID;
            }
            else
            {
                MessageBox.Show("Bàn này đã tồn tại trong hệ thống", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            this.lblSoBan.Text = SoBan.ToString();
        }
예제 #4
0
 private void buttonThemHH_Click_1(object sender, EventArgs e)
 {
     try
     {
         if (labelTinhNang.Text == "Chưa nhập tính năng")
         {
             MessageBox.Show("Chưa nhập tính năng");
         }
         else
         {
             if (maskedTextBoxMaHH.Text == "")
             {
                 if (hh.Add(Thongtinhanghoa()) > 0)
                 {
                     MessageBox.Show("Thêm thành công");
                     LoadDataHangHoa();
                 }
                 else
                 {
                     MessageBox.Show("Thêm không thành công");
                 }
             }
             else
             {
                 MessageBox.Show("Thêm không thành công");
             }
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Thêm không thành công");
     }
 }
예제 #5
0
        private void btnThem_Click(object sender, EventArgs e)
        {
            // Tạo mã bệnh án
            BenhAn b = new BenhAn();

            b = a.GetLastID();
            long s = -1;

            if (b != null)
            {
                s = long.Parse(b.MaBenhAn.Substring(2));
            }
            s++;
            string kq = "BA" + s;

            while (kq.Length < 13)
            {
                kq = kq.Insert(2, "0");
            }
            //-----------------------------------------
            BenhAn ba = GetFormBenhAn();

            ba.MaBenhAn = kq;
            a.Add(ba);
            LoadGridView();
        }
예제 #6
0
        //button Tạo hóa đơn
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            this.btnKedon.Enabled     = true;
            this.btnDichvu.Enabled    = true;
            this.btnTaohoadon.Enabled = false;
            HoaDon h = new HoaDon();

            h.LoaiHoaDon    = true;
            h.TenKhachHang  = txtHoten.Text;
            h.TenNhaCungCap = "Phòng khám ABC";
            h.MaKhachHang   = txtMabenhan.Text;
            //Tạo mã hóa đơn
            HoaDon b = new HoaDon();

            b = hd.GetLastID();
            long s = -1;

            if (b != null)
            {
                s = long.Parse(b.MaHoaDon.Substring(2));
            }
            s++;
            string kq = "HD" + s;

            while (kq.Length < 13)
            {
                kq = kq.Insert(2, "0");
            }
            //-----------------------------------------------------
            h.MaHoaDon    = kq;
            this.MaHoaDon = kq;
            hd.Add(h);
        }
예제 #7
0
        private void btnThemmoi_Click(object sender, EventArgs e)
        {
            BenhNhan bn = new BenhNhan();

            bn = GetBenhNhanForm();
            BenhNhan b = new BenhNhan();

            b = t.GetLastID();
            long s = -1;

            if (b != null)
            {
                s = long.Parse(b.MaBenhNhan.Substring(2));
            }
            s++;
            string kq = "BN" + s;

            while (kq.Length < 13)
            {
                kq = kq.Insert(2, "0");
            }
            bn.MaBenhNhan = kq;
            t.Add(bn);
            gridcontrol1.DataSource = t.SelectAll();
        }
예제 #8
0
 public bool Insert(BIENLAI BienLai)
 {
     if (baseFunctions.Add(BienLai) > 0)
     {
         return(true);
     }
     return(false);
 }
예제 #9
0
 public bool Insert(CT_KHOAHOC CT_KhoaHoc)
 {
     if (baseFunctions.Add(CT_KhoaHoc) > 0)
     {
         return(true);
     }
     return(false);
 }
예제 #10
0
 public bool Insert(KETQUAHOC KETQUAHOC)
 {
     if (baseFunctions.Add(KETQUAHOC) > 0)
     {
         return(true);
     }
     return(false);
 }
예제 #11
0
 public bool Insert(LICHTHI LICHTHI)
 {
     if (baseFunctions.Add(LICHTHI) > 0)
     {
         return(true);
     }
     return(false);
 }
예제 #12
0
 public bool Insert(GIANGVIEN GiangVien)
 {
     if (baseFunctions.Add(GiangVien) > 0)
     {
         return(true);
     }
     return(false);
 }
예제 #13
0
 public bool Insert(KETQUADANGKY KETQUADANGKY)
 {
     if (baseFunctions.Add(KETQUADANGKY) > 0)
     {
         return(true);
     }
     return(false);
 }
예제 #14
0
 public bool Insert(HOCVIEN HOCVIEN)
 {
     if (baseFunctions.Add(HOCVIEN) > 0)
     {
         return(true);
     }
     return(false);
 }
예제 #15
0
 public bool Insert(TAINGUYEN TAINGUYEN)
 {
     if (baseFunctions.Add(TAINGUYEN) > 0)
     {
         return(true);
     }
     return(false);
 }
예제 #16
0
 private void buttonThem_Click(object sender, EventArgs e)
 {
     if (nd.Add(LayThongTinControl()) > 0)
     {
         MessageBox.Show("Thêm thành công!");
         HienThiDuLieu();
     }
     MessageBox.Show("Thêm thất bại!");
 }
예제 #17
0
파일: Form1.cs 프로젝트: phuonglaanh/QLDT
 private void buttonThemHH_Click(object sender, EventArgs e)
 {
     if (hh.Add(Thongtinhanghoa()) > 0)
     {
         MessageBox.Show("Add sucessful");
         LoadDataHangHoa();
     }
     else
     {
         MessageBox.Show("Add unsucessful");
     }
 }
예제 #18
0
 private void btnThem_Click(object sender, EventArgs e)
 {
     try
     {
         gt.Add(GetFormGiaThuoc());
         LoadGiaThuoc();
     }
     catch (Exception)
     {
         XtraMessageBox.Show("Cập nhật giá không thành công");
     }
 }
예제 #19
0
파일: Form1.cs 프로젝트: phuonglaanh/QLDT
 private void buttonThemKH_Click(object sender, EventArgs e)
 {
     if (kh.Add(GetInformation()) > 0)
     {
         MessageBox.Show("Add sucessful");
         LoadDataKhachHang();
         ResetKhachHang();
     }
     else
     {
         MessageBox.Show("Add unsucessful");
     }
 }
예제 #20
0
 private void buttonThanhToanNhapHang_Click(object sender, EventArgs e)
 {
     if (maskedTextBoxMaPhieuNhap.Text.Length == 0)
     {
         MessageBox.Show("Chưa tạo phiếu nhập");
     }
     else
     {
         for (int i = 0; i < dataGridViewThongTinHoaDonNhapHang.Rows.Count - 1; i++)
         {
             ChiTietNhapHang a = new ChiTietNhapHang(int.Parse(maskedTextBoxMaPhieuNhap.Text), int.Parse(dataGridViewThongTinHoaDonNhapHang.Rows[i].Cells[0].Value.ToString()), int.Parse(dataGridViewThongTinHoaDonNhapHang.Rows[i].Cells[1].Value.ToString()), int.Parse(dataGridViewThongTinHoaDonNhapHang.Rows[i].Cells[2].Value.ToString()), int.Parse(dataGridViewThongTinHoaDonNhapHang.Rows[i].Cells[3].Value.ToString()));
             ctnh.Add(a);
             hh.CapNhatThemSoLuong(int.Parse(dataGridViewThongTinHoaDonNhapHang.Rows[i].Cells[0].Value.ToString()), int.Parse(dataGridViewThongTinHoaDonNhapHang.Rows[i].Cells[1].Value.ToString()));
         }
     }
 }
 private void buttonThanhToan_Click(object sender, EventArgs e)
 {
     if (maskedTextBoxMaHD.Text.Length == 0)
     {
         MessageBox.Show("Chưa tạo hóa đơn", "Thông báo");
     }
     else
     {
         for (int i = 0; i < dataGridViewHoaDon.Rows.Count - 1; i++)
         {
             ChiTietHoaDon a = new ChiTietHoaDon(int.Parse(maskedTextBoxMaHD.Text),
                                                 int.Parse(dataGridViewHoaDon.Rows[i].Cells[0].Value.ToString()), int.Parse(dataGridViewHoaDon.Rows[i].Cells[2].Value.ToString()), int.Parse(dataGridViewHoaDon.Rows[i].Cells[4].Value.ToString()));
             cthd.Add(a);
             hh.CapNhatSoLuongHH(int.Parse(dataGridViewHoaDon.Rows[i].Cells[0].Value.ToString()), int.Parse(dataGridViewHoaDon.Rows[i].Cells[2].Value.ToString()));
         }
     }
 }
예제 #22
0
        private void btnThem_Click(object sender, EventArgs e)
        {
            List <ChiTietHoaDonDichVu> ds = ctdv.SelectBy(int.Parse(txtMadichvu.Text), "MaDichVu");
            ChiTietHoaDonDichVu        d  = (ds.Count > 0) ? ds[0] : null;
            ChiTietHoaDonDichVu        a  = GetFormChiTietHoaDonDichVu();

            if (d != null)
            {
                a.SoLan = a.SoLan + d.SoLan;
                ctdv.Update(a);
            }
            else
            {
                ctdv.Add(a);
            }
            LoadChiTietDichVu();
        }
        private void btnThem_Click(object sender, EventArgs e)
        {
            List <ChiTietHoaDonThuoc> ds = thdetail.SelectBy(txtMathuoc.Text, "MaThuoc");
            ChiTietHoaDonThuoc        t  = (ds.Count > 0) ? ds[0] : null;
            ChiTietHoaDonThuoc        a  = Getformctthuoc();

            if (t != null)
            {
                a.SoLuong = a.SoLuong + t.SoLuong;
                thdetail.Update(a);
            }
            else
            {
                thdetail.Add(a);
            }
            LoadChiTietThuoc();
        }
예제 #24
0
 private void buttonThemNV_Click(object sender, EventArgs e)
 {
     if (maskedTextBoxMaNV.Text == "")
     {
         if (nv.Add(LayThongTinNhanVien()) > 0)
         {
             MessageBox.Show("Thêm thành công");
             LoadDataNhanVien();
         }
         else
         {
             MessageBox.Show("Thêm không thành công");
         }
     }
     else
     {
         MessageBox.Show("Thêm không thành công");
     }
 }
예제 #25
0
        private void Them_Xoa_Sua(string ChucNang)
        {
            Categories cat = new Categories();

            try
            {
                cat.CatID = int.Parse(this.txtID.Text);
            }
            catch (Exception)
            {
                cat.CatID = 1;
            }
            cat.Name        = this.txtTenLM.Text;
            cat.Descreption = this.txtGhiChuLM.Text;

            try
            {
                switch (ChucNang)
                {
                case "Them":
                    objCat.Add(cat);
                    break;

                case "Xoa":
                    objCat.Delete(cat.CatID);
                    break;

                case "Sua":
                    objCat.Update(cat);
                    break;
                }

                MessageBox.Show("Thành công , dữ liệu đã thay đổi ");
                LoadDS(objCat.SelectAll());
                EnableEditButton(false);
                this.btXoaTrang.PerformClick();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Lỗi");
            }
        }
 private void buttonThembg_Click(object sender, EventArgs e)
 {
     if (maskedTextBoxSoBG.Text.Length == 0)
     {
         if (bg.Add(GetInformation()) > 0)
         {
             MessageBox.Show("Thêm thành công");
             LoadDataBangGia();
             ResetBangGia();
         }
         else
         {
             MessageBox.Show("Thêm không thành công");
         }
     }
     else
     {
         MessageBox.Show("Thêm không thành công");
     }
 }
 private void buttonThemKH_Click(object sender, EventArgs e)
 {
     if (maskedTextBoxMaKH.Text.Length == 0)
     {
         if (kh.Add(GetInformation()) > 0)
         {
             MessageBox.Show("Thêm thành công");
             LoadDataKhachHang();
             ResetKhachHang();
         }
         else
         {
             MessageBox.Show("Thêm không thành công");
         }
     }
     else
     {
         MessageBox.Show("Thêm không thành công");
     }
 }
        private void btn_ThemMon_Click(object sender, EventArgs e)
        {
            frm_FormPhu_NhapSo f = new frm_FormPhu_NhapSo();

            f.ShowDialog();

            if (f.Number <= 0)
            {
                MessageBox.Show("Dữ liệu vừa nhập không hợp lệ", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (this.listView_Products.Items.Count != 0 && this.listView_Products.SelectedItems.Count != 0)
            {
                int   productID = int.Parse(this.listView_Products.SelectedItems[0].SubItems[3].Text);
                float Price     = Prices.GetPriceByDateAndProductID(DateTime.Now, productID);
                IDOrderDangChon = Orders.GetOrderByTableID(IDBanDangChon)[0].OrderID;
                OrderDetails tempOrderDeTail = new OrderDetails(IDOrderDangChon, productID, Price, f.Number, 0);
                objOrderDetail.Add(tempOrderDeTail);
                LoadListView_CacMonDaChon();
                LoadDSBan();
            }
        }
 private void btnThem_Click(object sender, EventArgs e)
 {
     gdv.Add(GetForm());
     LoadTable();
 }
예제 #30
0
 private void btnThem_Click(object sender, EventArgs e)
 {
     nv.Add(GetForm());
     LoadFormNhanVien();
 }