Ejemplo n.º 1
0
        public Entity.SO_SODetails FindSoDetailsBySoDetails(Entity.SO_SODetails soDetails)
        {
            SO_SODetails details = null;

            details = dao.FindSoDetailsBySoDetails(soDetails);
            return(details);
        }
Ejemplo n.º 2
0
 public List <SO_SODetails> FindSoDetailsByDetailses(SO_SODetails soDetails)
 {
     using (ERP2008Entities erp2008 = new ERP2008Entities())
     {
         List <SO_SODetails> details = null;
         details = (from detail in erp2008.SO_SODetails select detail
                    ).ToList();
         return(details);
     }
 }
Ejemplo n.º 3
0
 public SO_SODetails FindSoDetailsById(int id)
 {
     using (ERP2008Entities erp2008 = new ERP2008Entities())
     {
         SO_SODetails details = null;
         details = (from de in erp2008.SO_SODetails
                    where de.AutoID == id
                    select de).SingleOrDefault();
         return(details);
     }
 }
Ejemplo n.º 4
0
 public Entity.SO_SODetails FindSoDetailsBySoDetails(Entity.SO_SODetails soDetails)
 {
     using (ERP2008Entities erp2008 = new ERP2008Entities())
     {
         //有时候客户一个订单下单分几次下一个型号,此处用来提出明细单的说明    18-6-23 lee
         //一般一个订单号多个型号说明应该是一样的,所以直接拿第一个的说明就好了  18-6-23  lee
         SO_SODetails details = null;
         details = (from de in erp2008.SO_SODetails
                    where de.cSOCode == soDetails.cSOCode && de.cInvCode == soDetails.cInvCode
                    select de).ToList()[0];
         return(details);
     }
 }
Ejemplo n.º 5
0
        /// <summary>
        /// PO+订单明细项目号
        /// </summary>
        /// <param name="label">标签对象</param>
        public void CreateClientRequireTwo(t_labels label)
        {
            //PO+订单明细项目号
            string require    = null;
            string xinagMuHao = null;

            _soDetailsDao = new SoDetailsDaoImpl();
            _openCardPack = new OpenCardPackDaoImpl();
            var fsaId = _openCardPack.FindOpencardpackByCode(label.code).FsaID;

            if (fsaId != null)
            {
                int          sodetailsId = (int)fsaId;
                SO_SODetails soDetail    = _soDetailsDao.FindSoDetailsById(sodetailsId);
                xinagMuHao = soDetail.cFree3;
            }
            require = label.po + "#" + xinagMuHao;
            label.ClientRequireTwo = require;
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 查询标签信息按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnQuery_Click(object sender, EventArgs e)
        {
            ClearGroupBoxText();
            if (!string.IsNullOrEmpty(txtCode.Text))
            {
                t_opencardpack parmOpencardpack = new t_opencardpack();
                parmOpencardpack.Fbarcode = txtCode.Text.Trim().ToString();
                t_opencardpack newOpencardpack = openCardPackBll.FindOpencardpackByCode(parmOpencardpack);
                if (newOpencardpack != null)
                {
                    if (newOpencardpack.Flabelqty == null)
                    {
                        MessageBox.Show(@"生成数量为空,请返回开卡包装规格设置!", messageHead, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        return;
                    }
                    this.txtBatch.Text          = NullTurnEmpty(newOpencardpack.FBatchNoall);
                    this.txtCinvstd.Text        = NullTurnEmpty(newOpencardpack.cinvstd);
                    this.txtCinvName.Text       = NullTurnEmpty(newOpencardpack.cinvname);
                    this.txtClientCode.Text     = NullTurnEmpty(newOpencardpack.cCusCode);
                    this.txtOrder.Text          = NullTurnEmpty(newOpencardpack.cSOCode);
                    this.txtZhuShen.Text        = NullTurnEmpty(newOpencardpack.Fzhushen);
                    this.txtTypeCode.Text       = NullTurnEmpty(newOpencardpack.FProductNo);
                    this.txtFoot.Text           = NullTurnEmpty(newOpencardpack.ffoot);
                    this.txtDpredate.Text       = NullTurnEmpty(newOpencardpack.dPreDate.ToString());
                    this.txtPN.Text             = NullTurnEmpty(newOpencardpack.cPN);
                    this.txtPO.Text             = NullTurnEmpty(newOpencardpack.cPO);
                    this.txtCreateQTY.Text      = (Double.Parse(newOpencardpack.Flabelqty.ToString()) * 1000).ToString(CultureInfo.InvariantCulture);
                    this.txtOrderQty.Text       = (Double.Parse(newOpencardpack.Fqty.ToString()) * 1000).ToString(CultureInfo.InvariantCulture);
                    this.txtFlowCard.Text       = NullTurnEmpty(newOpencardpack.Fsn);
                    this.txtKey.Text            = this.txtCode.Text.Trim().ToUpper();
                    this.txtBatchSuffix.Text    = NullTurnEmpty(newOpencardpack.Fbatchfree);
                    this.txtFlowCardSuffix.Text = NullTurnEmpty(newOpencardpack.fsnfree);
                    if (!string.IsNullOrEmpty(newOpencardpack.CNC))
                    {
                        this.txtFlowCardSuffix.Text = this.txtFlowCardSuffix.Text + @" " + newOpencardpack.CNC;
                    }
                    this.txtNote.Text   = NullTurnEmpty(newOpencardpack.Fnote);
                    this.txtRemark.Text = NullTurnEmpty(newOpencardpack.cFree1);
                    //获取主订单信息
                    SO_SOMain soMain = soMainBll.FindSoMainByCsoCode(NullTurnEmpty(newOpencardpack.cSOCode));
                    if (soMain != null)
                    {
                        this.txtMainClaim.Text = NullTurnEmpty(soMain.cMemo);
                    }
                    else
                    {
                        MessageBox.Show(@"此条码订单号为空的!", messageHead, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        return;
                    }

                    //获取订单明细信息
                    //SO_SODetails parmSoDetails = new SO_SODetails();
                    //parmSoDetails.cSOCode = newOpencardpack.cSOCode.Trim();
                    //parmSoDetails.cInvCode = newOpencardpack.FProductNo.Trim();
                    //SO_SODetails soDetails = soDetailsBll.FindSoDetailsBySoDetails(parmSoDetails);

                    if (newOpencardpack.FsaID != null)
                    {
                        int sodetailsID = 0;
                        sodetailsID = (int)newOpencardpack.FsaID;
                        if (sodetailsID != 0)
                        {
                            SO_SODetails soDetails = frmCreateLabelsBll.FindSoDetailsById(sodetailsID);
                            if (soDetails != null)
                            {
                                //明细单要求
                                this.txtDetailClaim.Text = soDetails.cMemo.Trim();
                            }
                            else
                            {
                                MessageBox.Show(@"明细订单为空!", messageHead, MessageBoxButtons.OK, MessageBoxIcon.Information);
                                return;
                            }
                        }
                        else
                        {
                            MessageBox.Show(@"开卡表的明细订单的ID为0!", messageHead, MessageBoxButtons.OK, MessageBoxIcon.Information);
                            return;
                        }
                    }
                    else
                    {
                        MessageBox.Show(@"开卡表没有明细订单的ID!", messageHead, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        return;
                    }
                    //获取包装信息
                    if (string.IsNullOrEmpty(newOpencardpack.cPCode))
                    {
                        MessageBox.Show(@"没有选择包装编码!请返回开卡包装规格设置", messageHead, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        return;
                    }
                    this.txtPackCode.Text = newOpencardpack.cPCode.Trim();
                    SA_Packs saPacks = frmCreateLabelsBll.FindSaPacksBySaPackCode(newOpencardpack.cPCode.Trim());
                    if (saPacks != null)
                    {
                        this.txtReelQTY.Text   = (Double.Parse(saPacks.FPKminqty.ToString()) * 1000).ToString();
                        this.txtBoxQTY.Text    = (Decimal.ToInt32(saPacks.fSQty) * 1000).ToString();
                        this.txtMaxBoxQTY.Text = (saPacks.fQuantity * 1000).ToString();
                        double createQty = double.Parse(this.txtCreateQTY.Text);
                        int    reelCount = 0;
                        if (!this.cb_pack.Checked)
                        {
                            //计算卷盘数量

                            double reel = Double.Parse(saPacks.FPKminqty.ToString()) * 1000;
                            // double a=order%reel;
                            if (createQty % reel != 0)
                            {
                                reelCount = (int)(createQty / reel) + 1;
                            }
                            else
                            {
                                reelCount = (int)(createQty / reel);
                            }
                        }
                        this.txtReel.Text = reelCount.ToString();
                        int boxCount = 0;
                        if (!this.cb_reel.Checked)
                        {
                            //计算内盒数量
                            boxCount = 0;
                            double box = Double.Parse(saPacks.fSQty.ToString()) * 1000;
                            if (createQty % box != 0)
                            {
                                boxCount = (int)(createQty / box) + 1;
                            }
                            else
                            {
                                boxCount = (int)(createQty / box);
                            }
                        }
                        this.txtBox.Text                      = boxCount.ToString();
                        this.btnCreate.Enabled                = true;
                        this.btnCreateAndPrint.Enabled        = true;
                        this.ToolStripMenuItem_Create.Enabled = true;
                        this.txtCode.Text                     = "";
                    }
                    else
                    {
                        MessageBox.Show(@"包装信息为空,请返回开卡包装规格设置!", messageHead, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        return;
                    }
                }
                else
                {
                    MessageBox.Show(@"此条码无效,请检查清楚!", messageHead, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            else
            {
                MessageBox.Show(@"条码不能为空!", messageHead, MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            //this.txtCode.Text = "";
        }