コード例 #1
0
ファイル: NHANVIEN.cs プロジェクト: yangqinggui1997/QLBHDT
 private void txtluongcb_Leave(object sender, EventArgs e)
 {
     if (txtluongcb.Text.Trim() != "")
     {
         Int64 a = 0;
         if (!Int64.TryParse(BUS_HDB.ConvertToFloatType(txtluongcb.Text), out a))
         {
             MessageBox.Show("Giá trị phải là số!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
             txtluongcb.Focus();
         }
         else
         {
             if (a < 0)
             {
                 MessageBox.Show("Giá trị hợp lệ phải >= 0!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 txtluongcb.Focus();
                 return;
             }
             else
             {
                 if (a.ToString().Length < 7)
                 {
                     MessageBox.Show("Lương hợp lệ phải >= 1 000 000!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     txtluongcb.Focus();
                     return;
                 }
                 else
                 {
                     txtluongcb.Text = BUS_HDB.FormatNumber(a.ToString());
                     txtluongcb_TextChanged(sender, e);
                 }
             }
         }
     }
 }
コード例 #2
0
ファイル: NHANVIEN.cs プロジェクト: yangqinggui1997/QLBHDT
 private void txthsl_Leave(object sender, EventArgs e)
 {
     if (txthsl.Text.Trim() != "")
     {
         float a = 0;
         if (!float.TryParse(BUS_HDB.ConvertToFloatType(txthsl.Text), out a))
         {
             MessageBox.Show("Giá trị phải là số!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
             txthsl.Focus();
             return;
         }
         else
         {
             if (a < 0.1)
             {
                 MessageBox.Show("Giá trị hợp lệ phải >= 0.1!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 txthsl.Focus();
                 return;
             }
             else
             {
                 txthsl.Text = BUS_HDB.FormatNumber(a.ToString());
                 txthsl_TextChanged(sender, e);
             }
         }
     }
 }
コード例 #3
0
ファイル: SANPHAM.cs プロジェクト: yangqinggui1997/QLBHDT
 private void txtDonGiaBanSi_Leave(object sender, EventArgs e)
 {
     if (txtdongiabansi.Text != "")
     {
         Int64 a = 0;
         if (!Int64.TryParse(BUS_HDB.ConvertToFloatType(txtdongiabansi.Text), out a))
         {
             MessageBox.Show("Giá trị phải là số!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
             txtdongiabansi.Focus();
         }
         else
         {
             if (a < 0)
             {
                 MessageBox.Show("Giá trị hợp lệ phải >= 0 !", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 txtdongiabansi.Focus();
             }
             else
             {
                 if (txtDonGiaNhap.Text != "")
                 {
                     if (a <= Int64.Parse(BUS_HDB.ConvertToFloatType(txtDonGiaNhap.Text)))
                     {
                         MessageBox.Show("Đơn giá bán không được bé hơn hoặc bằng đơn giá nhập!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                         txtdongiabansi.Focus();
                         return;
                     }
                     else
                     {
                         txtdongiabansi.Text = BUS_HDB.FormatNumber(a.ToString());
                     }
                 }
                 else
                 {
                     txtdongiabansi.Text = BUS_HDB.FormatNumber(a.ToString());
                 }
                 if (txtDonGiaBanLe.Text != "")
                 {
                     if (a >= Int64.Parse(BUS_HDB.ConvertToFloatType(txtDonGiaBanLe.Text)))
                     {
                         MessageBox.Show("Đơn giá bán sỉ không được lớn hơn hoặc bằng đơn giá bán lẻ!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                         txtdongiabansi.Focus();
                         return;
                     }
                     else
                     {
                         txtdongiabansi.Text = BUS_HDB.FormatNumber(a.ToString());
                     }
                 }
                 else
                 {
                     txtdongiabansi.Text = BUS_HDB.FormatNumber(a.ToString());
                 }
             }
         }
     }
 }
コード例 #4
0
ファイル: SANPHAM.cs プロジェクト: yangqinggui1997/QLBHDT
        private void DataGridView_Click(object sender, EventArgs e)
        {
            if (DGVSanPham.Rows.Count == 0)
            {
                MessageBox.Show("Không có dữ liệu!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (DGVSanPham.CurrentRow.Index == DGVSanPham.NewRowIndex)
            {
                MessageBox.Show("Hãy chọn dòng có thông tin!", "Cảnh Báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            txtMaSanPham.Text   = DGVSanPham.CurrentRow.Cells["IdSP"].Value.ToString();
            txtTenSanPham.Text  = DGVSanPham.CurrentRow.Cells["TenSP"].Value.ToString();
            cbMaNCU.Text        = DGVSanPham.CurrentRow.Cells["IdNCU"].Value.ToString();
            dtpNgaySX.Text      = DGVSanPham.CurrentRow.Cells["NgaySX"].Value.ToString();
            dtpngayhh.Text      = DGVSanPham.CurrentRow.Cells["NgayHH"].Value.ToString();
            dtpngaynhap.Text    = DGVSanPham.CurrentRow.Cells["NgayNhap"].Value.ToString();
            txtDonGiaBanLe.Text = BUS_HDB.FormatNumber(DGVSanPham.CurrentRow.Cells["DonGiaBanLe"].Value.ToString());

            txtnhasx.Text = DGVSanPham.CurrentRow.Cells["NhaSX"].Value.ToString();

            txtSoLuongNhap.Text = BUS_HDB.FormatNumber(DGVSanPham.CurrentRow.Cells["SLNhap"].Value.ToString());

            txtDonGiaNhap.Text = BUS_HDB.FormatNumber(DGVSanPham.CurrentRow.Cells["DonGiaNhap"].Value.ToString());

            txtdongiabansi.Text = BUS_HDB.FormatNumber(DGVSanPham.CurrentRow.Cells["DonGiaBanSi"].Value.ToString());

            txtdonvi.Text          = DGVSanPham.CurrentRow.Cells["Donvi"].Value.ToString();
            txtdonvi.ForeColor     = Color.Black;
            txtgiamgia.Text        = DGVSanPham.CurrentRow.Cells["GiamGia"].Value.ToString();
            richtxtAnhSanPham.Text = DGVSanPham.CurrentRow.Cells["AnhSP"].Value.ToString();

            if (!File.Exists(richtxtAnhSanPham.Text) && !Directory.Exists(richtxtAnhSanPham.Text))
            {
                picAnh.Image = null;
                MessageBox.Show("Hình ảnh không tồn tại do file bị xóa hoặc dường dẫn không đúng!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                txtTenSanPham.Focus();
                return;
            }
            else
            {
                picAnh.Image = Image.FromFile(richtxtAnhSanPham.Text);
            }
        }
コード例 #5
0
ファイル: NHANVIEN.cs プロジェクト: yangqinggui1997/QLBHDT
 private void txthsl_TextChanged(object sender, EventArgs e)
 {
     if (txthsl.Text.Trim().Length > 0 && txtluongcb.Text.Length > 0)
     {
         float a = 0;
         if (!float.TryParse(BUS_HDB.ConvertToFloatType(txthsl.Text), out a))
         {
             txtthuclinh.Text = string.Empty;
         }
         else
         {
             txtthuclinh.Text = Math.Round((Int64.Parse(BUS_HDB.ConvertToFloatType(txtluongcb.Text)) * a)).ToString();
             txtthuclinh.Text = BUS_HDB.FormatNumber(txtthuclinh.Text);
         }
     }
     else
     {
         txtthuclinh.Text = string.Empty;
     }
 }
コード例 #6
0
ファイル: SANPHAM.cs プロジェクト: yangqinggui1997/QLBHDT
 private void txtSoLuongNhap_Leave(object sender, EventArgs e)
 {
     if (txtSoLuongNhap.Text != "")
     {
         Int64 a = 0;
         if (!Int64.TryParse(BUS_HDB.ConvertToFloatType(txtSoLuongNhap.Text), out a))
         {
             MessageBox.Show("Giá trị phải là số!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
             txtSoLuongNhap.Focus();
         }
         else
         {
             if (a <= 0)
             {
                 MessageBox.Show("Giá trị hợp lệ phải > 0 !", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 txtSoLuongNhap.Focus();
             }
             else
             {
                 txtSoLuongNhap.Text = BUS_HDB.FormatNumber(a.ToString());
             }
         }
     }
 }
コード例 #7
0
ファイル: NHANVIEN.cs プロジェクト: yangqinggui1997/QLBHDT
        private void DGVNhanVien_Click(object sender, EventArgs e)
        {
            if (DGVNhanVien.Rows.Count == 0)
            {
                MessageBox.Show("Không có dữ liệu!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (DGVNhanVien.CurrentRow.Index == DGVNhanVien.NewRowIndex)
            {
                MessageBox.Show("Hãy chọn dòng có thông tin!", "Cảnh Báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            dgvnvclick         = true;
            txtMaNhanVien.Text = DGVNhanVien.CurrentRow.Cells["IdNV"].Value.ToString();
            if (txtMaNhanVien.Text.Substring(0, 3) == "NQT")
            {
                rdbquantri.Checked = true;
                rdbketoan.Checked  = false;
                rdbbanhang.Checked = false;
                rdbthukho.Checked  = false;
            }
            if (txtMaNhanVien.Text.Substring(0, 3) == "NKT")
            {
                rdbquantri.Checked = false;
                rdbketoan.Checked  = true;
                rdbbanhang.Checked = false;
                rdbthukho.Checked  = false;
            }
            if (txtMaNhanVien.Text.Substring(0, 3) == "NBH")
            {
                rdbquantri.Checked = false;
                rdbketoan.Checked  = false;
                rdbbanhang.Checked = true;
                rdbthukho.Checked  = false;
            }
            if (txtMaNhanVien.Text.Substring(0, 3) == "NTK")
            {
                rdbquantri.Checked = false;
                rdbketoan.Checked  = false;
                rdbbanhang.Checked = false;
                rdbthukho.Checked  = true;
            }

            txtTenNhanVien.Text = DGVNhanVien.CurrentRow.Cells["TenNV"].Value.ToString();
            if (DGVNhanVien.CurrentRow.Cells["Gioitinh"].Value.ToString() == "Nam")
            {
                chkGioitinh.Checked = true;
            }
            else
            {
                chkGioitinh.Checked = false;
            }
            txtDiaChi.Text    = DGVNhanVien.CurrentRow.Cells["DiaChi"].Value.ToString();
            mskDienthoai.Text = DGVNhanVien.CurrentRow.Cells["SĐT"].Value.ToString();
            dtpNgaySinh.Text  = DGVNhanVien.CurrentRow.Cells["NgaySinh"].Value.ToString();
            txtchucvu.Text    = DGVNhanVien.CurrentRow.Cells["ChucVu"].Value.ToString();
            txtluongcb.Text   = BUS_HDB.FormatNumber(DGVNhanVien.CurrentRow.Cells["LuongCB"].Value.ToString());
            txthsl.Text       = BUS_HDB.FormatNumber(DGVNhanVien.CurrentRow.Cells["hsl"].Value.ToString());
            txtthuclinh.Text  = BUS_HDB.FormatNumber(DGVNhanVien.CurrentRow.Cells["Thuclinh"].Value.ToString());
            txttaikhoan.Text  = DGVNhanVien.CurrentRow.Cells["Taikhoan"].Value.ToString();
        }
コード例 #8
0
        private void txtconnoncu_TextChanged(object sender, EventArgs e)
        {
            string conno = BUS_HDB.ConvertToFloatType(txtconnoncu.Text);

            txtconnoncu.Text = BUS_HDB.FormatNumber(conno);
        }
コード例 #9
0
        private void txtslton_TextChanged(object sender, EventArgs e)
        {
            string cn = BUS_HDB.ConvertToFloatType(txtslton.Text);

            txtslton.Text = BUS_HDB.FormatNumber(cn);
        }
コード例 #10
0
ファイル: DOANHTHU.cs プロジェクト: yangqinggui1997/QLBHDT
        private void txtloinhuan_TextChanged(object sender, EventArgs e)
        {
            string loinhuan = BUS_HDB.ConvertToFloatType(txtloinhuan.Text);

            txtloinhuan.Text = BUS_HDB.FormatNumber(loinhuan);
        }
コード例 #11
0
ファイル: DOANHTHU.cs プロジェクト: yangqinggui1997/QLBHDT
        private void txtdoanhthu_TextChanged(object sender, EventArgs e)
        {
            string doanhthu = BUS_HDB.ConvertToFloatType(txtdoanhthu.Text);

            txtdoanhthu.Text = BUS_HDB.FormatNumber(doanhthu);
        }
コード例 #12
0
ファイル: DOANHTHU.cs プロジェクト: yangqinggui1997/QLBHDT
        private void txtDoanhSoban_TextChanged(object sender, EventArgs e)
        {
            string doanhsoban = BUS_HDB.ConvertToFloatType(txtDoanhSoban.Text);

            txtDoanhSoban.Text = BUS_HDB.FormatNumber(doanhsoban);
        }