Example #1
0
        //传菜 - 调用远程服务 - 异步传输
        public static bool TransFood_Rmt_Async(string FoodCode, string TableType, string Tableno, string PsnCount, string billno, string FoodName, string TypeName, string DeptName, string unit, string quantity, string operandi, string taste, string operatorid, string barcode, int OperateCode, string CancelRsn)
        {
            bool ret=false;
            if (! AllowRemoteOperation)
            {
                ret=false;
            }
            //判断代理是否被创建
            if (svrobj == null)
            {
                //引发错误
                //Err.Raise(8000, "无法创建代理")
                MessageBox.Show("可能的原因是启用了点菜后自动远程传菜,但远程服务程序却没有启动。" + '\r' + '\r' + "如果问题依然存在请联系系统供应商。");
                return false;
            }
            //代理创建成功

            AsyncCallback cb;
            cb = new AsyncCallback(TransFoodCallBack);
            TransFoodDelegate d;
            d = new TransFoodDelegate(svrobj.TransFood);
            IAsyncResult ar;
            ar = d.BeginInvoke(FoodCode, TableType, Tableno, PsnCount, billno, FoodName, TypeName, DeptName, unit, quantity, operandi, taste, operatorid, barcode, OperateCode, CancelRsn, cb, 0);

            ret=true;
            return ret;
        }
Example #2
0
            //传菜 - 调用远程服务 - 异步传输
            public static bool TransFood_Rmt_Async(string FoodCode, string TableType, string Tableno, string PsnCount, string billno, string FoodName, string TypeName, string DeptName, string unit, string quantity, string operandi, string taste, string operatorid, string barcode, int OperateCode, string CancelRsn)
            {
                try
                {
                    if (!AllowRemoteOperation)
                    {
                        return false;
                    }
                    //On Error Goto Errorhandler VBConversions Warning: On Error Goto not supported in C#
                    //判断代理是否被创建
                    if (svrobj == null)
                    {
                        //引发错误
                        //Err.Raise(8000, "无法创建代理")
                        return false;
                    }
                    //代理创建成功

                    AsyncCallback cb;
                    cb = new AsyncCallback(TransFoodCallBack);
                    TransFoodDelegate d;
                    d = new TransFoodDelegate(svrobj.TransFood);
                    IAsyncResult ar;
                    ar = d.BeginInvoke(FoodCode, TableType, Tableno, PsnCount, billno, FoodName, TypeName, DeptName, unit, quantity, operandi, taste, operatorid, barcode, OperateCode, CancelRsn, cb, 0);

                    return true;
                }
                catch (Exception e)
                {
                    MessageBox.Show(e.Message + '\r' + '\r' + "如果问题依然存在请联系系统供应商。");
                    return false;
                }
            }