Exemple #1
0
    public List <Texture2D> ReplaceMpoTextures(string path)
    {
        // Extracts 2 images from the MPO file
        var textures = Mpo.GetMpoImages(path);

        // Updates left and right sphere textures
        _materials[0].mainTexture = textures[0];
        _materials[1].mainTexture = textures[1];

        return(textures);
    }
Exemple #2
0
        public List <DataTable> getInvByP(List <string> ps)
        {
            List <DataTable> dts = new List <DataTable>();
            int noQtyBox         = 0; // 没有件数的箱子数量
            int boxQty           = 0; // 箱数量

            // 按PO汇总
            DataTable countPoDT = new DataTable();

            countPoDT.Columns.Add("Cust_id");
            countPoDT.Columns.Add("Buyer_Item");
            countPoDT.Columns.Add("color_code");
            countPoDT.Columns.Add("po");
            countPoDT.Columns.Add("MAIN_LINE");
            countPoDT.Columns.Add("Qty");
            countPoDT.Columns.Add("boxQtys");

            // 按日期汇总
            DataTable DateCount = new DataTable();

            DateCount.Columns.Add("ScanDate");
            DateCount.Columns.Add("Qty");
            DateCount.Columns.Add("boxQtys");


            DataTable dt = pss.getInvByP(ps);

            if (dt.Rows.Count <= 0)
            {
                dts.Add(dt);
                dts.Add(countPoDT);
                dts.Add(DateCount);
                return(dts);
            }

            List <Mpo>    pos       = new List <Mpo>();
            List <string> scanDates = new List <string>();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                Mpo mpo = new Mpo();
                mpo.po        = dt.Rows[i]["PO"].ToString().Trim();
                mpo.main_line = dt.Rows[i]["MAIN_LINE"].ToString().Trim();
                string scandate = dt.Rows[i]["scantime"].ToString().Trim();
                // string pom = mpo.po + mpo.main_line;
                if (!this.isRepeatLists(pos, mpo.po, mpo.main_line))
                {
                    pos.Add(mpo);
                }
                if (!this.isRepeatLists(scanDates, scandate))
                {
                    scanDates.Add(scandate);
                }
            }

            if (pos.Count <= 0)
            {
                dts.Add(dt);
                dts.Add(countPoDT);
                dts.Add(DateCount);
                return(dts);
            }

            for (int i = 0; i < pos.Count; i++)
            {
                int       sizeQty  = 0;
                DataRow[] selectPO = dt.Select("po='" + pos[i].po + "' and MAIN_LINE = '" + pos[i].main_line + "'");
                if (selectPO.Length <= 0)
                {
                    break;
                }
                string qtystr = "";
                foreach (DataRow sdr in selectPO)
                {
                    qtystr = sdr["boxSizeQty"].ToString();
                    if (qtystr == "")
                    {
                        qtystr = "0";
                    }
                    boxQty++;
                    sizeQty = sizeQty + Convert.ToInt32(qtystr);
                }
                DataRow dr = countPoDT.NewRow();
                dr["Cust_id"]    = selectPO[0]["Cust_id"].ToString();
                dr["Buyer_Item"] = selectPO[0]["Buyer_Item"].ToString();
                dr["color_code"] = selectPO[0]["color_code"].ToString();
                dr["po"]         = selectPO[0]["po"].ToString();
                dr["MAIN_LINE"]  = selectPO[0]["MAIN_LINE"].ToString();
                dr["Qty"]        = sizeQty.ToString();
                dr["boxQtys"]    = boxQty.ToString();
                countPoDT.Rows.Add(dr);
                boxQty = 0;
            }

            for (int i = 0; i < scanDates.Count; i++)
            {
                int       sizeQty  = 0;
                DataRow[] selectPO = dt.Select("scantime = '" + scanDates[i].ToString() + "'");
                if (selectPO.Length <= 0)
                {
                    break;
                }
                string qtystr = "";
                foreach (DataRow sdr in selectPO)
                {
                    qtystr = sdr["boxSizeQty"].ToString();
                    if (qtystr == "")
                    {
                        qtystr = "0";
                        noQtyBox++;
                    }
                    boxQty++;
                    sizeQty = sizeQty + Convert.ToInt32(qtystr);
                }
                DataRow dr = DateCount.NewRow();
                dr["ScanDate"] = selectPO[0]["scantime"].ToString();
                dr["Qty"]      = sizeQty.ToString();
                dr["boxQtys"]  = boxQty.ToString();
                DateCount.Rows.Add(dr);
                if (noQtyBox > 0)
                {
                    DataRow ndr = DateCount.NewRow();
                    ndr["ScanDate"] = selectPO[0]["scantime"].ToString();
                    ndr["Qty"]      = "0";
                    ndr["boxQtys"]  = noQtyBox.ToString() + ",箱没有PPR资讯";
                    DateCount.Rows.Add(ndr);
                    noQtyBox = 0;
                }
            }

            DataTable dtCopy = dt.Copy();
            DataView  dv     = dt.DefaultView;

            dv.Sort = "scantime";
            dtCopy  = dv.ToTable();
            dts.Add(dtCopy);

            DataTable countPoDTCopy = countPoDT.Copy();
            DataView  dc            = countPoDT.DefaultView;

            dc.Sort       = "po";
            countPoDTCopy = dc.ToTable();
            dts.Add(countPoDTCopy);

            DataTable DateCountCopy = DateCount.Copy();
            DataView  da            = DateCount.DefaultView;

            da.Sort       = "ScanDate";
            DateCountCopy = da.ToTable();
            dts.Add(DateCountCopy);
            return(dts);  //noQtyBox 返回回去看是不是有没有数量的
        }