Пример #1
0
        private nhanVien CreateNhanVien()
        {
            var nv = new nhanVien();

            if (_IsUpdateMode)
            {
                nv.maNhanVien = _MaNhanVien;
            }
            nv.hoTen       = txtHoTen.Text.Trim();
            nv.ngaySinh    = DateTime.ParseExact(dtNgaySinh.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture);
            nv.soDienThoai = stDienThoai.Text.Trim();
            nv.diaChi      = stDCThuongTru.Text.Trim();
            nv.tenDangNhap = stTenDangNhap.Text.Trim();
            nv.matKhau     = _IsUpdateMode ? _CurrentPassword : CreatePassword(10);
            if (cbxgioitinh.SelectedValue == "Nam")
            {
                nv.gioiTinh = true;
            }
            else
            {
                nv.gioiTinh = false;
            }

            nv.maCNLamViec = int.Parse(cbxChiNhanh.SelectedValue);
            nv.loaiNV      = 2;
            return(nv);
        }
Пример #2
0
        protected void gvNhanVien_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                nhanVien row   = (nhanVien)e.Row.DataItem;
                string   query = string.Format("maNV={0}", row.maNhanVien);
                e.Row.Cells[0].Text = string.Format("<a onclick=\"openPopupModal('{0}')\">{1}</a>", "InsertUpdateNhanVien.aspx?" + query, row.maNhanVien);

                e.Row.Cells[5].Text = row.gioiTinh ? "Nam" : "Nữ";
            }
        }