示例#1
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="operateMode">操作模式</param>
        /// <param name="billNo">普通入库单号</param>
        public 普通入库物品清单(CE_BusinessOperateMode operateMode, string billNo)
        {
            InitializeComponent();

            SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer, true);
            UpdateStyles();

            m_operateMode = operateMode;
            m_billNo      = billNo;

            m_billInfo = ServerModuleFactory.GetServerModule <IOrdinaryInDepotBillServer>().GetBill(billNo);

            if (m_operateMode == CE_BusinessOperateMode.仓库核实)
            {
                btnAdd.Enabled       = false;
                btnDelete.Enabled    = false;
                btnDeleteAll.Enabled = false;
            }
            else
            {
                txtShelf.ReadOnly  = true;
                txtColumn.ReadOnly = true;
                txtLayer.ReadOnly  = true;

                if (m_operateMode == CE_BusinessOperateMode.查看)
                {
                    toolStrip1.Visible = false;
                }
            }

            m_queryResult = m_goodsServer.GetGoodsViewInfo(m_billNo);

            RefreshDataGridView(m_queryResult);

            StapleInfo.InitUnitComboBox(cmbUnit);

            // 添加数据定位控件
            m_dataLocalizer = new UserControlDataLocalizer(dataGridView1, this.Name,
                                                           UniversalFunction.SelectHideFields(this.Name, dataGridView1.Name, BasicInfo.LoginID));

            panelTop.Controls.Add(m_dataLocalizer);

            m_dataLocalizer.Dock = DockStyle.Bottom;

            if (BasicInfo.ListRoles.Contains(CE_RoleEnum.采购账务管理员.ToString()) ||
                BasicInfo.ListRoles.Contains(CE_RoleEnum.会计.ToString()))
            {
                label19.Visible      = true;
                label20.Visible      = true;
                numUnitPrice.Visible = true;
                numPrice.Visible     = true;
            }
            else
            {
                label19.Visible      = false;
                label20.Visible      = false;
                numUnitPrice.Visible = false;
                numPrice.Visible     = false;
            }
        }
示例#2
0
        private void 批量变更变速箱箱号_Load(object sender, EventArgs e)
        {
            string[] productType = null;

            if (!ServerModuleFactory.GetServerModule <IProductInfoServer>().GetAllProductType(out productType, out m_error))
            {
                MessageDialog.ShowErrorMessage(m_error);

                this.Close();
                return;
            }

            List <string> lstProductType = productType.ToList();

            lstProductType.RemoveAll(p => p.Contains(" FX"));

            cmbOldCVTType.Items.AddRange(lstProductType.ToArray());
            cmbNewCVTType.Items.AddRange(lstProductType.ToArray());

            this.cmbOldCVTType.SelectedIndexChanged -= new System.EventHandler(this.cmbCVTType_SelectedIndexChanged);
            this.cmbNewCVTType.SelectedIndexChanged -= new System.EventHandler(this.cmbCVTType_SelectedIndexChanged);

            cmbOldCVTType.Text = "RDC15-FB";
            cmbNewCVTType.Text = "RDC15-FB";

            this.cmbOldCVTType.SelectedIndexChanged += new System.EventHandler(this.cmbCVTType_SelectedIndexChanged);
            this.cmbNewCVTType.SelectedIndexChanged += new System.EventHandler(this.cmbCVTType_SelectedIndexChanged);
        }
示例#3
0
        /// <summary>
        /// 获取供应商信息对话框
        /// </summary>
        /// <returns>成功则返回获取到的对话框,失败返回null</returns>
        static public FormQueryInfo GetProviderInfoDialog(string strType)
        {
            IProviderServer            m_providerServer = ServerModuleFactory.GetServerModule <IProviderServer>();
            IQueryable <View_Provider> queryResult;

            if (!m_providerServer.GetAllProvider(out queryResult, out m_err))
            {
                MessageDialog.ShowErrorMessage(m_err);
                return(null);
            }
            queryResult = from r in queryResult
                          where r.是否在用 == true
                          select r;

            switch (strType)
            {
            case "零件合格供应商":
                queryResult = from r in queryResult
                              where r.零星采购供应商 == false
                              select r;
                break;

            default:
                break;
            }
            System.Data.DataTable dataTable = GlobalObject.GeneralFunction.ConvertToDataTable <View_Provider>(queryResult);
            FormQueryInfo         form      = new FormQueryInfo(dataTable);

            return(form);
        }
示例#4
0
        /// <summary>
        /// 查找物品
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnFindCode_Click(object sender, EventArgs e)
        {
            try
            {
                ClearControl();

                FormQueryInfo        form             = QueryInfoDialog.GetOrderFormGoodsDialog(m_billInfo.OrderBill_ID, true);
                IOrderFormInfoServer serviceOrderForm = ServerModuleFactory.GetServerModule <IOrderFormInfoServer>();
                View_B_OrderFormInfo orderInfo        = serviceOrderForm.GetOrderFormInfo(m_billInfo.OrderBill_ID);
                if (form != null && form.ShowDialog() == DialogResult.OK)
                {
                    txtCode.Text = (string)form.GetDataItem("图号型号");
                    txtName.Text = (string)form.GetDataItem("物品名称");
                    txtSpec.Text = (string)form.GetDataItem("规格");

                    IBargainGoodsServer serviceGoodsInfo = ServerModuleFactory.GetServerModule <IBargainGoodsServer>();
                    numUnitPrice.Value = serviceGoodsInfo.GetGoodsUnitPrice(m_billInfo.OrderBill_ID, Convert.ToInt32(form.GetDataItem("物品ID")), orderInfo.供货单位);

                    numGoodsAmount.Value = (decimal)form.GetDataItem("订货数量");

                    View_F_GoodsPlanCost planCost = GetBasicGoodsInfo(txtCode.Text, txtName.Text, txtSpec.Text, numUnitPrice.Value);

                    if (planCost != null)
                    {
                        cmbUnit.Text           = planCost.单位;
                        numPlanUnitPrice.Value = planCost.单价;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageDialog.ShowPromptMessage(ex.Message);
                return;
            }
        }
示例#5
0
        public 库房报缺查询(PlatformManagement.FunctionTreeNodeInfo nodeInfo)
        {
            InitializeComponent();

            dtp_End.Value = ServerTime.Time.AddDays(1);
            m_authFlag    = nodeInfo.Authority;

            cmbStorage.Items.Add("全部库房");
            DataTable dt = UniversalFunction.GetStorageTb();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                cmbStorage.Items.Add(dt.Rows[i]["StorageName"].ToString());
            }

            cmbStorage.SelectedIndex = 0;

            IBomServer    bomService = ServerModuleFactory.GetServerModule <IBomServer>();
            List <string> tempList   = bomService.GetAssemblyTypeList();

            cmbCVTType.DataSource  = tempList;
            cmbCVT_Plan.DataSource = tempList;

            cmbCustomTemplates.DataSource = m_serverLack.GetCustomTemplatesMain();

            cmbCustomTemplates.ValueMember   = "ID";
            cmbCustomTemplates.DisplayMember = "模板名称";
        }
        private void rbtnSplit_CheckedChanged(object sender, EventArgs e)
        {
            lblName.Text = "分  总  成";

            cmbPhase.Items.Clear();
            cmbPhase.Items.AddRange(
                ServerModuleFactory.GetServerModule <IAssemblingBom>().GetParentNames());
        }
示例#7
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            IElectronFileServer server = ServerModuleFactory.GetServerModule <IElectronFileServer>();

            this.dataGridView1.DataSource = server.GetCVTWeightInfo(dateTimePickerST.Value.Date, dateTimePickerET.Value.Date);

            userControlDataLocalizer1.Init(dataGridView1, this.Name,
                                           UniversalFunction.SelectHideFields(this.Name, dataGridView1.Name, BasicInfo.LoginID));
        }
示例#8
0
        /// <summary>
        /// 采购计划计算公式
        /// </summary>
        /// <returns>返回Table</returns>
        static public FormQueryInfo GetProcurementMath()
        {
            IPurcharsingPlan server = ServerModuleFactory.GetServerModule <IPurcharsingPlan>();
            DataTable        dt     = server.GetProcurementMath();

            FormQueryInfo form = new FormQueryInfo(dt);

            return(form);
        }
示例#9
0
        /// <summary>
        /// 获得供应商配额信息
        /// </summary>
        /// <returns>返回数据集</returns>
        static public FormQueryInfo GetGoodsLeastPackAndStock()
        {
            IGoodsLeastPackAndStock server = ServerModuleFactory.GetServerModule <IGoodsLeastPackAndStock>();
            DataTable dt = server.GetAllInfo();

            FormQueryInfo form = new FormQueryInfo(dt);

            return(form);
        }
示例#10
0
        /// <summary>
        /// 获得安全库存信息
        /// </summary>
        /// <returns>返回数据集</returns>
        static public FormQueryInfo GetSafeStock()
        {
            ISafeStockServer server = ServerModuleFactory.GetServerModule <ISafeStockServer>();
            DataTable        dt     = server.GetAllInfo();

            FormQueryInfo form = new FormQueryInfo(dt);

            return(form);
        }
        /// <summary>
        /// 获取出厂条形码生成规则信息对话框
        /// </summary>
        /// <returns></returns>
        static public FormQueryInfo GetBuildRuleForVehicleBarcode()
        {
            IProductBarcodeServer server = ServerModuleFactory.GetServerModule <IProductBarcodeServer>();
            IQueryable <View_P_BuildRuleForVehicleBarcode> result = server.GetBuildRule();

            FormQueryInfo form = new FormQueryInfo(result);

            return(form);
        }
        private void btnPrintBarCode_Click(object sender, EventArgs e)
        {
            try
            {
                if (dataGridView1.CurrentRow == null)
                {
                    throw new Exception("选择打印的条形码记录行不允许为空!");
                }

                List <View_S_InDepotGoodsBarCodeTable> lstBarCodeInfo = new List <View_S_InDepotGoodsBarCodeTable>();
                IBarCodeServer serviceBarCode = ServerModuleFactory.GetServerModule <IBarCodeServer>();

                foreach (DataGridViewRow dgvr in this.dataGridView1.SelectedRows)
                {
                    View_S_InDepotGoodsBarCodeTable barcode = new View_S_InDepotGoodsBarCodeTable();

                    QueryCondition_Store tempInfo = new QueryCondition_Store();

                    tempInfo.BatchNo   = dgvr.Cells["批次号"].Value.ToString();
                    tempInfo.GoodsID   = Convert.ToInt32(dgvr.Cells["物品ID"].Value);
                    tempInfo.Provider  = m_strProvider;
                    tempInfo.StorageID = m_strStorage;

                    S_Stock stockInfo = UniversalFunction.GetStockInfo(tempInfo);

                    View_F_GoodsPlanCost goodsInfo = UniversalFunction.GetGoodsInfo(tempInfo.GoodsID);

                    barcode.条形码 =
                        serviceBarCode.GetBarCode(stockInfo.GoodsID, stockInfo.BatchNo, stockInfo.StorageID, stockInfo.Provider);

                    barcode.图号型号   = goodsInfo.图号型号;
                    barcode.物品名称   = goodsInfo.物品名称;
                    barcode.规格     = goodsInfo.规格;
                    barcode.供货单位   = stockInfo.Provider;
                    barcode.批次号    = stockInfo.BatchNo;
                    barcode.货架     = stockInfo.ShelfArea;
                    barcode.层      = stockInfo.LayerNumber;
                    barcode.列      = stockInfo.ColumnNumber;
                    barcode.材料类别编码 = dgvr.Cells["退货数"].Value.ToString();
                    barcode.物品ID   = stockInfo.GoodsID;

                    lstBarCodeInfo.Add(barcode);
                }

                foreach (var item in lstBarCodeInfo)
                {
                    ServerModule.PrintPartBarcode.PrintBarcodeList(item, Convert.ToDecimal(item.材料类别编码));
                }

                MessageBox.Show("条码全部打印完成");
            }
            catch (Exception ex)
            {
                MessageDialog.ShowErrorMessage(ex.Message);
            }
        }
示例#13
0
        ///// <summary>
        ///// 获取指定用户计划价格表中的物品信息对话框,用户编码为null时获取所有信息
        ///// </summary>
        ///// <param name="userCode">用户编码</param>
        ///// <returns>成功则返回获取到的对话框,失败返回null</returns>
        //static public FormQueryInfo GetPlanCostGoodsDialog(string userCode)
        //{
        //    return GetPlanCostGoodsDialog(userCode, null);
        //}

        ///// <summary>
        ///// 获取指定用户计划价格表中的物品信息,用户编码为null时获取所有信息
        ///// </summary>
        ///// <param name="userCode">用户编码</param>
        ///// <param name="lstDepotCode">仓库类别列表</param>
        ///// <returns>成功则返回获取到的对话框,失败返回null</returns>
        //static private IQueryable<View_F_GoodsPlanCost> GetPlanCostGoods(string userCode, List<string> lstDepotCode)
        //{
        //    IBasicGoodsServer goodsServer = ServerModuleFactory.GetServerModule<IBasicGoodsServer>();
        //    IQueryable<View_F_GoodsPlanCost> queryResult = goodsServer.GetGoodsInfo(userCode, lstDepotCode);
        //    return queryResult;
        //}

        ///// <summary>
        ///// 获取指定用户计划价格表中的物品信息对话框,用户编码为null时获取所有信息
        ///// </summary>
        ///// <param name="userCode">用户编码</param>
        ///// <param name="lstDepotCode">仓库类别列表</param>
        ///// <returns>成功则返回获取到的对话框,失败返回null</returns>
        //static public FormQueryInfo GetPlanCostGoodsDialog(string userCode, List<string> lstDepotCode)
        //{
        //    IBasicGoodsServer goodsServer = ServerModuleFactory.GetServerModule<IBasicGoodsServer>();
        //    IQueryable<View_F_GoodsPlanCost> queryResult = goodsServer.GetGoodsInfo(userCode, lstDepotCode);
        //    System.Data.DataTable dataTable = GlobalObject.GeneralFunction.ConvertToDataTable<View_F_GoodsPlanCost>(queryResult);
        //    FormQueryInfo form = new FormQueryInfo(dataTable);

        //    form.ShowColumns = new string[] { "图号型号", "物品名称", "规格", "单位", "物品类别", "物品类别名称", "序号" };
        //    return form;
        //}

        /// <summary>
        /// 获取指定用户计划价格表中的物品信息对话框,用户编码为null时获取所有信息
        /// </summary>
        /// <param name="userCode">用户编码</param>
        /// <param name="lstDepotCode">仓库类别列表</param>
        /// <returns>成功则返回获取到的对话框,失败返回null</returns>
        static public FormQueryInfo GetPlanCostGoodsDialogSift(string strWhere)
        {
            IBasicGoodsServer goodsServer = ServerModuleFactory.GetServerModule <IBasicGoodsServer>();

            System.Data.DataTable dataTable = goodsServer.GetGoodsInfoSiftAttribute(strWhere);
            FormQueryInfo         form      = new FormQueryInfo(dataTable);

            form.ShowColumns = new string[] { "图号型号", "物品名称", "规格", "单位", "物品类别", "物品类别名称", "序号" };
            return(form);
        }
示例#14
0
        public 打印整台份返修箱条码()
        {
            InitializeComponent();

            dataGridView1.Columns["数量"].ValueType = typeof(int);

            cmbPurpose.DataSource    = ServerModuleFactory.GetServerModule <IMultiBatchPartServer>().GetPersonnelPurpose();
            cmbPurpose.DisplayMember = "装配用途名称";
            cmbPurpose.ValueMember   = "装配用途编号";
        }
示例#15
0
        /// <summary>
        /// 查找零件编码规格
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnFindCode_Click(object sender, EventArgs e)
        {
            IAssemblyInfoServer assemblyServer = ServerModuleFactory.GetServerModule <IAssemblyInfoServer>();
            FormQueryInfo       form           = new FormQueryInfo(assemblyServer.GetAllChoseConfectPartInfo());

            if (DialogResult.OK == form.ShowDialog())
            {
                txtCode.Text = form.GetDataItem("零件编码").ToString();
                txtSpec.Text = form.GetDataItem("规格").ToString();
            }
        }
示例#16
0
        ///// <summary>
        ///// 获取指定订单中属于仓库类别列表的物品信息对话框
        ///// </summary>
        ///// <param name="orderFormNumber">订单号</param>
        ///// <param name="simpleMode">是否是简单模式的标志, 是则只显示最基本的物品信息列(图号、名称、规格)</param>
        ///// <returns>成功则返回获取到的对话框,失败返回null</returns>
        //static public FormQueryInfo GetOrderFormGoodsDialog(string orderFormNumber, List<string> lstDepotType, bool simpleMode)
        //{
        //    IOrderFormGoodsServer orderFormGoodsServer = ServerModuleFactory.GetServerModule<IOrderFormGoodsServer>();
        //    IQueryable<View_B_OrderFormGoods> queryResult;

        //    if (!orderFormGoodsServer.GetOrderFormGoods(BasicInfo.ListRoles, BasicInfo.LoginID, orderFormNumber, out queryResult, out m_err))
        //    {
        //        MessageDialog.ShowErrorMessage(m_err);
        //        return null;
        //    }

        //    List<View_B_OrderFormGoods> orderFormGoods = queryResult.ToList();
        //    IQueryable<View_F_GoodsPlanCost> result = GetPlanCostGoods(null, lstDepotType);

        //    if (result != null || result.Count() == 0)
        //    {
        //        List<View_F_GoodsPlanCost> goodsInfo = result.ToList();

        //        for (int i = 0; i < orderFormGoods.Count; i++)
        //        {
        //            if (null == goodsInfo.Find(p => orderFormGoods[i].图号型号 == p.图号型号 && orderFormGoods[i].物品名称 == p.物品名称 && orderFormGoods[i].规格 == p.规格))
        //            {
        //                orderFormGoods.RemoveAt(i);
        //                i--;
        //            }
        //        }
        //    }


        //    System.Data.DataTable dataTable = GlobalObject.GeneralFunction.ConvertToDataTable(orderFormGoods);
        //    FormQueryInfo form = new FormQueryInfo(dataTable);

        //    if (simpleMode)
        //    {
        //        form.ShowColumns = new string[] { "图号型号", "物品名称", "规格" };
        //    }

        //    return form;
        //}

        /// <summary>
        /// 获取指定订单的物品在仓库中的信息对话框
        /// </summary>
        /// <param name="orderFormNumber">订单号</param>
        /// <returns>成功则返回获取到的对话框,失败返回null</returns>
        static public FormQueryInfo GetOrderFormGoodsStockInfoDialog(string orderFormNumber, string strStorageID)
        {
            IStoreServer server = ServerModuleFactory.GetServerModule <IStoreServer>();
            IQueryable <View_OrderFormGoodsStockInfo> queryResult = server.GetOrderFormGoodsStockInfo(orderFormNumber, strStorageID);

            //FormQueryInfo form = new FormQueryInfo(queryResult);
            System.Data.DataTable dataTable = GlobalObject.GeneralFunction.ConvertToDataTable <View_OrderFormGoodsStockInfo>(queryResult);
            FormQueryInfo         form      = new FormQueryInfo(dataTable);

            return(form);
        }
示例#17
0
        /// <summary>
        /// 获取计划价格表中的物品信息对话框
        /// </summary>
        /// <returns>成功则返回获取到的对话框,失败返回null</returns>
        static public FormQueryInfo GetPlanCostGoodsDialog(bool blUsing)
        {
            IBasicGoodsServer goodsServer = ServerModuleFactory.GetServerModule <IBasicGoodsServer>();
            IQueryable <View_F_GoodsPlanCost> queryResult = goodsServer.GetGoodsInfo(blUsing);

            System.Data.DataTable dataTable = GlobalObject.GeneralFunction.ConvertToDataTable <View_F_GoodsPlanCost>(queryResult);
            FormQueryInfo         form      = new FormQueryInfo(dataTable);

            form.ShowColumns = new string[] { "图号型号", "物品名称", "规格", "单位", "物品类别", "物品类别名称", "序号" };
            return(form);
        }
        private void cmbProductType_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cmbProductType.SelectedIndex == -1)
            {
                MessageDialog.ShowPromptMessage("请选择产品型号");
                return;
            }

            cmbParentName.Items.AddRange(
                ServerModuleFactory.GetServerModule <IAssemblingBom>().GetParentNames());
        }
        /// <summary>
        /// 从BOM中获取指定产品版本的零件信息对话框
        /// </summary>
        /// <param name="isAllInfo">是否获取所有零件信息的标志</param>
        /// <param name="isAssemblyFlag">当isAllInfo为false时判断是获取总成还是零件信息的标志</param>
        /// <returns>成功则返回获取到的对话框,失败返回null</returns>
        static public FormQueryInfo GetAccessoryInfoDialog(string productEdition, bool isAllInfo, bool isAssemblyFlag)
        {
            List <View_P_ProductBom>     bomInfo     = null;
            IEnumerable <GoodsBasicInfo> queryResult = null;

            if (m_dicProductBom.ContainsKey(productEdition))
            {
                bomInfo = m_dicProductBom[productEdition] as List <View_P_ProductBom>;
            }
            else
            {
                IBomServer server = ServerModuleFactory.GetServerModule <IBomServer>();

                bomInfo = server.GetBom(productEdition).ToList();
                m_dicProductBom[productEdition] = bomInfo;
            }

            if (!isAllInfo)
            {
                if (isAssemblyFlag)
                {
                    queryResult = (from r in bomInfo
                                   where r.是否为总成 > 0 //&& (r.父总成编码 != null)
                                   select new GoodsBasicInfo {
                        图号型号 = r.零部件编码, 物品名称 = r.零部件名称, 规格 = r.规格
                    });
                }
                else
                {
                    queryResult = (from r in bomInfo
                                   where r.是否为总成 == 0
                                   orderby r.零部件编码, r.规格
                                   select new GoodsBasicInfo {
                        图号型号 = r.零部件编码, 物品名称 = r.零部件名称, 规格 = r.规格
                    }).Distinct();
                }
            }
            else
            {
                queryResult = (from r in bomInfo
                               orderby r.零部件编码, r.规格
                               select new GoodsBasicInfo {
                    图号型号 = r.零部件编码, 物品名称 = r.零部件名称, 规格 = r.规格
                }).Distinct();
            }

            //FormQueryInfo form = new FormQueryInfo(queryResult);
            System.Data.DataTable dataTable = GlobalObject.GeneralFunction.ConvertToDataTable <GoodsBasicInfo>(queryResult);
            FormQueryInfo         form      = new FormQueryInfo(dataTable);

            //form.ShowColumns = new string[] { "图号型号", "物品名称", "规格" };
            return(form);
        }
        private void cmbSourceProductType_SelectedIndexChanged(object sender, EventArgs e)
        {
            txtSourceProductName.Text = (from r in m_productInfo
                                         where r.产品类型编码 == cmbSourceProductType.Text
                                         select r.产品类型名称).First();

            if (m_copyMode == CopyModeEnum.制分总成下属零件信息)
            {
                cmbParentName.Items.Clear();
                cmbParentName.Items.AddRange(
                    ServerModuleFactory.GetServerModule <IAssemblingBom>().GetParentNames(cmbSourceProductType.Text));
            }
        }
示例#21
0
        /// <summary>
        /// 获取供应商信息对话框
        /// </summary>
        /// <returns>成功则返回获取到的对话框,失败返回null</returns>
        static public FormQueryInfo GetProviderInfoDialog()
        {
            IProviderServer            m_providerServer = ServerModuleFactory.GetServerModule <IProviderServer>();
            IQueryable <View_Provider> queryResult;

            DepotManagementDataContext ctx = CommentParameter.DepotDataContext;

            if (!m_providerServer.GetAllProvider(out queryResult, out m_err))
            {
                MessageDialog.ShowErrorMessage(m_err);
                return(null);
            }
            queryResult = from r in queryResult
                          where r.是否在用 == true
                          select r;

            if (!BasicInfo.ListRoles.Contains(CE_RoleEnum.采购账务管理员.ToString()) &&
                BasicInfo.ListRoles.Contains(CE_RoleEnum.采购员.ToString()))
            {
                var varData = (from r in ctx.View_Provider
                               join f in ctx.ProviderPrincipal
                               on r.供应商编码 equals f.Provider
                               where f.PrincipalWorkId == BasicInfo.LoginID &&
                               r.是否在用 == true
                               select r).Distinct();

                List <View_Provider> lstProvider = new List <View_Provider>();

                foreach (var item in varData)
                {
                    View_Provider lnqProvider = new View_Provider();

                    lnqProvider.供应商编码   = item.供应商编码;
                    lnqProvider.供应商名称   = item.供应商名称;
                    lnqProvider.简称      = item.简称;
                    lnqProvider.拼音码     = item.拼音码;
                    lnqProvider.零星采购供应商 = item.零星采购供应商;
                    lnqProvider.是否在用    = item.是否在用;
                    lnqProvider.五笔码     = item.五笔码;

                    lstProvider.Add(lnqProvider);
                }

                queryResult = lstProvider.AsQueryable();
            }

            System.Data.DataTable dataTable = GlobalObject.GeneralFunction.ConvertToDataTable <View_Provider>(queryResult);
            FormQueryInfo         form      = new FormQueryInfo(dataTable);

            return(form);
        }
        /// <summary>
        /// 获取指定产品指定工位选配零件信息
        /// </summary>
        /// <param name="info">包含产品名称、工位号的输入参数</param>
        public Socket_FittingAccessoryInfo ReceiveReadChoseMatchInfo(string info)
        {
            string[] data        = info.Split(new char[] { ',' });
            string   productName = data[0];
            string   workBench   = data[1];

            Socket_FittingAccessoryInfo fittingAccessoryInfo = new Socket_FittingAccessoryInfo();

            IAssemblingBom server = ServerModuleFactory.GetServerModule <IAssemblingBom>();

            // 获取指定工位所有装配信息,包含多种产品
            IQueryable <View_P_AssemblingBom> queryResult     = server.GetInfoOfWorkBench(workBench);
            List <View_P_AssemblingBom>       choseMatchParts = (from r in queryResult
                                                                 where r.产品名称 == productName && r.是否选配零件
                                                                 select r).ToList();

            if (choseMatchParts == null || choseMatchParts.Count == 0)
            {
                fittingAccessoryInfo.OperateState = Socket_FittingAccessoryInfo.OperateStateEnum.该工位无选配零件;
                return(fittingAccessoryInfo);
            }

            fittingAccessoryInfo.ParentCode   = choseMatchParts[0].父总成编码;
            fittingAccessoryInfo.GoodsCode    = choseMatchParts[0].零件编码;
            fittingAccessoryInfo.GoodsName    = choseMatchParts[0].零件名称;
            fittingAccessoryInfo.Spec         = choseMatchParts[0].规格;
            fittingAccessoryInfo.Counts       = choseMatchParts[0].装配数量;
            fittingAccessoryInfo.AssemblyFlag = Convert.ToInt32(choseMatchParts[0].是否总成);

            DataTable table;
            string    error;

            if (!m_choseConfectServer.GetAccessoryChoseConfectInfo(choseMatchParts[0].零件编码, "", out table, out error))
            {
                if (error.Contains(Socket_FittingAccessoryInfo.OperateStateEnum.获取选配信息失败.ToString()))
                {
                    fittingAccessoryInfo.OperateState = Socket_FittingAccessoryInfo.OperateStateEnum.获取选配信息失败;
                }
                else
                {
                    fittingAccessoryInfo.OperateState = Socket_FittingAccessoryInfo.OperateStateEnum.该零件非选配零件;
                }
            }
            else
            {
                fittingAccessoryInfo.ChoseMatchInfo = BuildChoseMatchInfoDic(table);
                fittingAccessoryInfo.OperateState   = Socket_FittingAccessoryInfo.OperateStateEnum.操作成功;
            }

            return(fittingAccessoryInfo);
        }
示例#23
0
        private void 条形码打印ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (dataGridView1.SelectedRows.Count < 1)
            {
                MessageDialog.ShowPromptMessage("请选择记录后再打印条形码");
                return;
            }

            List <View_S_InDepotGoodsBarCodeTable> lstBarCodeInfo = new List <View_S_InDepotGoodsBarCodeTable>();

            for (int i = 0; i < dataGridView1.SelectedRows.Count; i++)
            {
                string goodsCode = dataGridView1.SelectedRows[i].Cells["图号型号"].Value.ToString();
                string goodsName = dataGridView1.SelectedRows[i].Cells["物品名称"].Value.ToString();
                string spec      = dataGridView1.SelectedRows[i].Cells["规格"].Value.ToString();
                string provider  = dataGridView1.SelectedRows[i].Cells["供应商"].Value.ToString();
                string batchCode = dataGridView1.SelectedRows[i].Cells["批次号"].Value.ToString();
                string StorageID = dataGridView1.SelectedRows[i].Cells["库房编码"].Value.ToString();

                IBarCodeServer server = ServerModuleFactory.GetServerModule <IBarCodeServer>();
                View_S_InDepotGoodsBarCodeTable barcode = server.GetBarCodeInfo(goodsCode, goodsName, spec, provider, batchCode, StorageID);

                if (barcode == null)
                {
                    S_InDepotGoodsBarCodeTable newBarcode = new S_InDepotGoodsBarCodeTable();

                    IBasicGoodsServer basicServer = ServerModuleFactory.GetServerModule <IBasicGoodsServer>();
                    newBarcode.GoodsID     = basicServer.GetGoodsID(goodsCode, goodsName, spec);
                    newBarcode.Provider    = provider;
                    newBarcode.BatchNo     = batchCode;
                    newBarcode.ProductFlag = "0";
                    newBarcode.StorageID   = StorageID;

                    if (!server.Add(newBarcode, out m_err))
                    {
                        MessageDialog.ShowErrorMessage(m_err);
                        return;
                    }

                    barcode = server.GetBarCodeInfo(goodsCode, goodsName, spec, provider, batchCode, StorageID);
                }

                lstBarCodeInfo.Add(barcode);
            }

            foreach (var item in lstBarCodeInfo)
            {
                ServerModule.PrintPartBarcode.PrintBarcodeList(item);
            }
        }
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (!ServerModuleFactory.GetServerModule <IProductCodeServer>().VerifyProductCodesInfo(
                    cmbProductType.Text, txtCvtID.Text, GlobalObject.CE_BarCodeType.内部钢印码, out m_strErr))
            {
                MessageDialog.ShowPromptMessage(m_strErr);
                return;
            }

            string str = txtCvtID.Text;

            m_strCVTID = cmbProductType.Text.Trim() + " " + str.ToUpper();

            this.Close();
        }
示例#25
0
        private void dataGridView1_DoubleClick(object sender, EventArgs e)
        {
            IGaugeManage serviceGauge = ServerModuleFactory.GetServerModule <IGaugeManage>();

            int intGoodsID = m_basicGoodsServer.GetGoodsID(dataGridView1.CurrentRow.Cells["图号型号"].Value.ToString(),
                                                           dataGridView1.CurrentRow.Cells["物品名称"].Value.ToString(),
                                                           dataGridView1.CurrentRow.Cells["规格"].Value.ToString());

            if (UniversalFunction.GetGoodsType(intGoodsID, m_billInfo.StorageID) == CE_GoodsType.量检具 &&
                m_operateMode == CE_BusinessOperateMode.仓库核实)
            {
                量检具编号录入窗体 form = new 量检具编号录入窗体(m_billNo, intGoodsID, Convert.ToDecimal(dataGridView1.CurrentRow.Cells["数量"].Value), CE_BusinessBillType.入库, true);
                form.ShowDialog();
            }
        }
        /// <summary>
        /// 从行记录中提取物品对象信息
        /// </summary>
        /// <param name="row">行记录</param>
        /// <returns>提取的物品信息</returns>
        View_S_MaterialListRejectBill GetGoodsInfo(DataGridViewRow row)
        {
            if (row == null)
            {
                return(null);
            }

            View_S_MaterialListRejectBill goods = new View_S_MaterialListRejectBill();

            goods.序号   = (long)row.Cells["序号"].Value;
            goods.退货单号 = (string)row.Cells["退货单号"].Value;
            goods.物品ID = (int)row.Cells["物品ID"].Value;
            goods.图号型号 = (string)row.Cells["图号型号"].Value;
            goods.物品名称 = (string)row.Cells["物品名称"].Value;
            goods.规格   = (string)row.Cells["规格"].Value;
            goods.供应商  = (string)row.Cells["供应商"].Value;
            goods.批次号  = (string)row.Cells["批次号"].Value;
            goods.供方批次 = (string)row.Cells["供方批次"].Value;
            goods.退货数  = (decimal)row.Cells["退货数"].Value;
            goods.备注   = (string)row.Cells["备注"].Value;
            goods.关联单号 = (string)row.Cells["关联单号"].Value;

            View_F_GoodsPlanCost basicGoodsInfo = null;

            if (row.Cells["单位"].Value != System.DBNull.Value)
            {
                goods.单位   = (string)row.Cells["单位"].Value;
                goods.物品类别 = (string)row.Cells["物品类别"].Value;
                goods.货架   = (string)row.Cells["货架"].Value;
                goods.列    = (string)row.Cells["列"].Value;
                goods.层    = (string)row.Cells["层"].Value;
            }
            else
            {
                IBasicGoodsServer basicGoodsServer = ServerModuleFactory.GetServerModule <IBasicGoodsServer>();
                basicGoodsInfo = basicGoodsServer.GetGoodsInfo(goods.图号型号, goods.物品名称, goods.规格, out m_error);

                if (!GlobalObject.GeneralFunction.IsNullOrEmpty(m_error))
                {
                    MessageDialog.ShowErrorMessage(m_error);
                    return(null);
                }

                goods.单位 = basicGoodsInfo.单位;
            }

            return(goods);
        }
示例#27
0
        /// <summary>
        /// 从行记录中提取物品对象信息
        /// </summary>
        /// <param name="row">行记录</param>
        /// <returns>提取的物品信息</returns>
        View_S_HomemadeRejectList GetGoodsInfo(DataGridViewRow row)
        {
            if (row == null)
            {
                return(null);
            }

            View_S_HomemadeRejectList goods = new View_S_HomemadeRejectList();

            goods.序号   = (long)row.Cells["序号"].Value;
            goods.退货单号 = (string)row.Cells["退货单号"].Value;
            goods.物品ID = (int)row.Cells["物品ID"].Value;
            goods.图号型号 = (string)row.Cells["图号型号"].Value;
            goods.物品名称 = (string)row.Cells["物品名称"].Value;
            goods.规格   = (string)row.Cells["规格"].Value;
            goods.供应商  = (string)row.Cells["供应商"].Value;
            goods.批次号  = (string)row.Cells["批次号"].Value;
            goods.供方批次 = (string)row.Cells["供方批次"].Value;
            goods.退货数  = (decimal)row.Cells["退货数"].Value;
            goods.备注   = (string)row.Cells["备注"].Value;

            View_F_GoodsPlanCost basicGoodsInfo = null;

            if (row.Cells["单位"].Value != System.DBNull.Value)
            {
                goods.单位   = (string)row.Cells["单位"].Value;
                goods.物品类别 = (string)row.Cells["物品类别"].Value;
                goods.货架   = Convert.ToString(row.Cells["货架"].Value);
                goods.列    = Convert.ToString(row.Cells["列"].Value);
                goods.层    = Convert.ToString(row.Cells["层"].Value);
            }
            else
            {
                IBasicGoodsServer basicGoodsServer = ServerModuleFactory.GetServerModule <IBasicGoodsServer>();

                basicGoodsInfo = basicGoodsServer.GetGoodsInfo(goods.图号型号, goods.物品名称, goods.规格, out m_strErr);

                if (!string.IsNullOrEmpty(m_strErr))
                {
                    MessageDialog.ShowErrorMessage(m_strErr);
                    return(null);
                }

                goods.单位 = basicGoodsInfo.单位;
            }

            return(goods);
        }
        /// <summary>
        /// 初始化库存物品状态ComboBox控件
        /// </summary>
        /// <param name="cmbState">要初始化的库存物品状态ComboBox控件</param>
        static public bool InitStoreStateComboBox(ComboBox cmbState)
        {
            IStoreServer server = ServerModuleFactory.GetServerModule <IStoreServer>();
            IQueryable <S_StockStatus> queryResult = server.GetStoreStatus();

            if (queryResult.Count() > 0)
            {
                cmbState.DataSource    = queryResult;
                cmbState.DisplayMember = "Description";
                cmbState.ValueMember   = "ID";

                return(true);
            }

            return(false);
        }
示例#29
0
        /// <summary>
        /// 为领料而获取报废单信息对话框
        /// </summary>
        /// <returns>成功则返回获取到的对话框,失败返回null</returns>
        static public FormQueryInfo GetScrapBillDialogForFetchGoods()
        {
            IScrapBillServer scrapBillServer = ServerModuleFactory.GetServerModule <IScrapBillServer>();

            PlatformManagement.IQueryResult queryInfo;

            if (!scrapBillServer.GetAllBillForFetchGoods(out queryInfo, out m_err))
            {
                MessageDialog.ShowErrorMessage(m_err);
                return(null);
            }

            FormQueryInfo form = new FormQueryInfo(queryInfo);

            form.ShowColumns = new string[] { "报废单号", "报废时间", "报废类别", "报废原因", "是否冲抵领料单", "申请人签名", "仓管签名" };
            return(form);
        }
示例#30
0
        /// <summary>
        /// 为领料而获取领料退库单信息对话框
        /// </summary>
        /// <returns>成功则返回获取到的对话框,失败返回null</returns>
        static public FormQueryInfo GetReturnedInDepotBillDialogForFetchGoods()
        {
            IMaterialReturnedInTheDepot billServer = ServerModuleFactory.GetServerModule <IMaterialReturnedInTheDepot>();

            PlatformManagement.IQueryResult queryInfo;

            if (!billServer.GetAllBillForFetchGoods(out queryInfo, out m_err))
            {
                MessageDialog.ShowErrorMessage(m_err);
                return(null);
            }

            FormQueryInfo form = new FormQueryInfo(queryInfo);

            form.ShowColumns = new string[] { "退库单号", "退库时间", "申请部门", "申请人", "初始用途", "退库原因", "备注" };
            return(form);
        }