int hkCaseDetailMgrEdit_KeyHandlerDelegate(int vkCode, string clsName) { if (clsName.Equals("CaseDetailMgrEdit")) { if (vkCode == VirtualKey.VK_ENTER) { CaseDetailEditOKHandler(); return(-1); } if (vkCode == VirtualKey.VK_ESCAPE) { CaseDetailEditCancelHandler(); return(-1); } if (vkCode == VirtualKey.VK_F1) { CaseDetailEditDeleteHandler(); return(-1); } if (vkCode == VirtualKey.VK_F7) { GlobalShare.ContinuousScan(); return(-1); } } return(0); }
public Form1(JdUnion_GoodsDataLoadClass jdc) { InitializeComponent(); try { if (jdc == null) { jdc = new JdUnion_GoodsDataLoadClass(); } if (!Program.WCS_Inited) { GlobalShare.MainAssem = Assembly.GetExecutingAssembly(); GlobalShare.AppDllPath = Application.StartupPath; GlobalShare.Init(Application.StartupPath); Program.ForceLogin(); } } catch (Exception ce) { jdc.UpdateText(ce.Message); return; } currJdc = jdc; bool inited = JdUnion_GlbObject.Inited; //JdGoodsQueryClass.LoadAllcommissionGoods = loadAllData; downloadTimer = new System.Windows.Forms.Timer(); downloadTimer.Interval = 6 * 60 * 60 * 1000;//6小时 downloadTimer.Tick += DownloadTimer_Tick; downloadTimer.Enabled = false; jdc.UpdateText?.Invoke("京东数据接受模块界面加载成功!"); }
public static string GetValue(string val, DataGridColumn dc, string uid) { if (dc.DataType == "date") { DateTime dt; DateTime.TryParse(val, out dt); return(dt.ToShortDateString()); } if (dc.ComboName == "") { dc.ComboName = GlobalShare.DataPointMappings[dc.dpt.Name].ComboName; } if (dc.DataType == "calcexpr") { CalcExpr ce = new CalcExpr(); HandleBase hb = ce.GetHandleClass(dc.Method, dc.CalcExpr); val = hb.Handle(); } if ((dc.DataType == "combo" || dc.DataType == "datacombo") && dc.ComboName != null && dc.ComboName.Trim().Length > 0) { DataChoice dcc = null; if (dc.DataType == "combo") { dcc = GlobalShare.GetGlobalChoice(dc.Owner.frmhandle.strUid, dc.ComboName); } else { DataComboBox dcb = new DataComboBox(dc.ComboName, uid); dcb.TextField = dc.TextField; dcb.ValueField = dc.ValueField; dcb.ComboItemsSplitString = dc.ComboItemsSplitString; List <DataChoiceItem> dcis = dcb.GetDataSource(); dcc = new DataChoice(); dcc.Options.AddRange(dcis.ToArray()); } if (dcc != null) { DataChoiceItem dci = dcc.FindChoiceByValue(val); if (dci != null) { return(dci.Text); } } } return(val); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); try { GlobalShare.MainAssem = Assembly.GetExecutingAssembly(); GlobalShare.AppDllPath = Application.StartupPath; GlobalShare.Init(Application.StartupPath); ForceLogin(); WCS_Inited = true; } catch (Exception ce) { return; } Application.Run(new Form1(null)); }
public void LoadToolBar() { //toolbarbld = new ToolBarBuilder(frm, ToolBar); string strFilePath = ""; string strClsName = this.ToString(); string[] strArr = strClsName.Split('.'); string strFolderName = ""; string strFileName = ""; if (strArr.Length >= 3) { strFolderName = strArr[strArr.Length - 2]; strFileName = strArr[strArr.Length - 1]; } strFilePath = string.Format("{0}\\{1}\\frm_{1}_{2}_{3}.xml", "", frm.strModule, frm.strScreen, frm.strTarget); XmlDocument xmldoc = GlobalShare.GetXmlFile(strFilePath); if (xmldoc == null) { throw new Exception(string.Format("can't load xml file {0}!", strFilePath)); } string tbdir = XmlUtil.GetSubNodeText(xmldoc.SelectSingleNode("root"), "@RightToLeft"); toolbarbld.InitToolBar(tbdir == "1"); /* * this.toolStrip1.Items.Clear(); * string tbdir = XmlUtil.GetSubNodeText(xmldoc.SelectSingleNode("root"), "@RightToLeft"); * if (tbdir == "1") * { * this.toolStrip1.RightToLeft = RightToLeft.Yes; * }*/ AddComboInToolBar(xmldoc); AddButtonInToolBar(xmldoc); AddSimpleSearchInToolBar(xmldoc); }
public XmlDocument GetConfigXml(string flag) { string strFilePath = string.Format("{0}\\{1}\\{4}_{1}_{2}_{3}.xml", "", strModule, strScreen, strTarget, flag); return(GlobalShare.UpdateWithUseInfo(GlobalShare.GetXmlFile(strFilePath), strUid) as XmlDocument); }
int hkCaseMgr_KeyHandlerDelegate(int vkCode, string clsName) { int result = 0; if (clsName.Equals("hkCaseMgr")) { switch (vkCode) { case VirtualKey.VK_F1: CaseAddHandler(); result = -1; break; case VirtualKey.VK_BACK: CaseDelHandler(); result = -1; break; case VirtualKey.VK_0: KeyPressHandler("0"); result = -1; break; case VirtualKey.VK_1: KeyPressHandler("1"); result = -1; break; case VirtualKey.VK_2: KeyPressHandler("2"); result = -1; break; case VirtualKey.VK_3: KeyPressHandler("3"); result = -1; break; case VirtualKey.VK_4: KeyPressHandler("4"); result = -1; break; case VirtualKey.VK_5: KeyPressHandler("5"); result = -1; break; case VirtualKey.VK_6: KeyPressHandler("6"); result = -1; break; case VirtualKey.VK_7: KeyPressHandler("7"); result = -1; break; case VirtualKey.VK_8: KeyPressHandler("8"); result = -1; break; case VirtualKey.VK_9: KeyPressHandler("9"); result = -1; break; case VirtualKey.VK_ESCAPE: hkCaseMgr.Stop(); Cls_Message.SendMessage("仓库拣货", "Main"); this.Close(); result = -1; break; case VirtualKey.VK_ENTER: EditCaseNumber(); result = -1; break; case VirtualKey.VK_RIGHT: ViewCaseNumberDetail(); result = -1; break; case VirtualKey.VK_F2: CaseDetailDifferHandler(); result = -1; break; case VirtualKey.VK_F3: ProductDetailHandler(); result = -1; break; case VirtualKey.VK_F4: if (wholeCase) { wholeCase = false; lblInvoiceTitle.ForeColor = Color.DarkRed; } else { wholeCase = true; lblInvoiceTitle.ForeColor = Color.Yellow; } result = -1; break; case VirtualKey.VK_F7: GlobalShare.ContinuousScan(); result = -1; break; } } return(result); }