public frmManager() { InitializeComponent(); pm = PackageManager.GetInstance(); bm = BoxsManager.GetInstance(); serverService = ServicesFactory.GetInstance().GetServerService(); enu = bm.BoxsDictionary.GetEnumerator(); dataGridView1.AllowUserToAddRows = false; DataGridViewDisableButtonColumn openCol = new DataGridViewDisableButtonColumn(); openCol.Name = openColName; DataGridViewDisableButtonColumn deletePackageCol = new DataGridViewDisableButtonColumn(); deletePackageCol.Name = deletePackageColName; DataGridViewDisableButtonColumn boxStateCol = new DataGridViewDisableButtonColumn(); boxStateCol.Name = boxStateColName; dataGridView1.Columns.Add(openCol); dataGridView1.Columns.Add(deletePackageCol); dataGridView1.Columns.Add(boxStateCol); Initialize(); UpdateData(); }
public void Load() { this.Initialize(); this.boxControlService = ServicesFactory.GetInstance().GetBoxControlService(); this.boxControlService.Init(); CLog4net.LogInfo("BoxsManager is Loaded"); }
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("启动完成"); }
public FrmSavaPackage(int seconds, string num, int count) : this() { ServicesFactory.GetInstance().GetVoicService().BroadcastOnce("您选择的柜子是" + num + "号,请放入包裹并关闭柜门,谢谢!"); this.labelXInfo.Text = string.Format("<div align='center'>您选择的柜子是<b><font size='+15' color='red'>{0}</font></b>号,还有<font size='+15' color='orange'>{1}</font>次重选机会</div>", num, count); //您选的柜门是<b><font size="+15" color="red">11</font></b>号,还有3次重选机会 this.buttonXCancel.Enabled = true ? count > 0 : false; this.seconds = seconds; this.timerMain.Interval = 1000; this.timerMain.Enabled = true; this.timerMain.Start(); }
public void ShowCurrentModle(About a) { switch (a.Model) { case "a": this.qrCodeGraphicControl1.Visible = false; ServicesFactory.GetInstance().GetVoicService().BroadcastOnce("请输入取件密码"); this.labelX3.Text = "请输入取件密码"; break; case "b": this.qrCodeGraphicControl1.Visible = true; this.qrCodeGraphicControl1.Text = a.CabinetCode; ServicesFactory.GetInstance().GetVoicService().BroadcastOnce("请扫描二维码或输入取件密码"); this.labelX3.Text = "请扫描二维码或输入取件密码"; break; case "c": this.qrCodeGraphicControl1.Visible = false; ServicesFactory.GetInstance().GetVoicService().BroadcastOnce("请扫描二维码或输入取件密码"); this.labelX3.Text = "请扫描二维码或输入取件密码"; if (this.vguangQR == null) { this.vguangQR = new VGuangQR(); this.vguangQR.Load(); try { //设置扫码成功时的回调 VGuangQR.decodeCall = new VGuangQR.DecodeCallBack(decodeCallBackStr); VGuangQR.setDecodeCallBack(VGuangQR.decodeCall); //设置设备状态变化时回调 VGuangQR.deviceStatusCall = new VGuangQR.DeviceStatusCallBack(deviceStatusCallBack); VGuangQR.setDeviceStatusCallBack(VGuangQR.deviceStatusCall); } catch (Exception e) { CLog4net.LogError(e); } } else { this.vguangQR.OpenDevice(); } break; default: this.qrCodeGraphicControl1.Visible = false; ServicesFactory.GetInstance().GetVoicService().BroadcastOnce("请输入取件密码"); this.labelX3.Text = "请输入取件密码"; break; } }
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("启动完成"); }
private void confirmChooseBox_Click(object sender, EventArgs e) { if (this.checkedBox != null) { if (confirmEvent != null) { confirmEvent(checkedBox, e); } } else { errMsg.Text = "请先选取合适柜子"; ServicesFactory.GetInstance().GetVoicService().BroadcastOnce("请先选取合适柜子"); } }
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("修改成功"); }
private void confirm_Click(object sender, EventArgs e) { string oldpassword = txtoldPassWord.Text; string newpassword = txtnewPassWord.Text; string repeatpassword = txtrepeatPassWord.Text; if (oldpassword != about.ManagerPassword) { MessageBox.Show("旧密码错误"); return; } if (newpassword != repeatpassword) { MessageBox.Show("密码不一致"); return; } if (newpassword.Length < 6) { MessageBox.Show("密码长度必须大于5个字符"); return; } if (newpassword == oldpassword) { MessageBox.Show("新旧密码不能一样"); return; } else { DatabaseService service = ServicesFactory.GetInstance().GetDatabaseService(); bool success = service.UpdateAboutPassword(repeatpassword); if (success) { about.ManagerPassword = repeatpassword; MessageBox.Show("密码修改成功"); } else { MessageBox.Show("密码修改失败"); } this.Close(); } }
public void Load() { this.about = ServicesFactory.GetInstance().GetDatabaseService().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 Courier(string id, string pwd) { this.code = id; this.password = pwd; this.service = ServicesFactory.GetInstance().GetServerService(); }
public Box() { this.isIdle = true;//初始默认柜子是空的 this.service = ServicesFactory.GetInstance().GetBoxControlService(); //this.currentState = service.GetCurrentState(code); }
private static bool HasStockBy(string bookName) { return(ServicesFactory <IBooksService> .GetInstance().HasStockBy(bookName)); }
public Cabinet() { this.isIdle = true;//初始默认柜子是空的 this.service = ServicesFactory.GetInstance().GetCabinetControlService(); }
public Courier(int id, string pwd) { this.id = id; this.password = pwd; this.service = ServicesFactory.GetInstance().GetCourierService(); }
private InfoCenterLister() { this.serverService = ServicesFactory.GetInstance().GetServerService(); this.GetInfoLogic(); this.lastDojobTime = System.Environment.TickCount; }
private CommLister() { this.serverService = ServicesFactory.GetInstance().GetServerService(); }
public Courier(string id) { this.code = id; this.service = ServicesFactory.GetInstance().GetServerService(); }