Beispiel #1
0
        public IList <Wafer> GetWaferByLotid(DetailWaferQuery query, int pageIndex, int pageSize, out int recoedCount)
        {
            Conditions conditions = new Conditions();

            conditions.ConditionExpressions.Add(new Condition("TransformID", Operator.EqualTo, query.TransformID));
            if (!StringHelper.isNullOrEmpty(query.WaferID))
            {
                conditions.ConditionExpressions.Add(new Condition("WaferID", Operator.Like, query.WaferID));
            }
            if (!string.IsNullOrEmpty(query.Program))
            {
                conditions.ConditionExpressions.Add(new Condition("Program", Operator.Like, query.Program));
            }
            if (!string.IsNullOrEmpty(query.StartTime))
            {
                conditions.ConditionExpressions.Add(new Condition("StartTime", Operator.Between, query.StartTime + " 00:00:00", query.StartTime + " 23:59:59"));
            }
            if (query.TotalDieCount > 0)
            {
                conditions.ConditionExpressions.Add(new Condition("TotalDieCount", Operator.Like, query.TotalDieCount));
            }
            if (!string.IsNullOrEmpty(query.Yield))
            {
                conditions.ConditionExpressions.Add(new Condition("Yield", Operator.Like, query.Yield));
            }
            OrderExpression exp = null;

            if (!string.IsNullOrEmpty(query.OrderBy))
            {
                exp = new OrderExpression(query.OrderBy, query.OrderDesc);
            }
            conditions.Connector = Connector.AND;
            return(this.dbGateway.getRecords(pageIndex, pageSize, conditions, exp, null, Connector.AND, out recoedCount));
        }
        public ActionResult WaferSbin(DetailWaferQuery query, int pageIndex, int pageSize)
        {
            int           recordCount = 0;
            IList <Wafer> list        = service.GetWaferByLotid(query, pageIndex, pageSize, out recordCount);

            if (list != null && list.Count > 0)
            {
                foreach (Wafer item in list)
                {
                    if (item.StartTime != null)
                    {
                        if (item.StartTime.Year == 1900)
                        {
                            item.StrStartTime = "";
                        }
                        else
                        {
                            item.StrStartTime = item.StartTime.ToString("yyyy/MM/dd");
                        }
                    }

                    item.ListSbin = sbinService.GetWaferSbin(query.TransformID, item.ID);
                }
            }
            var json = JsonConvert.SerializeObject(new
            {
                currentPage = pageIndex,
                totalPages  = PagerUtility.GetPageCount(recordCount, pageSize),
                rows        = list,
            });

            base.Response.Write(json);
            return(null);
        }
        public ActionResult ExportWafer(DetailWaferQuery query)
        {
            DataTable dt = new DataTable();

            dt.Columns.Add("Wafer_Code");
            dt.Columns.Add("Wafer_id");
            dt.Columns.Add("Program");
            dt.Columns.Add("Start Time");
            dt.Columns.Add("Total die count");
            dt.Columns.Add("Yield(%)");
            IList <Wafer_Sbin> list = sbinService.GetSbinTextByLotId(query.TransformID);

            if (list != null && list.Count > 0)
            {
                foreach (Wafer_Sbin item in list)
                {
                    dt.Columns.Add(item.SbinText);
                }
            }
            int recordCount = 0;
            IList <Wafer_Sbin> listValue = null;
            IList <Wafer>      waferlist = service.GetWaferByLotid(query, 0, 0xf423f, out recordCount);

            if (waferlist != null && waferlist.Count > 0)
            {
                var index       = 0;
                var columnindex = 0;
                foreach (Wafer item in waferlist)
                {
                    dt.Rows.Add(dt.NewRow());
                    dt.Rows[index][0] = item.WaferCode;
                    dt.Rows[index][1] = item.WaferID;
                    dt.Rows[index][2] = item.Program;
                    if (item.StartTime != null)
                    {
                        if (item.StartTime.Year == 1900)
                        {
                            dt.Rows[index][3] = "";
                        }
                        else
                        {
                            dt.Rows[index][3] = item.StartTime.ToString("yyyy/MM/dd");
                        }
                    }
                    // dt.Rows[index][3] = item.StartTime;
                    dt.Rows[index][4] = item.TotalDieCount;
                    dt.Rows[index][5] = item.Yield + "%";
                    listValue         = sbinService.GetWaferSbin(query.TransformID, item.ID);
                    if (listValue != null && listValue.Count > 0)
                    {
                        columnindex = 6;
                        foreach (Wafer_Sbin sbin in listValue)
                        {
                            dt.Rows[index][columnindex] = sbin.SbinValue;
                            columnindex++;
                        }
                    }
                    index++;
                }
            }
            if (dt.Rows.Count > 0)
            {
                string xlsName = string.Format("Wafer_{0}", DateTime.Now.ToString("yyyyMMdd_hhmmss"));
                Exporthelper.ExportToExecel(System.Web.HttpContext.Current.Response, dt, xlsName + ".xls");
            }
            return(null);
        }
Beispiel #4
0
 public IList <Wafer> GetWaferByLotid(DetailWaferQuery query, int pageIndex, int pageSize, out int recoedCount)
 {
     return(this.way.GetWaferByLotid(query, pageIndex, pageSize, out recoedCount));
 }