예제 #1
0
        protected void AppendNCData(ref List <proc_WebSelectCargoStorageDetail_Result> list)
        {
            try
            {
                #region 查询数据

                string typeArgs          = "CargoInventory";
                string conditionArgs     = "20101";//参数是仓库编码//string.Empty;
                System.Data.DataTable dt = null;
                string queryMsg          = "";
                string msg = "";

                BasicInfoInvoke BasicInfoInvokeObj = BasicInfoInvokeFactory.CreateInstance(typeArgs, conditionArgs);

                if (BasicInfoInvokeObj.GetNCDataJoinRFID(out dt, out queryMsg) == false)
                {
                    ShowMessageBox("查询用友系统信息失败!详细信息:" + queryMsg);
                    return;
                }
                else
                {
                    List <StockPositionAndVolume> NCList = GetModelFromDataTable(dt, out msg);
                    if (NCList == null || NCList.Count == 0)
                    {
                        ShowMessageBox("查询用友系统信息失败!详细信息:" + msg);
                    }
                    else
                    {
                        foreach (proc_WebSelectCargoStorageDetail_Result spav in list)
                        {
                            StockPositionAndVolume NCSpav = (from r in NCList where r.WHCode == spav.WHCode && r.CargoCode == spav.CargoCode select r).FirstOrDefault <StockPositionAndVolume>();
                            if (NCSpav != null)
                            {
                                spav.NCCargoStockCount = (decimal)NCSpav.CargoStockCount;//将从用户系统查询出的信息附件到RFID系统查询出的结果上。
                            }
                        }
                    }
                }
                #endregion
            }
            catch (Exception ex)
            {
                ShowMessageBox("查询用友库存信息失败!", ex);
            }
            finally
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), Guid.NewGuid().ToString(), "hiddenWaitDiv('divWait');", true);//js提示
            }
        }
예제 #2
0
        protected void btnNCDataImport_Click(object sender, EventArgs e)
        {
            try
            {
                #region 查询数据

                string    typeArgs      = "Department";
                string    conditionArgs = "中国金币深圳经销中心";//string.Empty;
                DataTable dt            = null;
                string    queryMsg      = "";
                string    saveMsg       = "";

                BasicInfoInvoke BasicInfoInvokeObj = BasicInfoInvokeFactory.CreateInstance(typeArgs, conditionArgs);

                if (BasicInfoInvokeObj.GetNCDataJoinRFID(out dt, out queryMsg) == false)
                {
                    ShowMessageBox("查询用友系统信息失败!详细信息:" + queryMsg);
                    return;
                }
                else
                {
                    bool result = BasicInfoInvokeObj.SaveToRFID(dt, out saveMsg);
                    ShowMessageBox(result == true ? "数据导入成功!" : "数据导入失败!", new Exception(saveMsg));
                }

                #endregion

                //GridViewBind();//数据导入成功后重新绑定数据
                //gv_SpecList.DataBind();
                InitTree();//重新绑定部门信息
            }
            catch (Exception ex)
            {
                ShowMessageBox("数据导入失败!", ex);
            }
            finally
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), Guid.NewGuid().ToString(), "hiddenWaitDiv('divWait');", true);//js提示
            }
        }