Example #1
0
        /// <summary>
        /// 获取未生成交接单的箱主信息和明细信息
        /// </summary>
        /// <returns></returns>
        public static List <PBBoxInfo> GetUnGenerateBoxListWithDetail()
        {
            List <PBBoxInfo> result = null;
            string           sql    = @"SELECT * FROM dbo.PBBox WHERE IsGenerate=0

                            SELECT * FROM dbo.PBBoxDetail WHERE HU IN(SELECT HU FROM dbo.PBBox WHERE IsGenerate = 0)";
            DataSet          ds     = DBHelper.GetDataSet(sql, false);

            if (ds != null && ds.Tables.Count == 2)
            {
                DataTable dtBox       = ds.Tables[0];
                DataTable dtBoxDetail = ds.Tables[1];
                if (dtBox.Rows.Count > 0)
                {
                    result = new List <PBBoxInfo>();
                    foreach (DataRow row in dtBox.Rows)
                    {
                        PBBoxInfo item = PBBoxInfo.BuildPBBoxInfo(row);
                        if (dtBoxDetail != null && dtBoxDetail.Rows.Count > 0)
                        {
                            DataRow[] detailRows = dtBoxDetail.Select(string.Format("HU='{0}'", item.HU));
                            if (detailRows != null && detailRows.Length > 0)
                            {
                                foreach (DataRow detailRow in detailRows)
                                {
                                    item.Details.Add(PBBoxDetailInfo.BuildPBBoxDetailInfo(detailRow));
                                }
                            }
                        }
                        result.Add(item);
                    }
                }
            }
            return(result);
        }
Example #2
0
        public static PBBoxInfo GetBoxByHu(string hu)
        {
            PBBoxInfo result = new PBBoxInfo();
            string    sql    = string.Format(@"select * from PBBox WHERE HU='{0}'
SELECT * FROM PBBoxDetail WHERE HU = '{0}'", hu);

            DataSet ds = DBHelper.GetDataSet(sql, false);

            if (ds != null && ds.Tables.Count == 2)
            {
                DataTable boxTable = ds.Tables[0];
                if (boxTable != null && boxTable.Rows.Count > 0)
                {
                    result = PBBoxInfo.BuildPBBoxInfo(boxTable.Rows[0]);
                }
                else
                {
                    return(null);
                }
                DataTable detailTable = ds.Tables[1];
                if (detailTable != null && detailTable.Rows.Count > 0)
                {
                    foreach (DataRow row in detailTable.Rows)
                    {
                        result.Details.Add(PBBoxDetailInfo.BuildPBBoxDetailInfo(row));
                    }
                }
            }

            return(result);
        }
Example #3
0
        public static List <PBBoxDetailInfo> GetBoxDetailsByHU(string hu)
        {
            List <PBBoxDetailInfo> result = null;
            string    sql = string.Format(@"SELECT EPC ,HU , BARCD , MATNR , ZSATNR , ZCOLSN , ZSIZTX , Timestamps FROM dbo.PBBoxDetail WHERE HU='{0}'", hu);
            DataTable dt  = DBHelper.GetTable(sql, false);

            if (dt != null && dt.Rows.Count > 0)
            {
                result = new List <PBBoxDetailInfo>();
                foreach (DataRow row in dt.Rows)
                {
                    result.Add(PBBoxDetailInfo.BuildPBBoxDetailInfo(row));
                }
            }
            return(result);
        }
Example #4
0
        private UploadBoxInfo GetUploadBox(HLACommonView.Model.CheckResult result)
        {
            UploadBoxInfo box = new UploadBoxInfo();

            box.EQUIP_HLA   = SysConfig.DeviceInfo.EQUIP_HLA;
            box.LGNUM       = SysConfig.LGNUM;
            box.LOUCENG     = SysConfig.DeviceInfo.LOUCENG;
            box.SUBUSER     = SysConfig.CurrentLoginUser.UserId;
            box.Box         = new PBBoxInfo();
            box.Box.EQUIP   = SysConfig.DeviceInfo.EQUIP_HLA;
            box.Box.HU      = lblHu.Text;
            box.Box.LH      = cboLh.Text;
            box.Box.QTY     = mainEpcNumber;
            box.Box.RESULT  = result.InventoryResult ? "S" : "E";
            box.Box.MSG     = result.Message;
            box.Box.MX      = IsFull ? "X" : "";
            box.Box.LIFNR   = lifnr;
            box.Box.Details = new List <PBBoxDetailInfo>();
            if (tagDetailList != null)
            {
                foreach (TagDetailInfo tag in tagDetailList)
                {
                    PBBoxDetailInfo item = new PBBoxDetailInfo();
                    item.BARCD  = tag.BARCD;
                    item.EPC    = tag.EPC;
                    item.HU     = lblHu.Text;
                    item.MATNR  = tag.MATNR;
                    item.ZCOLSN = tag.ZCOLSN;
                    item.ZSATNR = tag.ZSATNR;
                    item.ZSIZTX = tag.ZSIZTX;
                    item.IsAdd  = tag.IsAddEpc ? 1 : 0;
                    box.Box.Details.Add(item);
                }
            }

            return(box);
        }