Exemple #1
0
        private void FormKhachHang_Load(object sender, EventArgs e)
        {
            lbl1.BackColor = lbl2.BackColor = Color.FromArgb(39, 174, 96);
            lbl3.BackColor = lbl4.BackColor = Color.FromArgb(39, 174, 96);
            Stelia_BUS.Stelia_BUS bus = new Stelia_BUS.Stelia_BUS();
            DTO_KhachHang[]       KH  = bus.search_KhachHang(MaKH);
            lblHoTen.Text    = KH[0].HOTEN;
            lblDiaChi.Text   = KH[0].DIACHI;
            lblDiemTL.Text   = TranDateFormat.SubString(KH[0].DIEMTL);
            lblGioiTinh.Text = KH[0].GIOITINH;
            lblLoaiThe.Text  = KH[0].LOAIKH;
            lblNgDK.Text     = TranDateFormat.SubString(KH[0].NGDK);
            lblNgSinh.Text   = TranDateFormat.SubString(KH[0].NGSINH);
            lblMaKH.Text     = KH[0].MAKH;
            string ma = MaKH;

            if (System.IO.File.Exists(Application.StartupPath + "/HinhKhachHang/" + ma + ".jpg"))
            {
                picAnh.Image = Image.FromFile(Application.StartupPath + "/HinhKhachHang/" + ma + ".jpg");
            }
            else
            if (System.IO.File.Exists(Application.StartupPath + "/HinhKhachHang/" + ma + ".png"))
            {
                picAnh.Image = Image.FromFile(Application.StartupPath + "/HinhKhachHang/" + ma + ".png");
            }
            else
            {
                picAnh.Image = Image.FromFile(Application.StartupPath + "/HinhKhachHang/None.jpg");
            }

            txtTimKiem.Text = " ";
            txtTimKiem.Text = "";
            XuatThongTinSP(bus.search_SANPHAM("SP001")[0]);
        }
        private void TxtTimKiem_TextChanged(object sender, EventArgs e)
        {
            Stelia_BUS.Stelia_BUS bus = new Stelia_BUS.Stelia_BUS();
            DTO_SanPham[]         SP  = bus.search_SANPHAM(txtTimKiem.Text);

            string ma = SP[0].MASP;

            if (System.IO.File.Exists(Application.StartupPath + "/HinhSanPham/" + ma + ".jpg"))
            {
                picAnhSP.Image = Image.FromFile(Application.StartupPath + "/HinhSanPham/" + ma + ".jpg");
            }
            else
            {
                picAnhSP.Image = Image.FromFile(Application.StartupPath + "/HinhSanPham/" + ma + ".png");
            }

            lblSoLuong.Text = "x" + SP[0].SLUONG;
            lblTenSP.Text   = SP[0].TENSP;
            // MessageBox.Show(SP[0].DONGIA);
            DonGia          = int.Parse(TranDateFormat.SubString(SP[0].DONGIA));
            SoLuong         = int.Parse(TranDateFormat.SubString(SP[0].SLUONG));
            MaSP            = SP[0].MASP;
            txtSoLuong.Text = "";
            lblDonGia.Text  = "0";
        }
        void XuatThongTinSP(DTO_SanPham SP)
        {
            lblTenSP.Text     = SP.TENSP;
            lblMaSP.Text      = SP.MASP;
            lblSoLuong.Text   = TranDateFormat.SubString(SP.SLUONG);
            lblTrangThai.Text = SP.TRANGTHAI;
            lblLoiNhuan.Text  = TranDateFormat.SubString(SP.LOINHUAN);
            lblGiaBan.Text    = TranDateFormat.SubString(SP.DONGIA);
            Stelia_BUS.Stelia_BUS bus = new Stelia_BUS.Stelia_BUS();
            lblNCC.Text = bus.getTenNCC(SP.MANCC);
            string ma = lblMaSP.Text;

            if (System.IO.File.Exists(Application.StartupPath + "/HinhSanPham/" + ma + ".jpg"))
            {
                picAnhSP.Image = Image.FromFile(Application.StartupPath + "/HinhSanPham/" + ma + ".jpg");
            }
            else
            if (System.IO.File.Exists(Application.StartupPath + "/HinhSanPham/" + ma + ".png"))
            {
                picAnhSP.Image = Image.FromFile(Application.StartupPath + "/HinhSanPham/" + ma + ".png");
            }
            else
            {
                picAnhSP.Image = Image.FromFile(Application.StartupPath + "/HinhSanPham/None" + ".png");
            }
        }
Exemple #4
0
        private void PictureBox3_Click(object sender, EventArgs e)
        {
            string       Ngsinh   = TranDateFormat.Trans(dateNgSinh.Text);
            string       NgVaoLam = TranDateFormat.Trans(dateNgVaoLam.Text);
            DTO_NhanVien NV       = new DTO_NhanVien(txtMaNV.Text, txtHoTen.Text, Ngsinh, txtChucVu.Text,
                                                     NgVaoLam, txtGioiTinh.Text, txtLuong.Text, "0", "0");

            string error = CheckThongTin.check_Nhap(NV);

            if (error != "")
            {
                MessageBox.Show(error);
                return;
            }

            Stelia_BUS.Stelia_BUS bus = new Stelia_BUS.Stelia_BUS();
            if (bus.themData(NV) == false)
            {
                MessageBox.Show("Thêm nhân viên không thành công");
                return;
            }
            else
            {
                MessageBox.Show("Bạn đã thêm nhân viên thành công");
            }
            Close();
        }
Exemple #5
0
        private void FormCapNhatKH_Load(object sender, EventArgs e)
        {
            txtMaKH.ReadOnly = true;
            Stelia_BUS.Stelia_BUS bus = new Stelia_BUS.Stelia_BUS();
            DTO_KhachHang[]       KH  = bus.search_KhachHang(MaKH);
            txtHoTen.Text    = KH[0].HOTEN;
            txtLoaiThe.Text  = KH[0].LOAIKH;
            txtGioiTinh.Text = KH[0].GIOITINH;
            txtDiaChi.Text   = KH[0].DIACHI;
            dateNgDK.Text    = TranDateFormat.SubString(KH[0].NGDK);
            dateNgSinh.Text  = TranDateFormat.SubString(KH[0].NGSINH);
            txtMaKH.Text     = KH[0].MAKH;
            DTL = KH[0].DIEMTL;

            string ma = KH[0].MAKH;

            if (System.IO.File.Exists(Application.StartupPath + "/HinhKhachHang/" + ma + ".jpg"))
            {
                picAnh.Image = Image.FromFile(Application.StartupPath + "/HinhKhachHang/" + ma + ".jpg");
            }
            else
            if (System.IO.File.Exists(Application.StartupPath + "/HinhKhachHang/" + ma + ".png"))
            {
                picAnh.Image = Image.FromFile(Application.StartupPath + "/HinhKhachHang/" + ma + ".png");
            }
            else
            {
                picAnh.Image = Image.FromFile(Application.StartupPath + "/HinhKhachHang/" + "None.jpg");
            }
        }
 void TaoTop3NCC()
 {
     Stelia_BUS.Stelia_BUS bus = new Stelia_BUS.Stelia_BUS();
     string[] name             = bus.Top3_NCC();
     lblTop1.Text = TranDateFormat.GetLastName(name[0]);
     lblTop2.Text = TranDateFormat.GetLastName(name[1]);
     lblTop3.Text = TranDateFormat.GetLastName(name[2]);
 }
        private void ShowSelectedRow()
        {
            try
            {
                DataGridViewRow       currow = dataGridView1.SelectedCells[0].OwningRow;
                Stelia_BUS.Stelia_BUS bus    = new Stelia_BUS.Stelia_BUS();
                DTO_NhanVien[]        NV     = bus.search_NhanVien(currow.Cells[0].Value.ToString());
                lblHoTen.Text    = NV[0].HOTEN;
                lblChucVu.Text   = NV[0].CHUCVU;
                lblDoanhThu.Text = TranDateFormat.SubString(NV[0].DOANHTHU);
                lblGioiTinh.Text = NV[0].GIOITINH;
                lblNgSinh.Text   = TranDateFormat.SubString(NV[0].NGSINH);
                lblNgVaoLam.Text = TranDateFormat.SubString(NV[0].NGAYVL);
                lblSoHD.Text     = TranDateFormat.SubString(NV[0].SLHD);
                lblMaNV.Text     = NV[0].MANV;
                lblLuong.Text    = TranDateFormat.SubString(NV[0].LUONG);
                noti.Hide();
            }
            catch (Exception e)
            {
                lblHoTen.Text    = "";
                lblChucVu.Text   = "";
                lblDoanhThu.Text = "";
                lblGioiTinh.Text = "";
                lblNgSinh.Text   = "";
                lblNgVaoLam.Text = "";
                lblSoHD.Text     = "";
                lblMaNV.Text     = "";
                lblLuong.Text    = "";
                noti             = new PushNoti("Error", "Không tìm thấy tên này");
                noti.Width       = this.Width;
                this.Controls.Add(noti);
                noti.Show();
                noti.ShowNoti();
            }
            finally
            {
                DataGridViewRow       currow = dataGridView1.SelectedCells[0].OwningRow;
                Stelia_BUS.Stelia_BUS bus    = new Stelia_BUS.Stelia_BUS();
                DTO_NhanVien[]        NV     = bus.search_NhanVien(currow.Cells[0].Value.ToString());
                string ma = NV[0].MANV;

                if (System.IO.File.Exists(Application.StartupPath + "/HinhNhanVien/" + ma + ".jpg"))
                {
                    picAnh.Image = Image.FromFile(Application.StartupPath + "/HinhNhanVien/" + ma + ".jpg");
                }
                else
                if (System.IO.File.Exists(Application.StartupPath + "/HinhNhanVien/" + ma + ".png"))
                {
                    picAnh.Image = Image.FromFile(Application.StartupPath + "/HinhNhanVien/" + ma + ".png");
                }
                else
                {
                    picAnh.Image = Image.FromFile(Application.StartupPath + "/HinhNhanVien/" + "None.jpg");
                }
            }
        }
Exemple #8
0
        private void FormCapNhatNhanVien_Load(object sender, EventArgs e)
        {
            Stelia_BUS.Stelia_BUS bus      = new Stelia_BUS.Stelia_BUS();
            DTO_NhanVien[]        NV       = bus.search_NhanVien(MaNV);
            DTO_NhanVien          nhanvien = NV[0];

            txtHoTen.Text = nhanvien.HOTEN;
            switch (nhanvien.CHUCVU)
            {
            case "Quản lí":
                comboBoxChucVu.SelectedIndex = 0;
                break;

            case "Quản lí kho":
                comboBoxChucVu.SelectedIndex = 1;
                break;

            case "Quản lí nhân sự":
                comboBoxChucVu.SelectedIndex = 2;
                break;

            case "Thu ngân":
                comboBoxChucVu.SelectedIndex = 3;
                break;

            case "Tạp vụ":
                comboBoxChucVu.SelectedIndex = 4;
                break;

            case "Bảo vệ":
                comboBoxChucVu.SelectedIndex = 5;
                break;
            }

            txtGioiTinh.Text  = nhanvien.GIOITINH;
            txtLuong.Text     = TranDateFormat.SubString(nhanvien.LUONG + "");
            txtMaNV.Text      = MaNV;
            txtMaNV.ReadOnly  = true;
            dateNgSinh.Text   = TranDateFormat.SubString(nhanvien.NGSINH);
            dateNgVaoLam.Text = TranDateFormat.SubString(nhanvien.NGAYVL);
            string ma = nhanvien.MANV;

            if (System.IO.File.Exists(Application.StartupPath + "/HinhNhanVien/" + ma + ".jpg"))
            {
                picAnh.Image = Image.FromFile(Application.StartupPath + "/HinhNhanVien/" + ma + ".jpg");
            }
            else
            if (System.IO.File.Exists(Application.StartupPath + "/HinhNhanVien/" + ma + ".png"))
            {
                picAnh.Image = Image.FromFile(Application.StartupPath + "/HinhNhanVien/" + ma + ".png");
            }
            else
            {
                picAnh.Image = Image.FromFile(Application.StartupPath + "/HinhNhanVien/" + "None.jpg");
            }
        }
Exemple #9
0
 private void ShowSelectedRow()
 {
     try
     {
         DataGridViewRow       currow = dataGridView1.SelectedCells[0].OwningRow;
         Stelia_BUS.Stelia_BUS bus    = new Stelia_BUS.Stelia_BUS();
         DTO_KhachHang[]       KH     = bus.search_KhachHang(currow.Cells[0].Value.ToString());
         lblHoTen.Text    = KH[0].HOTEN;
         lblDiaChi.Text   = KH[0].DIACHI;
         lblDiemTL.Text   = TranDateFormat.SubString(KH[0].DIEMTL);
         lblGioiTinh.Text = KH[0].GIOITINH;
         lblLoaiThe.Text  = KH[0].LOAIKH;
         lblNgDK.Text     = TranDateFormat.SubString(KH[0].NGDK);
         lblNgSinh.Text   = TranDateFormat.SubString(KH[0].NGSINH);
         lblMaKH.Text     = KH[0].MAKH;
         noti.Hide();
     }
     catch (Exception e)
     {
         lblHoTen.Text    = "";
         lblDiaChi.Text   = "";
         lblDiemTL.Text   = "";
         lblGioiTinh.Text = "";
         lblLoaiThe.Text  = "";
         lblNgDK.Text     = "";
         lblNgSinh.Text   = "";
         lblMaKH.Text     = "";
         noti             = new PushNoti("Error", "Không tìm thấy tên này");
         noti.Width       = this.Width;
         this.Controls.Add(noti);
         noti.Show();
         noti.ShowNoti();
     }
     finally
     {
         DataGridViewRow       currow = dataGridView1.SelectedCells[0].OwningRow;
         Stelia_BUS.Stelia_BUS bus    = new Stelia_BUS.Stelia_BUS();
         DTO_KhachHang[]       KH     = bus.search_KhachHang(currow.Cells[0].Value.ToString());
         string ma = KH[0].MAKH;
         if (System.IO.File.Exists(Application.StartupPath + "/HinhKhachHang/" + ma + ".jpg"))
         {
             picAnh.Image = Image.FromFile(Application.StartupPath + "/HinhKhachHang/" + ma + ".jpg");
         }
         else
         if (System.IO.File.Exists(Application.StartupPath + "/HinhKhachHang/" + ma + ".png"))
         {
             picAnh.Image = Image.FromFile(Application.StartupPath + "/HinhKhachHang/" + ma + ".png");
         }
         else
         {
             picAnh.Image = Image.FromFile(Application.StartupPath + "/HinhKhachHang/None.jpg");
         }
     }
 }
        private void KhoiTaoChart()
        {
            DataTable  temp = new Stelia_BUS.Stelia_BUS().getDataTable("NHANVIEN");
            DataColumn col  = new DataColumn("LastName");

            col.DataType = System.Type.GetType("System.String");
            temp.Columns.Add(col);
            foreach (DataRow row in temp.Rows)
            {
                row["LastName"] = TranDateFormat.GetLastName(row[1].ToString());
            }
            chartControl1.DataSource = temp;
        }
Exemple #11
0
 private void FormCapNhatKH_Load(object sender, EventArgs e)
 {
     txtMaKH.ReadOnly = true;
     Stelia_BUS.Stelia_BUS bus = new Stelia_BUS.Stelia_BUS();
     DTO_KhachHang[]       KH  = bus.search_KhachHang(MaKH);
     txtHoTen.Text    = KH[0].HOTEN;
     txtLoaiThe.Text  = KH[0].LOAIKH;
     txtGioiTinh.Text = KH[0].GIOITINH;
     txtDiaChi.Text   = KH[0].DIACHI;
     dateNgDK.Text    = TranDateFormat.SubString(KH[0].NGDK);
     dateNgSinh.Text  = TranDateFormat.SubString(KH[0].NGSINH);
     txtMaKH.Text     = KH[0].MAKH;
     DTL = KH[0].DIEMTL;
 }
Exemple #12
0
        void XuatThongTin()
        {
            Stelia_BUS.Stelia_BUS bus = new Stelia_BUS.Stelia_BUS();
            string makh = bus.getThongTinKH(0, 0);

            DTO_KhachHang[] KH = bus.search_KhachHang(makh);
            lblHoTen.Text    = KH[0].HOTEN;
            lblDiaChi.Text   = KH[0].DIACHI;
            lblDiemTL.Text   = TranDateFormat.SubString(KH[0].DIEMTL);
            lblGioiTinh.Text = KH[0].GIOITINH;
            lblLoaiThe.Text  = KH[0].LOAIKH;
            lblNgDK.Text     = TranDateFormat.SubString(KH[0].NGDK);
            lblNgSinh.Text   = TranDateFormat.SubString(KH[0].NGSINH);
            lblMaKH.Text     = KH[0].MAKH;
        }
        private void FormCapNhatNhanVien_Load(object sender, EventArgs e)
        {
            Stelia_BUS.Stelia_BUS bus      = new Stelia_BUS.Stelia_BUS();
            DTO_NhanVien[]        NV       = bus.search_NhanVien(MaNV);
            DTO_NhanVien          nhanvien = NV[0];

            txtHoTen.Text     = nhanvien.HOTEN;
            txtChucVu.Text    = nhanvien.CHUCVU;
            txtGioiTinh.Text  = nhanvien.GIOITINH;
            txtLuong.Text     = TranDateFormat.SubString(nhanvien.LUONG + "");
            txtMaNV.Text      = MaNV;
            txtMaNV.ReadOnly  = true;
            dateNgSinh.Text   = TranDateFormat.SubString(nhanvien.NGSINH);
            dateNgVaoLam.Text = TranDateFormat.SubString(nhanvien.NGAYVL);
        }
Exemple #14
0
 private void PictureBox18_Click(object sender, EventArgs e)
 {
     Stelia_BUS.Stelia_BUS bus = new Stelia_BUS.Stelia_BUS();
     DTO_NhanVien[]        NV  = bus.search_NhanVien(txtTimKiem.Text);
     if (NV[0].MANV != txtTimKiem.Text && NV[0].HOTEN != txtTimKiem.Text)
     {
         MessageBox.Show("Kết quả tìm kiếm không có! Mời bạn nhập lại");
         return;
     }
     lblHoTen.Text    = NV[0].HOTEN;
     lblChucVu.Text   = NV[0].CHUCVU;
     lblDoanhThu.Text = TranDateFormat.SubString(NV[0].DOANHTHU);
     lblGioiTinh.Text = NV[0].GIOITINH;
     lblNgSinh.Text   = TranDateFormat.SubString(NV[0].NGSINH);
     lblNgVaoLam.Text = TranDateFormat.SubString(NV[0].NGAYVL);
     lblMaNV.Text     = NV[0].MANV;
     lblLuong.Text    = TranDateFormat.SubString(NV[0].LUONG);
 }
Exemple #15
0
        void Reset()
        {
            lblTop1.BackColor = Color.FromArgb(243, 208, 55);
            lblTop2.BackColor = Color.FromArgb(213, 90, 48);
            lblTop3.BackColor = Color.FromArgb(22, 175, 84);

            Stelia_BUS.Stelia_BUS bus = new Stelia_BUS.Stelia_BUS();
            string MaNV = bus.getThongTinNV(0, 0);

            DTO_NhanVien[] NV = bus.search_NhanVien(MaNV);
            lblHoTen.Text    = NV[0].HOTEN;
            lblChucVu.Text   = NV[0].CHUCVU;
            lblDoanhThu.Text = TranDateFormat.SubString(NV[0].DOANHTHU);
            lblGioiTinh.Text = NV[0].GIOITINH;
            lblNgSinh.Text   = TranDateFormat.SubString(NV[0].NGSINH);
            lblNgVaoLam.Text = TranDateFormat.SubString(NV[0].NGAYVL);
            lblMaNV.Text     = NV[0].MANV;
            lblLuong.Text    = TranDateFormat.SubString(NV[0].LUONG);
        }
Exemple #16
0
        private void PictureBox18_Click(object sender, EventArgs e)
        {
            Stelia_BUS.Stelia_BUS bus = new Stelia_BUS.Stelia_BUS();
            DTO_KhachHang[]       KH  = bus.search_KhachHang(txtTimKiem.Text);
            if (KH[0].MAKH != txtTimKiem.Text && KH[0].HOTEN != txtTimKiem.Text)
            {
                MessageBox.Show("Không có kết quả tương ứng");
                return;
            }

            lblHoTen.Text    = KH[0].HOTEN;
            lblDiaChi.Text   = KH[0].DIACHI;
            lblDiemTL.Text   = TranDateFormat.SubString(KH[0].DIEMTL);
            lblGioiTinh.Text = KH[0].GIOITINH;
            lblLoaiThe.Text  = KH[0].LOAIKH;
            lblNgDK.Text     = TranDateFormat.SubString(KH[0].NGDK);
            lblNgSinh.Text   = TranDateFormat.SubString(KH[0].NGSINH);
            lblMaKH.Text     = KH[0].MAKH;
        }
        private void PictureBox3_Click(object sender, EventArgs e)
        {
            string       Ngsinh   = TranDateFormat.Trans(dateNgSinh.Text);
            string       NgVaoLam = TranDateFormat.Trans(dateNgVaoLam.Text);
            DTO_NhanVien NV       = new DTO_NhanVien(txtMaNV.Text, txtHoTen.Text, Ngsinh, txtChucVu.Text,
                                                     NgVaoLam, txtGioiTinh.Text, txtLuong.Text, "0", "0");

            Stelia_BUS.Stelia_BUS bus = new Stelia_BUS.Stelia_BUS();
            if (bus.suaData(NV) == false)
            {
                MessageBox.Show("Có lỗi xảy ra! Không thành công");
                return;
            }
            else
            {
                MessageBox.Show("Bạn đã cập nhật thành công");
            }
            Close();
        }
 void Init_BangThongTinDangNhap()
 {
     if (ThongTinDangNhap.Username == "admin")
     {
         textBoxHoTen.Text     = "admin";
         lblNgSinh.Text        = "";
         lblChucVu.Text        = "admin";
         lblNgVaoLam.Text      = "";
         lblGioiTinh.Text      = "";
         simpleButton1.Visible = false;
         return;
     }
     Stelia_BUS.Stelia_BUS bus = new Stelia_BUS.Stelia_BUS();
     DTO_NhanVien[]        nv  = bus.search_NhanVien(ThongTinDangNhap.Username);
     textBoxHoTen.Text      = nv[0].HOTEN;
     textBoxHoTen.ForeColor = Color.Black;
     lblNgSinh.Text         = TranDateFormat.SubString(nv[0].NGSINH);
     lblChucVu.Text         = nv[0].CHUCVU;
     lblNgVaoLam.Text       = TranDateFormat.SubString(nv[0].NGAYVL);
     lblGioiTinh.Text       = nv[0].GIOITINH;
 }
Exemple #19
0
        private void PictureBox3_Click(object sender, EventArgs e)
        {
            Stelia_BUS.Stelia_BUS bus = new Stelia_BUS.Stelia_BUS();
            DTO_KhachHang         KH  = new DTO_KhachHang();

            KH.HOTEN    = txtHoTen.Text;
            KH.MAKH     = txtMaKH.Text;
            KH.GIOITINH = txtGioiTinh.Text;
            KH.LOAIKH   = txtLoaiThe.Text;
            KH.NGDK     = TranDateFormat.Trans(dateNgDK.Text);
            KH.NGSINH   = TranDateFormat.Trans(dateNgSinh.Text);
            KH.DIACHI   = txtDiaChi.Text;
            KH.DIEMTL   = txtDiemTL.Text;

            if (bus.themData(KH) == false)
            {
                MessageBox.Show("Có lỗi xảy ra! Mời bạn xem lại");
                return;
            }
            MessageBox.Show("Đã thêm thành công!");
            Close();
        }
Exemple #20
0
        private void PictureBox3_Click(object sender, EventArgs e)
        {
            Stelia_BUS.Stelia_BUS bus = new Stelia_BUS.Stelia_BUS();
            DTO_KhachHang         KH  = new DTO_KhachHang();

            KH.HOTEN    = txtHoTen.Text;
            KH.GIOITINH = txtGioiTinh.Text;
            KH.LOAIKH   = txtLoaiThe.Text;
            KH.NGSINH   = TranDateFormat.Trans(dateNgSinh.Text);
            KH.NGDK     = TranDateFormat.Trans(dateNgDK.Text);
            KH.MAKH     = MaKH;
            KH.DIACHI   = txtDiaChi.Text;
            KH.DIEMTL   = DTL;

            if (bus.suaData(KH))
            {
                MessageBox.Show("Bạn đã cập nhật thành công");
            }
            else
            {
                MessageBox.Show("Có lỗi xảy ra! Không thành công");
            }
        }
Exemple #21
0
        void Init_BangThongTinDangNhap()
        {
            if (ThongTinDangNhap.Username == "admin")
            {
                textBoxHoTen.Text     = "admin";
                lblNgSinh.Text        = "";
                lblChucVu.Text        = "admin";
                lblNgVaoLam.Text      = "";
                lblGioiTinh.Text      = "";
                simpleButton1.Visible = false;
                picAnh.Image          = Image.FromFile(Application.StartupPath + "/HinhNhanVien/" + "None.png");
                return;
            }
            string ma = ThongTinDangNhap.Username;

            if (System.IO.File.Exists(Application.StartupPath + "/HinhNhanVien/" + ma + ".jpg"))
            {
                picAnh.Image = Image.FromFile(Application.StartupPath + "/HinhNhanVien/" + ma + ".jpg");
            }
            else
            if (System.IO.File.Exists(Application.StartupPath + "/HinhNhanVien/" + ma + ".png"))
            {
                picAnh.Image = Image.FromFile(Application.StartupPath + "/HinhNhanVien/" + ma + ".png");
            }
            else
            {
                picAnh.Image = Image.FromFile(Application.StartupPath + "/HinhNhanVien/" + "None.png");
            }
            Stelia_BUS.Stelia_BUS bus = new Stelia_BUS.Stelia_BUS();
            DTO_NhanVien[]        nv  = bus.search_NhanVien(ThongTinDangNhap.Username);
            textBoxHoTen.Text      = nv[0].HOTEN;
            textBoxHoTen.ForeColor = Color.Black;
            lblNgSinh.Text         = TranDateFormat.SubString(nv[0].NGSINH);
            lblChucVu.Text         = nv[0].CHUCVU;
            lblNgVaoLam.Text       = TranDateFormat.SubString(nv[0].NGAYVL);
            lblGioiTinh.Text       = nv[0].GIOITINH;
        }
Exemple #22
0
        public FormCapNhatSP(string MaSP)
        {
            InitializeComponent();
            Stelia_BUS.Stelia_BUS bus = new Stelia_BUS.Stelia_BUS();
            DTO_SanPham[]         SP  = bus.search_SANPHAM(MaSP);
            lblMaSP.Text      = SP[0].MASP;
            txtTenSP.Text     = SP[0].TENSP;
            lblNCC.Text       = bus.getTenNCC(SP[0].MANCC);
            txtGiaBan.Text    = TranDateFormat.SubString(SP[0].DONGIA);
            txtLoiNhuan.Text  = TranDateFormat.SubString(SP[0].LOINHUAN);
            txtTrangThai.Text = SP[0].TRANGTHAI;
            txtSoLuong.Text   = TranDateFormat.SubString(SP[0].SLUONG);
            string ma = lblMaSP.Text;

            if (System.IO.File.Exists(Application.StartupPath + "/HinhSanPham/" + ma + ".jpg"))
            {
                picAnhSP.Image = Image.FromFile(Application.StartupPath + "/HinhSanPham/" + ma + ".jpg");
            }
            else
            {
                picAnhSP.Image = Image.FromFile(Application.StartupPath + "/HinhSanPham/" + ma + ".png");
            }
            MaNCC = SP[0].MANCC;
        }