Пример #1
0
        private static Lot ReadSWBins(Lot lot, JToken lotJudegementNode, int totalCount)
        {
            JToken jToken = lotJudegementNode["sbinPareto"];

            if (lotJudegementNode["sbinDefinitions"] != null)
            {
                IList <SWBin> list = new List <SWBin>();
                for (int i = 0; i <= lotJudegementNode["sbinDefinitions"].Count <JToken>() - 1; i++)
                {
                    JToken jToken2 = lotJudegementNode["sbinDefinitions"][i];
                    SWBin  sWBin   = new SWBin();
                    sWBin.Code   = Convert.ToInt32(jToken2["bin"].ToString());
                    sWBin.Defect = Convert.ToString(jToken2["binName"].ToString());
                    sWBin.Qty    = ((jToken[sWBin.Code.ToString()] != null) ? Convert.ToInt32(jToken[sWBin.Code.ToString()].ToString()) : 0);
                    sWBin.LotID  = lot.LotID;
                    if (jToken[sWBin.Code.ToString()] != null && jToken[sWBin.Code.ToString()].ToString() != "")
                    {
                        sWBin.FailRate = Convert.ToSingle(jToken[sWBin.Code.ToString()].ToString()) / (float)totalCount * 100f;
                    }
                    sWBin.CreateTime = DateTime.Now;
                    list.Add(sWBin);
                }
                lot.SWbins = list;
            }
            return(lot);
        }
Пример #2
0
 public void AddNew(SWBin newSWBin)
 {
     this.dbGateway.AddNew(newSWBin);
 }