/// <summary> /// 菜单—节能设置 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Menu_Energy_Click(object sender, RoutedEventArgs e) { if (!PubHelper.CheckIsManager1Purview("14")) { return; } StopMonOutTime(); bool blnIsControlCircle = false; for (int i = 0; i < PubHelper.p_BusinOper.AsileOper.VendBoxList.Count; i++) { if (PubHelper.p_BusinOper.AsileOper.VendBoxList[i].IsControlCircle == "1") { blnIsControlCircle = true; break; } } if (!blnIsControlCircle) { // 如果没有回路控制回路板,则不能使用节能设置 PubHelper.ShowMsgInfo(PubHelper.p_LangOper.GetStringBundle("Err_NoControlCircle"), PubHelper.MsgType.Ok); m_IsMonTime = true; return; } FrmEnergyCfg frmEnergyCfg = new FrmEnergyCfg(); frmEnergyCfg.ShowDialog(); m_IsMonTime = true; }
/// <summary> /// 减少弹簧圈数 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void DeleteInventory(object sender, MouseButtonEventArgs e) { if (!PubHelper.CheckIsManager1Purview("11")) { return; } SetProductInventory(-1); }
/// <summary> /// 按钮—选择商品 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnSelectGoods_Click(object sender, RoutedEventArgs e) { if (!PubHelper.CheckIsManager1Purview("12")) { return; } PubHelper.p_BusinOper.GoodsOper.CurrentGoods = null; FrmGoodsChoice frmGoodsChoice = new FrmGoodsChoice(); frmGoodsChoice.ShowDialog(); if ((PubHelper.p_BusinOper.GoodsOper.CurrentGoods != null) && (currentGoodsWay.CurrentGoodsWayProduct != null)) { GoodsModel mcdInfo = new GoodsModel(); mcdInfo.McdCode = PubHelper.p_BusinOper.GoodsOper.CurrentGoods.McdCode; mcdInfo.McdName = PubHelper.p_BusinOper.GoodsOper.CurrentGoods.McdName; mcdInfo.McdContent = PubHelper.p_BusinOper.GoodsOper.CurrentGoods.McdContent; mcdInfo.PicName = PubHelper.p_BusinOper.GoodsOper.CurrentGoods.PicName; bool result = PubHelper.p_BusinOper.UpdateAsileGoods(currentGoodsWay.CurrentGoodsWayProduct.PaCode, mcdInfo); if (result) { PubHelper.p_IsRefreshAsile = true; if (PubHelper.p_BusinOper.ConfigInfo.GoodsShowModel == BusinessEnum.GoodsShowModelType.GoodsType) { PubHelper.p_IsRefreshGoodsType = true; } // 更改货道商品显示 tbMcdCode_Value.Text = mcdInfo.McdCode; tbMcdName_Value.Text = mcdInfo.McdName; tbMcdContent_Value.Text = mcdInfo.McdContent; currentGoodsWay.CurrentGoodsWayProduct.McdCode = tbMcdCode_Value.Text; currentGoodsWay.CurrentGoodsWayProduct.McdName = tbMcdName_Value.Text; currentGoodsWay.CurrentGoodsWayProduct.McdPicName = mcdInfo.PicName; currentGoodsWay.CurrentGoodsWayProduct.McdContent = mcdInfo.McdContent; SetAsileInfo(currentGoodsWay); currentGoodsWay.SetAsilePic(); if (!string.IsNullOrEmpty(mcdInfo.McdCode)) { if (PubHelper.p_BusinOper.ConfigInfo.GoodsShowModel != BusinessEnum.GoodsShowModelType.GoodsToOnlyAsile) { // 如果商品展示模式不是商品对应货道模式,则不能做移除商品处理 btnRemoveGoods.IsEnabled = false; } else { btnRemoveGoods.IsEnabled = true; } } } else { PubHelper.ShowMsgInfo(PubHelper.p_LangOper.GetStringBundle("Pub_OperFail"), PubHelper.MsgType.Ok); } } }
////private void tbAsilePrice_Value_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) ////{ //// if (PubHelper.CheckIsManager1Purview("10")) //// { //// return; //// } //// FrmKeyboard frmKeyBoard = new FrmKeyboard(); //// frmKeyBoard.ShowDialog(); ////} ////private void tbAsilePrice_Value_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) ////{ //// if (PubHelper.CheckIsManager1Purview("10")) //// { //// return; //// } //// FrmKeyboard frmKeyBoard = new FrmKeyboard(); //// frmKeyBoard.ShowDialog(); ////} private void tbAsilePrice_Value_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) { if (!PubHelper.CheckIsManager1Purview("10")) { return; } PubHelper.ShowKeyBoard(tbAsilePrice_Value.Text); tbAsilePrice_Value.Text = PubHelper.p_Keyboard_Input; }
/// <summary> /// 菜单—广告设置 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Menu_Advert_Click(object sender, RoutedEventArgs e) { if (!PubHelper.CheckIsManager1Purview("21")) { return; } StopMonOutTime(); FrmAdvert frmAdvert = new FrmAdvert(); frmAdvert.ShowDialog(); m_IsMonTime = true; }
/// <summary> /// 菜单—商品管理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Menu_Goods_Click(object sender, RoutedEventArgs e) { if (!PubHelper.CheckIsManager1Purview("16")) { return; } StopMonOutTime(); FrmGoodsManager frmGoodsManager = new FrmGoodsManager(); frmGoodsManager.ShowDialog(); m_IsMonTime = true; }
/// <summary> /// 菜单—销售模式 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Menu_SaleModel_Click(object sender, RoutedEventArgs e) { if (!PubHelper.CheckIsManager1Purview("15")) { return; } StopMonOutTime(); FrmSaleModel frmSaleModel = new FrmSaleModel(); frmSaleModel.ShowDialog(); m_IsMonTime = true; }
/// <summary> /// 菜单—制冷设置 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Menu_RefCfg_Click(object sender, RoutedEventArgs e) { if (!PubHelper.CheckIsManager1Purview("13")) { return; } StopMonOutTime(); FrmRefriCfg frmRefriCfg = new FrmRefriCfg(); frmRefriCfg.ShowDialog(); m_IsMonTime = true; }
/// <summary> /// 菜单—硬件设备维护 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Menu_DeviceCfg_Click(object sender, RoutedEventArgs e) { if (!PubHelper.CheckIsManager1Purview("20")) { return; } PubHelper.p_BusinOper.OperStep = BusinessEnum.OperStep.DeviceCfg; StopMonOutTime(); FrmDeviceCfg frmDeviceCfg = new FrmDeviceCfg(); frmDeviceCfg.ShowDialog(); m_IsMonTime = true; PubHelper.p_BusinOper.OperStep = BusinessEnum.OperStep.Main; }
/// <summary> /// 菜单—货道测试 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Menu_AsileTest_Click(object sender, RoutedEventArgs e) { if (!PubHelper.CheckIsManager1Purview("19")) { return; } PubHelper.p_BusinOper.OperStep = BusinessEnum.OperStep.AsileTest; StopMonOutTime(); ////FrmGoodsTypeTest frmGoodsTypeTest = new FrmGoodsTypeTest(); ////frmGoodsTypeTest.ShowDialog(); FrmAsileTest frmAsileTest = new FrmAsileTest(); frmAsileTest.ShowDialog(); m_IsMonTime = true; PubHelper.p_BusinOper.OperStep = BusinessEnum.OperStep.Main; }
private void Menu_BaseCfg_Click(object sender, RoutedEventArgs e) { if (!PubHelper.CheckIsManager1Purview("22")) { return; } StopMonOutTime(); FrmBaseCfg frmBaseCfg = new FrmBaseCfg(); frmBaseCfg.ShowDialog(); // 检测语言是否更改 if (PubHelper.p_IsRefreshLanguage) { InitFormControl(); } m_IsMonTime = true; }
/// <summary> /// 菜单—库存设置 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Menu_Stock_Click(object sender, RoutedEventArgs e) { if (!PubHelper.CheckIsManager1Purview("17")) { return; } StopMonOutTime(); if (PubHelper.p_BusinOper.ConfigInfo.IsRunStock == BusinessEnum.ControlSwitch.Stop) { // 不启用库存 PubHelper.ShowMsgInfo(PubHelper.p_LangOper.GetStringBundle("Err_StockStop"), PubHelper.MsgType.Ok); m_IsMonTime = true; return; } FrmStock frmStock = new FrmStock(); frmStock.ShowDialog(); m_IsMonTime = true; }
/// <summary> /// 按钮—移除货道商品 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnRemoveGoods_Click(object sender, RoutedEventArgs e) { if (!PubHelper.CheckIsManager1Purview("12")) { return; } string strPaCode = currentGoodsWay.CurrentGoodsWayProduct.PaCode; string strAskInfo = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AsileCfg_RemoveAsk"); strAskInfo = strAskInfo.Replace("{N}", strPaCode); PubHelper.ShowMsgInfo(strAskInfo, PubHelper.MsgType.YesNo); if (PubHelper.p_MsgResult) { bool result = PubHelper.p_BusinOper.RemoveAsileGoods(strPaCode); if (result) { PubHelper.p_IsRefreshAsile = true; if (PubHelper.p_BusinOper.ConfigInfo.GoodsShowModel == BusinessEnum.GoodsShowModelType.GoodsType) { PubHelper.p_IsRefreshGoodsType = true; } currentGoodsWay.CurrentGoodsWayProduct.McdCode = string.Empty; currentGoodsWay.CurrentGoodsWayProduct.McdName = string.Empty; currentGoodsWay.CurrentGoodsWayProduct.McdContent = string.Empty; tbMcdCode_Value.Text = tbMcdContent_Value.Text = tbMcdName_Value.Text = string.Empty; SetAsileInfo(currentGoodsWay); currentGoodsWay.SetAsilePic(); } else { PubHelper.ShowMsgInfo(PubHelper.p_LangOper.GetStringBundle("Pub_OperFail"), PubHelper.MsgType.Ok); } } }
/// <summary> /// 按钮—托盘设置价格 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnSetTray_Click(object sender, RoutedEventArgs e) { if (!PubHelper.CheckIsManager1Purview("10")) { return; } string strAsilePrice = tbAsilePrice_Value.Text; #region 检查数据有效性 string _errInfo = string.Empty; if (!PubHelper.CheckInputPrice(strAsilePrice, out _errInfo)) { // 金额格式错误 PubHelper.ShowMsgInfo(_errInfo, PubHelper.MsgType.Ok); return; } double dblAsilePrice = Convert.ToDouble(strAsilePrice) * PubHelper.p_BusinOper.ConfigInfo.DecimalNum; #endregion #region 保存托盘价格 string strAskInfo = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AsileCfg_TrayAsk"); strAskInfo = strAskInfo.Replace("{N}", PubHelper.p_BusinOper.ChangeTray((currentTrayIndex + 1).ToString())); strAskInfo = strAskInfo.Replace("{K}", strAsilePrice); PubHelper.ShowMsgInfo(strAskInfo, PubHelper.MsgType.YesNo); if (PubHelper.p_MsgResult) { ControlAsile(false); btnCancel.IsEnabled = false; DispatcherHelper.DoEvents(); PubHelper.p_BusinOper.AsileOper.Asile_Temp.TrayIndex = currentTrayIndex; PubHelper.p_BusinOper.AsileOper.Asile_Temp.SellPrice = dblAsilePrice.ToString(); InitOper(); m_OperType = "1"; // 启动保存操作线程 Thread TrdOper = new Thread(new ThreadStart(OperTrd)); TrdOper.IsBackground = true; TrdOper.Start(); int delayTime = 0; while (!m_IsOper) { Thread.Sleep(50); delayTime++; if (delayTime > 200) { break; } } ////bool result = PubHelper.p_BusinOper.UpdateTrayPrice(currentTrayIndex.ToString(), //// dblAsilePrice.ToString(), m_VendBoxCode); if (m_OperResult) { PubHelper.p_IsRefreshAsile = true; currentGoodsWay.CurrentGoodsWayProduct.SellPrice = dblAsilePrice.ToString(); #region 更新该托盘内的所有货道价格 int intAsileCount = panelAsile.Children.Count; for (int asileIndex = 0; asileIndex < intAsileCount; asileIndex++) { GoodsWayProduct productControl = (GoodsWayProduct)panelAsile.Children[asileIndex]; if (productControl.CurrentGoodsWayProduct != null) { productControl.SetSecondText(PubHelper.p_BusinOper.MoneyIntToString(dblAsilePrice.ToString()) + "【" + productControl.CurrentGoodsWayProduct.SpringNum + "】"); } } #endregion PubHelper.ShowMsgInfo(PubHelper.p_LangOper.GetStringBundle("Pub_OperSuc"), PubHelper.MsgType.Ok); } else { PubHelper.ShowMsgInfo(PubHelper.p_LangOper.GetStringBundle("Pub_OperFail"), PubHelper.MsgType.Ok); } ControlAsile(true); btnCancel.IsEnabled = true; } #endregion }