private void Load_fgThongBao() { var fg = fgThongBao; fg.Tag = 0; fg.BeginUpdate(); clsThongBao thongBao = new clsThongBao(); DataTable dt = thongBao.Select_ID_NhanSu(GlobalVariables.GetID_NhanSu().ToString()); fg.ClearRows(); fg.SetDataSource(dt); fg.Row = -1; fg.AutoSizeRows(); for (int i = fg.Rows.Fixed; i < fg.Rows.Count; i++) { if (fg[i, "Ten_TrangThai"].ToString().Trim() != "Đã xem") { fg.Rows[i].Style = csThongBao; } fg[i, "NoiDung"] = fg.GetDataDisplay(i, "NoiDung").Replace(GlobalVariables.Get_HoTen_NhanSu(), "Bạn"); fg[i, "Ten_NgayGui"] = GlobalVariables.TimeAgo(DateTime.Parse(fg.Rows[i]["Ngay_Gui"].ToString())); } fg.EndUpdate(); fg.Tag = 1; }
private int SoThongBaoChuaDoc() { var thongBao = new clsThongBao(); var dt = thongBao.SelectAll_By_ID_NhanSu(GlobalVariables.GetID_NhanSu().ToString()); m_iSoLuongThongBao = dt.Rows.Count; return(m_iSoLuongThongBao); }
private void SaveData() { clsThongBao thongBao = new clsThongBao(); thongBao.Ngay_Gui = GlobalVariables.GetCurrentDateTime(); thongBao.TaiKhoan_Gui = Int16.Parse(GlobalVariables.GetID_NhanSu().ToString(CultureInfo.InvariantCulture)); thongBao.TaiKhoan_Nhan = cmbNguoiNhan.Properties.GetCheckedItems().ToString(); thongBao.Ten_ChucNang_ThongBao = "frmTaoThongBao"; thongBao.NoiDung = GlobalVariables.Get_HoTen_NhanSu() + " " + txtNoiDung.Text.Trim(); thongBao.TrangThai = 1; thongBao.Insert(); }
private void fgThongBao_DoubleClick(object sender, EventArgs e) { int ID_CongViec = fgThongBao.GetIntValue(fgThongBao.Row, "ID_CongViec"); frmCongViec congViec = new frmCongViec(ID_CongViec, true); congViec.ShowDialog(); clsThongBao thongBao = new clsThongBao(); thongBao.ID_ThongBao = fgThongBao.GetIntValue(fgThongBao.Row, "ID_ThongBao"); thongBao.SelectOne(); thongBao.TrangThai = 2; thongBao.Update(); Load_fgThongBao(); }
private void btnDaXem_Click(object sender, EventArgs e) { var fg = fgThongBao; clsThongBao cls = new clsThongBao(); for (int i = fg.Rows.Fixed; i < fg.Rows.Count; i++) { if (fg.GetIntValue(i, "TrangThai") != 2) { int ID_ThongBao = fg.GetIntValue(i, "ID_ThongBao"); cls.ID_ThongBao = ID_ThongBao; cls.SelectOne(); cls.TrangThai = 2; cls.Update(); } } Load_fgThongBao(); }