コード例 #1
0
        public bool timKiemHS(GunaTextBox mnv, GunaTextBox ten, GunaDateTimePicker ns, GunaTextBox gt, GunaTextBox sdt, GunaTextBox eml, GunaDateTimePicker ntd, GunaTextBox mpb, /*GunaTextBox tk, GunaTextBox mk, GunaTextBox q,*/ DataGridView tdcm, DataGridView tdnn, DataGridView qtct)
        {
            HoSoNV_DTO nv = qlhs.timKiem(mnv.Text);

            try
            {
                ten.Text  = nv.HoTen;
                ns.Value  = nv.NgaySinh;
                gt.Text   = nv.GioiTinh;
                sdt.Text  = nv.SDT;
                eml.Text  = nv.Email;
                ntd.Value = nv.NgayTD;
                mpb.Text  = nv.MaPB;
                //tk.Text = nv.TaiKhoan;
                //mk.Text = nv.MatKhau;
                //q.Text = nv.Quyen;
                qlhs.hienThiTDCM(tdcm, mnv.Text);
                qlhs.hienThiTDNN(tdnn, mnv.Text);
                qlhs.hienThiQTCT(qtct, mnv.Text);
            }
            catch (Exception)
            {
            }
            if (nv.HoTen != null)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #2
0
        public bool xoaHoSoNhanVien(GunaTextBox mnv)
        {
            string manv   = mnv.Text;
            bool   output = qlhs.xoaHoSo(manv);

            return(output);
        }
コード例 #3
0
 public static void LoadProductInformation(MetroComboBox cmbProductName, GunaTextBox txtItemNumber, GunaTextBox txtStocks, BunifuDatepicker dtpDateCreation, MetroComboBox cmbCategory)
 {
     try
     {
         using (var connection = new MySqlConnection(ConfigurationManager.ConnectionStrings["POS_SYSTEM"].ConnectionString))
         {
             connection.Open();
             string query = "SELECT product_item_code, product_stocks, product_category FROM tbl_products WHERE product_id = @product_id;";
             using (var command = new MySqlCommand(query, connection))
             {
                 command.Parameters.Add("product_id", MySqlDbType.Int32).Value = cmbProductName.SelectedValue;
                 MySqlDataReader reader = command.ExecuteReader();
                 if (reader.HasRows)
                 {
                     while (reader.Read())
                     {
                         txtItemNumber.Text    = reader["product_item_code"].ToString();
                         txtStocks.Text        = reader["product_stocks"].ToString();
                         dtpDateCreation.Value = DateTime.Today;
                         cmbCategory.Text      = reader["product_category"].ToString();
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
コード例 #4
0
        public bool xoaPhongBan(GunaTextBox maPB, GunaTextBox tenPB, GunaDateTimePicker ngayTL)
        {
            string   mapb   = maPB.Text;
            string   tenpb  = tenPB.Text;
            DateTime ngaytl = ngayTL.Value;
            bool     output = qlpb.xoaPhongBan(mapb, tenpb, ngaytl);

            return(output);
        }
コード例 #5
0
        public int dangNhap_BUS(GunaTextBox txtTaiKhoan, GunaTextBox txtMatKhau)//, GunaLabel lb, GunaButton btn1, GunaButton btn2)
        {
            int kt = DangNhap_DAO.Instance.dangNhap(txtTaiKhoan.Text, txtMatKhau.Text);

            if (kt == 1)
            {
                return(1);
            }
            else if (kt == 2)
            {
                return(2);
            }
            return(0);
        }
コード例 #6
0
        public bool timKiemTrinhDoChuyenMon_BUS(GunaTextBox maNV, GunaLabel txtTenNV, GunaDataGridView gr)
        {
            HoSoNV_DTO nv = new HoSoNV_DTO
            {
                MaNV = maNV.Text
            };

            TrinhDoChuyenMon_DAO.createInstance.timKiemTrinhDoChuyenMon_DAO(nv);
            txtTenNV.Text = nv.HoTen;
            if (nv.HoTen == null)
            {
                return(false);
            }
            TrinhDoChuyenMon_DAO.createInstance.hienThi(gr, nv.MaNV);
            return(true);
        }
コード例 #7
0
        public bool suaHoSoNhanVien(GunaTextBox mnv, GunaTextBox ten, GunaDateTimePicker nsinh, ComboBox gt, GunaTextBox sdt, GunaTextBox eml, GunaDateTimePicker ntd, ComboBox mpb, GunaTextBox tk, GunaTextBox mk, GunaTextBox q)
        {
            string manv          = mnv.Text;
            string hoten         = ten.Text;
            string ngaysinh      = nsinh.Value.ToString();
            string gioitinh      = gt.SelectedItem.ToString();
            string sodienthoai   = sdt.Text;
            string email         = eml.Text;
            string ngaytuyendung = ntd.Value.ToString();
            string mapb          = mpb.SelectedValue.ToString();
            string taikhoan      = tk.Text;
            string matkhau       = mk.Text;
            string quyen         = q.Text;
            bool   output        = qlhs.suaHoSo(manv, hoten, Convert.ToDateTime(ngaysinh), gioitinh, sodienthoai, email, Convert.ToDateTime(ngaytuyendung), mapb, taikhoan, matkhau, quyen);

            return(output);
        }
コード例 #8
0
        public bool layThongTinHoSo_BUS(GunaTextBox txtMaNV, GunaLabel lb1, GunaLabel lb2)
        {
            HoSoNV_DTO nhanvien = new HoSoNV_DTO();

            nhanvien = QuanLyQuaTrinhCongTac_DAO.Instance.layThongTinHoSo_DAO(txtMaNV.Text);

            if (nhanvien.MaNV != null)
            {
                lb1.Text = nhanvien.MaNV;
                lb2.Text = nhanvien.HoTen;
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #9
0
ファイル: Frm_Fonction.cs プロジェクト: loic-10/TransFlash
        public void PrendreUniquementChiffre(GunaTextBox textBox)
        {
            string[] text = new string[textBox.Text.Length];
            string   val  = string.Empty;

            for (int i = 0; i < text.Length; i++)
            {
                if (textBox.Text[i] == '0' || textBox.Text[i] == '1' || textBox.Text[i] == '2' || textBox.Text[i] == '3' ||
                    textBox.Text[i] == '4' || textBox.Text[i] == '5' || textBox.Text[i] == '6' || textBox.Text[i] == '7' ||
                    textBox.Text[i] == '8' || textBox.Text[i] == '9')
                {
                    val += textBox.Text[i].ToString();
                    textBox.Focus();
                }
            }
            textBox.Text = val;
            textBox.Select(val.Length, val.Length);
        }
コード例 #10
0
        // Fungsi untuk memisah angka ribuan pada textbox
        public void SetThousandSeparator(GunaTextBox txt)
        {
            if (txt.Text.Length > 0)
            {
                try
                {
                    string s = txt.Text.Replace(",", "");

                    int i = int.Parse(s);
                    txt.Text = string.Format("{0:###,###,###}", i);

                    txt.SelectionStart = txt.Text.Length;
                }
                catch
                {
                }
            }
        }
コード例 #11
0
 public void timKiem(GunaTextBox ma, DataGridView gr)
 {
     ChucVu_DAO.createInstance.timkiem(ma.Text, gr);
 }
コード例 #12
0
 public int capNhapDuLieu(GunaTextBox ma, GunaTextBox ten, GunaTextBox hspc)
 {
     return(ChucVu_DAO.createInstance.capNhatChucVu(ma.Text, ten.Text, Single.Parse(hspc.Text)));
 }
コード例 #13
0
 public void xoaDuLieu(GunaTextBox ma)
 {
     ChucVu_DAO.createInstance.xoaChucVu(ma.Text);
 }
コード例 #14
0
        public void timKiemHoSoNhanVien(DataGridView dt, GunaTextBox mnv)
        {
            string manv = mnv.Text;

            qlhs.timKiemHoSo(dt, manv);
        }
コード例 #15
0
        public int themChucVu_BUS(GunaTextBox txtMa, GunaTextBox txtTen, GunaTextBox hspc)
        {
            ChucVu_DTO cv = new ChucVu_DTO(txtMa.Text.ToUpper(), txtTen.Text.ToUpper(), Single.Parse(hspc.Text));

            return(ChucVu_DAO.createInstance.themChucVu(cv));
        }
コード例 #16
0
 public bool capnhatNVCV_BUS(GunaLabel txtMNV, GunaComboBox cbCV, GunaDateTimePicker tuNgay, GunaDateTimePicker denNgay, GunaTextBox noiCongTac)
 {
     return(QuanLyQuaTrinhCongTac_DAO.Instance.capnhatNVCV_DAO(txtMNV.Text, tuNgay.Value, denNgay.Value, noiCongTac.Text, cbCV.SelectedValue.ToString()));
 }
コード例 #17
0
        public int themTrinhDoChuyenMon(GunaLabel ma, GunaComboBox td, GunaComboBox lh, GunaTextBox truong, GunaTextBox ng)
        {
            TrinhDoChuyenMon_DTO tdcm = new TrinhDoChuyenMon_DTO(ma.Text, ng.Text, td.SelectedItem.ToString(), lh.SelectedItem.ToString(), truong.Text);

            return(TrinhDoChuyenMon_DAO.createInstance.themTrinhDoChuyenMon(tdcm));
        }
コード例 #18
0
 public int capNhapTrinhDoChuyenMon(GunaTextBox nganh, GunaComboBox td, GunaComboBox lh, GunaTextBox truong)
 {
     return(TrinhDoChuyenMon_DAO.createInstance.capNhapTrinhDoChuyenMon(nganh.Text, td.SelectedItem.ToString(), lh.SelectedItem.ToString(), truong.Text));
 }
コード例 #19
0
 public int xoaTrinhDoChuyenMon(GunaLabel ma, GunaTextBox nganh)
 {
     return(TrinhDoChuyenMon_DAO.createInstance.xoaTrinhDoChuyenMon(nganh.Text, ma.Text));
 }
コード例 #20
0
 public bool xoaNVCV_BUS(GunaLabel txtMNV, GunaComboBox cbCV, GunaTextBox gunaTextBox1)
 {
     return(QuanLyTrinhDoNgoaiNgu_DAO.Instance.xoaNVCV_DAO(txtMNV.Text, cbCV.SelectedValue.ToString(), gunaTextBox1.Text));
 }
コード例 #21
0
        public void timKiemPhongBan(GunaTextBox maPB, DataGridView dt)
        {
            string mapb = maPB.Text;

            qlpb.timKiemPhongBan(dt, mapb);
        }
コード例 #22
0
        public void xuatFile(GunaTextBox mnv, GunaTextBox ten, GunaDateTimePicker ns, GunaTextBox gt, GunaTextBox sdt, GunaTextBox eml, GunaDateTimePicker ntd, GunaTextBox mpb, DataGridView tdcm, DataGridView tdnn, DataGridView qtct)
        {
            BaseFont bf = BaseFont.CreateFont(@"C:\WINDOWS\Fonts\TIMES.TTF", BaseFont.IDENTITY_H, true);

            iTextSharp.text.Font fonttitle = new iTextSharp.text.Font(bf, 15);
            iTextSharp.text.Font font      = new iTextSharp.text.Font(bf, 12);
            iTextSharp.text.Font fonttext  = new iTextSharp.text.Font(bf, 12);

            Paragraph header = new Paragraph
            {
                Alignment = Element.ALIGN_CENTER
            };
            Chunk c1 = new Chunk("HỒ SƠ NHÂN VIÊN \n", fonttitle);
            Chunk c2 = new Chunk(DateTime.Now.ToShortDateString() + "\n\n", font);

            header.Add(c1);
            header.Add(c2);
            string manv          = "Mã Nhân Viên: " + mnv.Text + "\n";
            string tenvn         = "Tên Nhân Viên: " + ten.Text + "\n";
            string ngaysinh      = "Ngày Sinh: " + ns.Value.ToString() + "\n";
            string gioitinh      = "Giới Tính: " + gt.Text + "\n";
            string sodt          = "Số Điện Thoại: " + sdt.Text + "\n";
            string email         = "Email: " + eml.Text + "\n";
            string ngaytuyendung = "Ngày Tuyển Dụng: " + ntd.Value.ToString() + "\n";
            string mapb          = "Mã Phòng Ban: " + mpb.Text + "\n";
            //string taikhoan = "Tài Khoản: " + tk.Text + "\n";
            //string matkhau = "Mật Khẩu: " + mk.Text + "\n";
            //string quyen = "Quyền: " + q.Text + "\n";

            Paragraph text1 = new Paragraph();
            Chunk     c3    = new Chunk(manv, font);
            Chunk     c4    = new Chunk(tenvn, font);
            Chunk     c5    = new Chunk(ngaysinh, font);
            Chunk     c6    = new Chunk(gioitinh, font);
            Chunk     c7    = new Chunk(sodt, font);
            Chunk     c8    = new Chunk(email, font);
            Chunk     c9    = new Chunk(ngaytuyendung, font);
            Chunk     c10   = new Chunk(mapb, font);

            //Chunk c11 = new Chunk(taikhoan, font);
            //Chunk c12 = new Chunk(matkhau, font);
            //Chunk c13 = new Chunk(quyen, font);
            text1.Add(c3);
            text1.Add(c4);
            text1.Add(c5);
            text1.Add(c6);
            text1.Add(c7);
            text1.Add(c8);
            text1.Add(c9);
            text1.Add(c10);
            //text1.Add(c11);
            //text1.Add(c12);
            //text1.Add(c13);

            Paragraph text2 = new Paragraph();
            Chunk     c14   = new Chunk("\nTrình Độ Chuyên Môn:", font);

            PdfPTable pdfTable = new PdfPTable(tdcm.Columns.Count);

            pdfTable.DefaultCell.Padding = 4;
            pdfTable.WidthPercentage     = 100;
            pdfTable.HorizontalAlignment = Element.ALIGN_LEFT;
            foreach (DataGridViewColumn column in tdcm.Columns)
            {
                PdfPCell cell = new PdfPCell(new Phrase(column.HeaderText, fonttext));
                pdfTable.AddCell(cell);
            }
            foreach (DataGridViewRow row in tdcm.Rows)
            {
                foreach (DataGridViewCell cell in row.Cells)
                {
                    PdfPCell cell1 = new PdfPCell(new Phrase(cell.Value.ToString(), fonttext));
                    pdfTable.AddCell(cell1);
                }
            }
            text2.Add(c14);
            text2.Add(pdfTable);

            Paragraph text3 = new Paragraph();
            Chunk     c15   = new Chunk("\nTrình Độ Ngoại Ngữ:", font);

            PdfPTable pdfTable1 = new PdfPTable(tdnn.Columns.Count);

            pdfTable1.DefaultCell.Padding = 2;
            pdfTable1.WidthPercentage     = 100;
            pdfTable1.HorizontalAlignment = Element.ALIGN_LEFT;
            foreach (DataGridViewColumn column in tdnn.Columns)
            {
                PdfPCell cell = new PdfPCell(new Phrase(column.HeaderText, fonttext));
                pdfTable1.AddCell(cell);
            }
            foreach (DataGridViewRow row in tdnn.Rows)
            {
                foreach (DataGridViewCell cell in row.Cells)
                {
                    PdfPCell cell1 = new PdfPCell(new Phrase(cell.Value.ToString(), fonttext));
                    pdfTable1.AddCell(cell1);
                }
            }
            text3.Add(c15);
            text3.Add(pdfTable1);

            Paragraph text4 = new Paragraph();
            Chunk     c16   = new Chunk("\nQuá Trình Công Tác:", font);

            PdfPTable pdfTable2 = new PdfPTable(qtct.Columns.Count);

            pdfTable2.DefaultCell.Padding = 4;
            pdfTable2.WidthPercentage     = 100;
            pdfTable2.HorizontalAlignment = Element.ALIGN_LEFT;
            foreach (DataGridViewColumn column in qtct.Columns)
            {
                PdfPCell cell = new PdfPCell(new Phrase(column.HeaderText, fonttext));
                pdfTable2.AddCell(cell);
            }
            foreach (DataGridViewRow row in qtct.Rows)
            {
                foreach (DataGridViewCell cell in row.Cells)
                {
                    PdfPCell cell1 = new PdfPCell(new Phrase(cell.Value.ToString(), fonttext));
                    pdfTable2.AddCell(cell1);
                }
            }
            text4.Add(c16);
            text4.Add(pdfTable2);

            string file_name = "D:\\" + "output.pdf";

            using (FileStream stream = new FileStream(file_name, FileMode.Create))
            {
                Document pdfDoc = new Document(PageSize.A4, 10f, 20f, 20f, 10f);
                PdfWriter.GetInstance(pdfDoc, stream);
                pdfDoc.Open();
                pdfDoc.Add(header);
                pdfDoc.Add(text1);
                pdfDoc.Add(text2);
                pdfDoc.Add(text3);
                pdfDoc.Add(text4);
                pdfDoc.Close();
                stream.Close();
            }
        }