public frmAbout() { InitializeComponent(); about = AboutConfig.GetInstance().GetAbout(); this.TopMost = true; RefreshFrm(); }
/// <summary> /// 关于管理 /// </summary> /// <returns></returns> public ActionResult AboutManage() { var configSettings = new ConfigSettings(); var config = new AboutConfig(configSettings, "About", Server.MapPath("~/Settings")); config.Load(); return(View(config)); }
public FrmMain() { CLog4net.LogInfo("System starting!"); InitializeComponent(); this.systemController = new SystemController(); FrmLoading frmLoading = new FrmLoading(this.systemController); frmLoading.ShowDialog(); if (frmLoading.DialogResult == DialogResult.OK) { frmLoading.Hide(); frmLoading.Close(); } this.boxsManager = BoxsManager.GetInstance(); this.packageManager = PackageManager.GetInstance(); this.voiceService = ServicesFactory.GetInstance().GetVoicService(); this.serverService = ServicesFactory.GetInstance().GetServerService(); this.cameraService = ServicesFactory.GetInstance().GetCameraService(); this.about = AboutConfig.GetInstance().GetAbout(); this.infoCenterLister = InfoCenterLister.GetInsatnce(); this.adManager = ADManager.GetInstance(); this.AddUCScene(Roster.Home, new Home(this, 0)); this.AddUCScene(Roster.P_ControlPanel, new PostmanControlPanel(this, 5)); this.AddUCScene(Roster.P_D_Verify, new PostmanVerify(this, 60)); this.AddUCScene(Roster.P_D_ChooseBox, new PostmanChooseBox(this, 60)); this.AddUCScene(Roster.P_D_DeliverPG, new PostmanDeliverPG(this, 120)); this.AddUCScene(Roster.P_D_EntryPGInfo, new PostmanEntryPGInfo(this, 60)); this.AddUCScene(Roster.P_D_PGVerify, new PostmanPGVerify(this, 60)); this.AddUCScene(Roster.P_D_FinishWork, new PostmanFinishWork(this, 10)); this.AddUCScene(Roster.P_D_Cancel, new PostmanCancelTask(this, 60)); this.AddUCScene(Roster.P_D_CancelTask, new PostmanCancelTask(this, 60)); this.AddUCScene(Roster.P_T_EntryPGInfo, new PostmanTBEntryPGInfo(this, 60)); this.AddUCScene(Roster.P_T_FinishWork, new PostmanTBFinishWork(this, 60)); this.AddUCScene(Roster.P_S_PGDelivered, new PostmanSPGDelivered(this, 60)); this.AddUCScene(Roster.P_R_PGRegister, new PostmanRegister(this, 180)); this.AddUCScene(Roster.C_ControlPanel, new CustomerControlPanel(this, 5)); this.AddUCScene(Roster.C_T_Verify, new CustomerTBVerify(this, 60)); this.AddUCScene(Roster.C_T_FinishWork, new CustomerTBFinishWork(this, 60)); this.AddUCScene(Roster.C_S_EntryPGInfo, new CustomerSEntryPGInfo(this, 60)); this.AddUCScene(Roster.C_S_PGSearched, new CustomerPGSearched(this, 60)); this.AddUCScene(Roster.A_Verify, new AdminVerify(this, 60)); this.AddUCScene(Roster.A_P_EntryBoxCode, new AdminProxyEntryBoxCode(this, 60)); this.AddUCScene(Roster.A_P_FinishWork, new AdminProxyFinishWork(this, 60)); this.AddUCScene(Roster.A_ControlPanel, new AdministratorControlPanel(this, 360)); this.SceneTransit(Roster.Home); this.timerSceneInfo.Enabled = true; this.timerMain.Enabled = true; CLog4net.LogInfo("启动完成"); }
/// <summary> /// 启动加载 /// </summary> public void Load() { serverService = Service.Factory.ServicesFactory.GetInstance().GetServerService(); about = AboutConfig.GetInstance().GetAbout(); adFile = Environment.CurrentDirectory + "\\" + ADResourceFile; adImages = new List <Image>(); UpdateAdImages();//必须先更新,再加载 adImages = this.GetADImages(); }
public FrmMain() { CLog4net.LogInfo("System starting!"); InitializeComponent(); //读取配置文件和Logo图片 try { CLog4net.LogInfo("读取配置文件和Logo图片"); string imagepath = Environment.CurrentDirectory + "\\configInfo\\logo.png"; Image image = Image.FromFile(imagepath); Size size = new Size(logoPic.Width, logoPic.Height); Bitmap b = new Bitmap(image, size); this.logoPic.BackgroundImage = b; IniConfigManager iniConfig = new IniConfigManager(); tel.Text = iniConfig.GetAboutTel(); url.Text = iniConfig.GetAboutUrl(); } catch (Exception e) { CLog4net.LogError(e.ToString()); } this.systemController = new SystemController(); FrmLoading frmLoading = new FrmLoading(this.systemController); frmLoading.ShowDialog(); if (frmLoading.DialogResult == DialogResult.OK) { frmLoading.Hide(); frmLoading.Close(); } this.boxsManager = BoxsManager.GetInstance(); this.packageManager = PackageManager.GetInstance(); this.voiceService = ServicesFactory.GetInstance().GetVoicService(); this.serverService = ServicesFactory.GetInstance().GetServerService(); this.cameraService = ServicesFactory.GetInstance().GetCameraService(); this.about = AboutConfig.GetInstance().GetAbout(); this.infoCenterLister = InfoCenterLister.GetInsatnce(); timerNav.Interval = 1000; timerNav.Stop(); this.timerMain.Enabled = true; this.timerMain.Start(); currentPanel = panelName.mainPanel; mainPanel1.BringToFront(); CLog4net.LogInfo("启动完成"); }
public async Task <ViewResult> Item(string id) { if (id.Equals("about", StringComparison.CurrentCultureIgnoreCase)) { var configSettings = new ConfigSettings(); var config = new AboutConfig(configSettings, "About", Server.MapPath("~/Settings")); config.Load(); return(View("About", config)); } if (id.Equals("guestbook", StringComparison.CurrentCultureIgnoreCase)) { return(View("Guestbook")); } var cacheKey = "post_" + id; var post = RedisManager.GetItem <Post>(cacheKey); if (post == null) { post = await _postRepository.GetPostByAlias(id); if (post != null) { RedisManager.SetItem(cacheKey, post, new TimeSpan(0, Settings.Config.CacheExpired, 0)); } } if (post != null) { var item = new PostItem { UniqueId = post.UniqueId, Title = post.Title, CategoryAlias = post.CategoryAlias, CateName = await _categoryRepository.GetNameByAlias(post.CategoryAlias), CreateTimeStr = post.CreateTime.ToString("yy-MM-dd HH:mm"), ViewCount = post.ViewCount, LabelList = JsonConvert.DeserializeObject <List <LabelShow> >(post.Labels).Select(t => t.Text).ToList(), Summary = post.Summary, Content = post.Content }; return(View(item)); } else { var error = new Elmah.Error(new Exception("文章id:" + id + " 不存在!"), System.Web.HttpContext.Current) { StatusCode = 404 }; Elmah.ErrorLog.GetDefault(System.Web.HttpContext.Current).Log(error); return(View("Error404")); } }
public void Loading() { this.about = AboutConfig.GetInstance().GetAbout(); this.adress.Text = about.Address; this.companyName.Text = about.CompanyName; this.name.Text = about.Name; this.code.Text = about.CabinetCode; this.telNum.Text = about.TelNum; IniConfigManager iniConfig = new IniConfigManager(); this.labelVersion.Text = "客户端版本号:" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(); this.createdTime.Text = iniConfig.GetAboutCommissioningData(); }
public void SaveAbout(AboutConfig conf) { var configSettings = new ConfigSettings(); var config = new AboutConfig(configSettings, "About", Server.MapPath("~/Settings")) { FirstLine = conf.FirstLine, SecondLine = conf.SecondLine, PhotoPath = conf.PhotoPath, QrcodePath = conf.QrcodePath, ThirdLine = conf.ThirdLine, Profile = conf.Profile, Wechat = conf.Wechat, Email = conf.Email }; config.Save(); }
public static void begin() { YDColorizer.GlobalException.Initialize(); Timer timer = new Timer(); #region 配置文件不存在,创建默认配置文件 if (Config.IsConfigExists() == false) { Config.CreateDefault(); } #endregion List <string> dialogBoxTitles = AboutConfig.LoadSearchTitles(); EditDialogBox edb = new EditDialogBox(); int thisProcessId = System.Diagnostics.Process.GetCurrentProcess().Id; timer.Interval = 100;// 设置搜索间隔为100毫秒 timer.Tick += new EventHandler((object object_sender, EventArgs EventArgs_e) => { try { if (edb.hWnd == IntPtr.Zero) { foreach (var title in dialogBoxTitles) // 遍历标题数组寻找对话框 { WinApi.Window dialogBox = new WinApi.Window(DialogBoxClassName, title); // 搜索we物体编辑器的文本编辑框 if (dialogBox.Handle != IntPtr.Zero && thisProcessId == AboutProcess.GetProcessId(dialogBox.Handle)) // 搜索的对话框与该ydwe插件同进程 { edb.AttachDialog(dialogBox.Handle); // 重建模拟窗口 break; } } } } catch (Exception e) { timer.Stop(); GlobalException.CatchException(e, e.ToString()); } }); timer.Start();// 启动搜索计时器 }
public int Load(BackgroundWorker bw) { #region 获取初始化基本信息 bw.ReportProgress(stepNum += 1, "starting......"); this.databaseService = ServicesFactory.GetInstance().GetDatabaseService(); this.aboutConfig = AboutConfig.GetInstance(); this.elocksManager = ELocksManager.GetInstance(); this.boxManager = BoxsManager.GetInstance(); this.packageManager = PackageManager.GetInstance(); this.adManager = ADManager.GetInstance(); this.remoteOpenLogic = RemoteOpenLogic.GetInstance(); this.SystemTimer = new Timer(new TimerCallback(this.SystemTimer_Elapsed), null, Timeout.Infinite, Timeout.Infinite); #endregion System.Threading.Thread.Sleep(delay); bw.ReportProgress(stepNum += 1, "aboutConfig loading......"); this.aboutConfig.Load(); System.Threading.Thread.Sleep(delay); bw.ReportProgress(stepNum += 1, "boxManager loading......"); this.boxManager.Load(); System.Threading.Thread.Sleep(delay); bw.ReportProgress(stepNum += 1, "elocksManager loading......"); this.elocksManager.Load(); System.Threading.Thread.Sleep(delay); bw.ReportProgress(stepNum += 1, "packageManager loading......"); this.packageManager.Load(); System.Threading.Thread.Sleep(delay); bw.ReportProgress(stepNum += 1, "remoteOpenLogic loading......"); this.remoteOpenLogic.Load(); System.Threading.Thread.Sleep(delay); bw.ReportProgress(stepNum += 1, "adManager loading......"); this.adManager.Load(); System.Threading.Thread.Sleep(delay); bw.ReportProgress(stepNum += 1, "packageEvent loading......"); this.packageManager.PackageCreatedEvent += new PackageManager.PackageCreatedDelegate(packageManager_PackageCreatedEvent); this.packageManager.PackageTakedEvent += new PackageManager.PackageTakedDelegate(packageManager_PackageTakedEvent); this.SystemTimer.Change(0, 600 * 1000); System.Threading.Thread.Sleep(delay); bw.ReportProgress(stepNum += 1, "over"); return(stepNum); }
private void confirm_Click(object sender, EventArgs e) { DatabaseService service = ServicesFactory.GetInstance().GetDatabaseService(); //About about = new About(); about.CabinetCode = AboutConfig.GetInstance().GetCabinetCode(); about.Name = this.name.Text; about.CompanyName = this.companyName.Text; about.ServerUrl = this.serverUrl.Text; about.Address = this.adress.Text; about.TelNum = this.telNum.Text; about.Remark = this.remark.Text; about.Model = this.modeltype.Text; service.UpdateAbout(about); RefreshFrm(); MessageBox.Show("修改成功"); }
public void Load() { this.about = AboutConfig.GetInstance().GetAbout(); if (about.Model == "b") { this.IsEnable = true; this.server = Service.Factory.ServicesFactory.GetInstance().GetServerService(); this.packageManager = PackageManager.GetInstance(); this.remoteLinstener = new Timer(new TimerCallback(RemoteOpenListen), null, Timeout.Infinite, Timeout.Infinite); IniConfigManager ini = new IniConfigManager(); this.timeSpan = Convert.ToInt32(ini.GetServerTimeup()); } else { this.IsEnable = false; } CLog4net.LogInfo("RemoteOpenLogic is loaded"); }
public void Load() { serverService = Service.Factory.ServicesFactory.GetInstance().GetServerService(); about = AboutConfig.GetInstance().GetAbout(); }
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { try { int code = (int)dataGridView1.Rows[e.RowIndex].Cells["code"].Value; //openbox if (e.ColumnIndex == 5) { bool issuccess = bm.Find(code).Open(); UpdateData(); CLog4net.LogInfo("管理员开箱:" + code); } //删包裹 if (e.ColumnIndex == 6) { DataGridViewDisableButtonCell btnCell = (DataGridViewDisableButtonCell)dataGridView1.Rows[e.RowIndex].Cells[deletePackageColName]; if (btnCell.Enabled) { DialogResult dr = MessageBox.Show("确认操作", "Information", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation); if (dr == DialogResult.Cancel) { return; } BoxsManager.GetInstance().ClearBox(code); //MessageBox.Show(issuccess.ToString()); UpdateData(); bool issuccess = pm.TakePackage(code, 2); CLog4net.LogInfo("管理员删除包裹:" + code + " success:" + issuccess); ServerCallback3 sc = serverService.ManagerDeletePackage(code.ToString(), AboutConfig.GetInstance().GetAbout()); if (!sc.Success) { CLog4net.LogInfo("管理员删除包裹失败:" + code + " 服务器信息:" + sc.Message); //return; //如果是因为服务器找不到需要删除的包裹,删包裹失败返回,那么客户端箱子将永远不能清空; } } } //disable box if (e.ColumnIndex == 7) { DialogResult dr = MessageBox.Show("确认操作", "Information", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation); if (dr == DialogResult.Cancel) { return; } //DataGridViewDisableButtonCell btnCell = (DataGridViewDisableButtonCell)dataGridView1.Rows[e.RowIndex].Cells["open"]; if (bm.Find(code).CurrentState == Box.State.Fault) { bm.EnableBox(code); //btnCell.Enabled = true; UpdateData(); CLog4net.LogInfo("管理员启用箱子:" + code); } else { bm.DisableBox(code); UpdateData(); CLog4net.LogInfo("管理员停用箱子:" + code); } } } catch (Exception ex) { CLog4net.LogError("管理员操作异常:" + ex.ToString()); } }
public FrmPassword() { InitializeComponent(); about = AboutConfig.GetInstance().GetAbout(); }
public static void begin() { YDColorizer.GlobalException.Initialize(); Timer timer = new Timer(); #region 配置文件不存在,创建默认配置文件 if (Config.IsConfigExists() == false) { Config.CreateDefault(); } #endregion Program.language = Config.GetLanguage(); List <string> dialogBoxTitles = AboutConfig.LoadSearchTitles(); #region 托盘图标 if (Config.IsNotifyIconVisible() == true) { NotifyIcon notifyIcon = new NotifyIcon(); notifyIcon.Icon = YDColorizer.Properties.Resources.icoYDColorizerRuning; switch (Program.language) { case 0: notifyIcon.Text = "YDWE颜色插件正在执行" + Environment.NewLine + "点击图标可以暂时停止执行"; break; case 1: notifyIcon.Text = "YDWE顏色插件正在執行" + Environment.NewLine + "點擊圖標可以暫時停止執行"; break; default: break; } notifyIcon.Visible = true; notifyIcon.Click += new EventHandler((object object_sender, EventArgs EventArgs_e) => { if (timer.Enabled == true) { timer.Enabled = false; notifyIcon.Icon = YDColorizer.Properties.Resources.icoYDColorizerStop; switch (Program.language) { case 0: notifyIcon.Text = "YDWE颜色插件已暂停" + Environment.NewLine + "点击图标可以恢复执行"; break; case 1: notifyIcon.Text = "YDWE顏色插件已暫停" + Environment.NewLine + "點擊圖標可以恢復執行"; break; default: break; } } else { timer.Enabled = true; notifyIcon.Icon = YDColorizer.Properties.Resources.icoYDColorizerRuning; switch (Program.language) { case 0: notifyIcon.Text = "YDWE颜色插件正在执行" + Environment.NewLine + "点击图标可以暂时停止执行"; break; case 1: notifyIcon.Text = "YDWE顏色插件正在執行" + Environment.NewLine + "點擊圖標可以暫時停止執行"; break; default: break; } } }); } #endregion timer.Interval = 100;// 设置搜索间隔为100毫秒 EditDialogBox edb = new EditDialogBox(); timer.Tick += new EventHandler((object object_sender, EventArgs EventArgs_e) => { try { if (edb.hWnd == IntPtr.Zero) { foreach (var title in dialogBoxTitles) // 遍历标题数组寻找对话框 { WinApi.Window dialogBox = new WinApi.Window(DialogBoxClassName, title); // 搜索we物体编辑器的文本编辑框 if (dialogBox.Handle != IntPtr.Zero) // 找到 { int thisProcessId = System.Diagnostics.Process.GetCurrentProcess().Id; int targetProcessId = AboutProcess.GetProcessId(dialogBox.Handle); if (thisProcessId == targetProcessId) // 搜索的对话框与该ydwe插件同进程 { edb.AttachDialog(dialogBox.Handle); // 重建模拟窗口 break; } } } } } catch (Exception e) { timer.Stop(); GlobalException.CatchException(e, e.ToString()); } }); timer.Start();// 启动搜索计时器 }