Ejemplo n.º 1
0
        public frmSuaNV(int id)
        {
            InitializeComponent();
            this.id = id;
            DataTable dt = NhanVienControl.layThongTin(id);

            txtTenCu.Text      = dt.Rows[0]["TenNV"].ToString();
            txtGioiTinh.Text   = dt.Rows[0]["GioiTinh"].ToString();
            txtNgaySinhCu.Text = String.Format("{0:dd/MM/yyyy}", dt.Rows[0]["NgaySinh"]);
            txtSDTCu.Text      = dt.Rows[0]["SDT"].ToString();
            txtLuongCu.Text    = dt.Rows[0]["Luong"].ToString();
        }
Ejemplo n.º 2
0
        public frmSuaNV(int id)
        {
            InitializeComponent();
            this.id = id;
            DataTable dt = NhanVienControl.layThongTin(id);

            txtTenCu.Text      = dt.Rows[0][1].ToString();
            txtNgaySinhCu.Text = String.Format("{0:dd/MM/yyyy}", dt.Rows[0][2]);
            txtGioiTinh.Text   = dt.Rows[0][3].ToString();
            txtPhongBan.Text   = dt.Rows[0][4].ToString().Length == 0 ? "None" : dt.Rows[0][4].ToString();
            txtQuanLy.Text     = dt.Rows[0][5].ToString().Length == 0 ? "None" : dt.Rows[0][5].ToString();
            txtLuongCu.Text    = dt.Rows[0][6].ToString();
        }
Ejemplo n.º 3
0
 public NhanVien(int ma)
 {
     if (ma == 0)
     {
         MaNV  = 0;
         TenNV = "";
     }
     else
     {
         MaNV = ma;
         DataTable dt = NhanVienControl.layThongTin(ma);
         TenNV = dt.Rows[0]["TenNV"].ToString();
     }
 }
Ejemplo n.º 4
0
        public NhanVien(int manv)
        {
            MaNV = manv;
            if (manv == 0)
            {
                MaNV     = 0;
                TenNV    = GioiTinh = SDT = "";
                NgaySinh = DateTime.Now;
                Luong    = 0;
                return;
            }
            DataTable dt = NhanVienControl.layThongTin(manv);

            TenNV    = dt.Rows[0]["TenNV"].ToString();
            GioiTinh = dt.Rows[0]["GioiTinh"].ToString();
            NgaySinh = DateTime.Parse(dt.Rows[0]["NgaySinh"].ToString());
            SDT      = dt.Rows[0]["SDT"].ToString();
            Luong    = double.Parse(dt.Rows[0]["Luong"].ToString());
        }