Esempio n. 1
0
        public static void CloseLot(MESStation.BaseClass.MESStationBase Station, MESStation.BaseClass.MESStationInput Input, List <MESDataObject.Module.R_Station_Action_Para> Paras)
        {
            DisplayOutPut    Dis_LotNo   = Station.DisplayOutput.Find(t => t.Name == "LOTNO");
            T_R_LOT_STATUS   tRLotStatus = new T_R_LOT_STATUS(Station.SFCDB, Station.DBType);
            Row_R_LOT_STATUS r           = tRLotStatus.GetByLotNo(Dis_LotNo.Value.ToString(), Station.SFCDB);

            if (r == null || !r.CLOSED_FLAG.Equals("0"))
            {
                throw new Exception(MESReturnMessage.GetMESReturnMessage("MSGCODE20180528103627", new string[] { Dis_LotNo.Value.ToString() }));
            }
            try
            {
                r.CLOSED_FLAG = "1";
                r.EDIT_EMP    = Station.LoginUser.EMP_NO;
                Station.SFCDB.ThrowSqlExeception = true;
                r.EDIT_TIME = tRLotStatus.GetDBDateTime(Station.SFCDB);
                Station.SFCDB.ExecSQL(r.GetUpdateString(Station.DBType));
            }
            catch (Exception e)
            {
                throw new Exception(MESReturnMessage.GetMESReturnMessage("MSGCODE20180528105826", new string[] { Dis_LotNo.Value.ToString(), e.Message }));
            }
            finally { Station.SFCDB.ThrowSqlExeception = false; }
            #region 清空界面信息
            Station.StationSession.Clear();
            Station.Inputs.Find(t => t.DisplayName == Paras[0].SESSION_TYPE).DataForUse.Clear();
            #endregion
        }
Esempio n. 2
0
        public static void CloseLot(MESPubLab.MESStation.MESStationBase Station, MESPubLab.MESStation.MESStationInput Input, List <MESDataObject.Module.R_Station_Action_Para> Paras)
        {
            DisplayOutPut    Dis_LotNo   = Station.DisplayOutput.Find(t => t.Name == "LOTNO");
            MESStationInput  Level       = Station.Inputs.Find(t => t.DisplayName == "AQLLEVEL");
            T_R_LOT_STATUS   tRLotStatus = new T_R_LOT_STATUS(Station.SFCDB, Station.DBType);
            Row_R_LOT_STATUS r           = tRLotStatus.GetByLotNo(Dis_LotNo.Value.ToString(), Station.SFCDB);

            if (r.LOT_NO == null || !r.CLOSED_FLAG.Equals("0"))
            {
                throw new Exception(MESReturnMessage.GetMESReturnMessage("MSGCODE20180528103627", new string[] { Dis_LotNo.Value.ToString() }));
            }
            try
            {
                //根據關閉時的AQL更新LotStatus
                T_C_AQLTYPE      tCAqlType    = new T_C_AQLTYPE(Station.SFCDB, Station.DBType);
                List <C_AQLTYPE> cAqlTypeList = tCAqlType.GetAqlTypeBySkunoAndLevel(r.SKUNO, Level.Value.ToString(), Station.SFCDB);

                r.REJECT_QTY  = cAqlTypeList.Where(t => t.LOT_QTY > r.LOT_QTY).OrderBy(t => t.LOT_QTY).Take(1).ToList <C_AQLTYPE>()[0].REJECT_QTY;
                r.SAMPLE_QTY  = cAqlTypeList.Where(t => t.LOT_QTY > r.LOT_QTY).OrderBy(t => t.LOT_QTY).Take(1).ToList <C_AQLTYPE>()[0].SAMPLE_QTY;
                r.SAMPLE_QTY  = r.SAMPLE_QTY > r.LOT_QTY ? r.LOT_QTY : r.SAMPLE_QTY;
                r.CLOSED_FLAG = "1";
                r.AQL_LEVEL   = Level.Value.ToString();
                r.EDIT_EMP    = Station.LoginUser.EMP_NO;
                Station.SFCDB.ThrowSqlExeception = true;
                r.EDIT_TIME = tRLotStatus.GetDBDateTime(Station.SFCDB);
                Station.SFCDB.ExecSQL(r.GetUpdateString(Station.DBType));
            }
            catch (Exception e)
            {
                throw new Exception(MESReturnMessage.GetMESReturnMessage("MSGCODE20180528105826", new string[] { Dis_LotNo.Value.ToString(), e.Message }));
            }
            finally { Station.SFCDB.ThrowSqlExeception = false; }
            #region 清空界面信息
            Station.StationSession.Clear();
            Station.Inputs.Find(t => t.DisplayName == Paras[0].SESSION_TYPE).DataForUse.Clear();
            Station.Inputs.Find(t => t.DisplayName == "AQLLEVEL").DataForUse.Clear();
            #endregion
        }