Example #1
0
        public void InLotPassStation(string NewLotFlag, R_SN SNObj, string LotNo, string LotSatusID, string Station, string EmpNo, string AQL_TYPE, string Line, string BU, OleExec DB)
        {
            T_R_LOT_STATUS   Table_R_Lot_Status = new T_R_LOT_STATUS(DB, DBType);
            Row_R_LOT_STATUS Row_R_Lot_Status   = (Row_R_LOT_STATUS)NewRow();
            T_R_LOT_DETAIL   Table_R_Lot_Detail = new T_R_LOT_DETAIL(DB, DBType);
            Row_R_LOT_DETAIL Row_R_Lot_Detail   = (Row_R_LOT_DETAIL)Table_R_Lot_Detail.NewRow();

            T_C_AQLTYPE Table_C_AQLTYPE = new T_C_AQLTYPE(DB, DBType);

            try
            {
                string LotID = "";
                if (NewLotFlag == "1")
                {
                    //Modify by LLF 2018-03-19,生成ID,需根據Table生成
                    //LotID= GetNewID(BU, DB);
                    LotID = Table_R_Lot_Status.GetNewID(BU, DB);
                    Row_R_Lot_Status.ID              = LotID;
                    Row_R_Lot_Status.LOT_NO          = LotNo;
                    Row_R_Lot_Status.SKUNO           = SNObj.SKUNO;
                    Row_R_Lot_Status.AQL_TYPE        = AQL_TYPE;
                    Row_R_Lot_Status.LOT_QTY         = 1;
                    Row_R_Lot_Status.REJECT_QTY      = 0;
                    Row_R_Lot_Status.SAMPLE_QTY      = 1;
                    Row_R_Lot_Status.PASS_QTY        = 0;
                    Row_R_Lot_Status.FAIL_QTY        = 0;
                    Row_R_Lot_Status.CLOSED_FLAG     = "0";
                    Row_R_Lot_Status.LOT_STATUS_FLAG = "0";
                    Row_R_Lot_Status.LINE            = Line;
                    Row_R_Lot_Status.SAMPLE_STATION  = Station;
                    Row_R_Lot_Status.EDIT_EMP        = EmpNo;
                    Row_R_Lot_Status.EDIT_TIME       = GetDBDateTime(DB);
                    DB.ExecSQL(Row_R_Lot_Status.GetInsertString(DBType));
                }
                else
                {
                    LotID            = LotSatusID;
                    Row_R_Lot_Status = (Row_R_LOT_STATUS)Table_R_Lot_Status.GetObjByID(LotSatusID, DB);
                    int LotQty    = (int)Row_R_Lot_Status.LOT_QTY + 1;
                    int SampleQty = Table_C_AQLTYPE.GetSampleQty(AQL_TYPE, LotQty, DB);
                    Row_R_Lot_Status.SAMPLE_QTY = SampleQty;

                    Row_R_Lot_Status.LOT_QTY += 1;
                    DB.ExecSQL(Row_R_Lot_Status.GetUpdateString(DBType));
                }

                //Modify by LLF 2018-03-19,生成ID,需根據Table生成
                //Row_R_Lot_Detail.ID = GetNewID(BU, DB);
                Row_R_Lot_Detail.ID     = Table_R_Lot_Detail.GetNewID(BU, DB);
                Row_R_Lot_Detail.LOT_ID = LotID;
                //Row_R_Lot_Detail.LOT_ID = LotID;
                Row_R_Lot_Detail.SN            = SNObj.SN;
                Row_R_Lot_Detail.WORKORDERNO   = SNObj.WORKORDERNO;
                Row_R_Lot_Detail.CREATE_DATE   = GetDBDateTime(DB);
                Row_R_Lot_Detail.SAMPLING      = "0";
                Row_R_Lot_Detail.STATUS        = "0";
                Row_R_Lot_Detail.FAIL_CODE     = "";
                Row_R_Lot_Detail.FAIL_LOCATION = "";
                Row_R_Lot_Detail.DESCRIPTION   = "";
                Row_R_Lot_Detail.CARTON_NO     = "";
                Row_R_Lot_Detail.PALLET_NO     = "";
                Row_R_Lot_Detail.EDIT_EMP      = EmpNo;
                Row_R_Lot_Detail.EDIT_TIME     = GetDBDateTime(DB);
                DB.ExecSQL(Row_R_Lot_Detail.GetInsertString(DBType));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }