private void FrmVersionInfo_Load(object sender, System.EventArgs e) { try { g_TimeServer = SYS_VersionInfo.Inst.GetTimeServer().Value; LastDate = g_TimeServer; ListVer = SYS_VersionInfo.GetList(); DienThoai = AutoUpdate.GetVersionNew(EnumModule.G5_DienThoai); TongDai = AutoUpdate.GetVersionNew(EnumModule.G5_TongDai); DieuHanhChinh = AutoUpdate.GetVersionNew(EnumModule.DieuHanhChinh); } catch (Exception ex) { } #region Fill dữ liệu grdData.DataSource = ListVer; txt_DienThoai_PhienBan.Text = DienThoai.Version; txt_DienThoai_HanCapNhat.EditValue = DienThoai.UpdateDate; txt_DienThoai_MoTa.Text = DienThoai.Description; txt_TongDai_PhienBan.Text = TongDai.Version; txt_TongDai_HanCapNhat.EditValue = TongDai.UpdateDate; txt_TongDai_MoTa.Text = TongDai.Description; txt_DieuHanhChinh_PhienBan.Text = DieuHanhChinh.Version; txt_DieuHanhChinh_HanCapNhat.EditValue = DieuHanhChinh.UpdateDate; txt_DieuHanhChinh_MoTa.Text = DieuHanhChinh.Description; #endregion }
private void TimeVersionInfo_Tick(object sender, EventArgs e) { try { g_TimeServer = g_TimeServer.AddSeconds(1); var lst = SYS_VersionInfo.GetLastUpdate(LastDate); if (lst != null) { foreach (var item in lst) { bool chk = true; foreach (var item1 in ListVer) { if (item.Id == item1.Id) { chk = false; item1.Status = item.Status; item1.Username = item.Username; item1.Version = item.Version; item1.DateUpdate = item.DateUpdate; break; } } if (chk) { ListVer.Insert(0, item); } } grdData.RefreshDataSource(); } } catch (Exception ex) { } }
public static void CheckVersion() { try { var version = SYS_VersionInfo.GetVersionIPAddress(QuanTriCauHinh.IpAddress, Global.Module.ToString(), LastUpdate); if (version.Id > 0) { LastUpdate = version.LastUpdate; if (!version.IsRequired && !version.IsCheck) { return; } IsRequired = version.IsRequired; bool IsSave = false; if (version.IsCheck) { version.Version = license.Version(); version.Status = "Đã cập nhật"; version.IsCheck = false; IsSave = true; } if (version.IsRequired) { new FrmRequired() { versionInfo = version }.Show(); } if (IsSave) { var dt = version.GetTimeServer(); version.LastUpdate = dt; version.Save(); } } } catch { } }
public static void CheckVersionStart() { try { var version = SYS_VersionInfo.GetVersionIPAddress(QuanTriCauHinh.IpAddress, Global.Module.ToString(), LastUpdate); var dt = version.GetTimeServer(); if (version.Id > 0) { LastUpdate = version.LastUpdate; if (!version.IsRequired && version.IsCheck) { return; } IsRequired = version.IsRequired; if (version.IsCheck) { version.Version = license.Version(); version.IsCheck = false; } version.IsRequired = false; version.LastUpdate = dt; } else { version.IPAddress = QuanTriCauHinh.IpAddress; version.IsPC = Global.Module.ToString(); version.Version = license.Version(); version.DateUpdate = dt; version.LastUpdate = dt; } version.Save(); } catch { } }