예제 #1
0
        public Boolean AddSnToPanel(Hashtable temp, MESDBHelper.OleExec SFCDB, MESDataObject.DB_TYPE_ENUM _DBType)
        {
            string strSn = temp["SN"].ToString();
            SN     sn    = new SN(strSn, SFCDB, _DBType);
            string wo    = sn.WorkorderNo;

            if (wo != this.PanelCollection[0].WORKORDERNO)
            {
                return(false);
            }
            T_R_PANEL_SN   tPanel = new T_R_PANEL_SN(SFCDB, _DBType);
            Row_R_PANEL_SN rPanel = (Row_R_PANEL_SN)tPanel.NewRow();

            rPanel.ID          = tPanel.GetNewID(temp["BU"].ToString(), SFCDB);
            rPanel.SN          = temp["SNID"].ToString();
            rPanel.PANEL       = this.PanelNo;
            rPanel.WORKORDERNO = wo;
            rPanel.SEQ_NO      = this.PanelCollection.Count;
            rPanel.EDIT_EMP    = temp["User"].ToString();
            rPanel.EDIT_TIME   = DateTime.Now;
            string strRet = SFCDB.ExecSQL(rPanel.GetInsertString(_DBType));

            if (Convert.ToInt32(strRet) > 0)
            {
                this.PanelCollection.Add(rPanel.GetDataObject());
                return(true);
            }
            return(false);
        }
예제 #2
0
 public Boolean CreatePanel(Hashtable temp, MESDBHelper.OleExec SFCDB, MESDataObject.DB_TYPE_ENUM _DBType)
 {
     try
     {
         T_R_PANEL_SN   tPanel = new T_R_PANEL_SN(SFCDB, _DBType);
         Row_R_PANEL_SN rPanel = (Row_R_PANEL_SN)tPanel.NewRow();
         rPanel.ID          = tPanel.GetNewID(temp["BU"].ToString(), SFCDB);
         rPanel.PANEL       = temp["Panel"].ToString();
         rPanel.SN          = rPanel.ID;
         rPanel.WORKORDERNO = temp["WO"].ToString();
         rPanel.SEQ_NO      = 0;
         rPanel.EDIT_EMP    = temp["User"].ToString();
         rPanel.EDIT_TIME   = DateTime.Now;
         string strRet = SFCDB.ExecSQL(rPanel.GetInsertString(_DBType));
         if (Convert.ToInt32(strRet) > 0)
         {
             return(true);
         }
         return(false);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
예제 #3
0
        /// <summary>
        /// 檢查序列號規則
        /// </summary>
        /// <param name="StrSN"></param>
        /// <param name="RuleName"></param>
        /// <param name="sfcdb"></param>
        /// <param name="_DBType"></param>
        /// <returns></returns>
        //Add by LLF 2018-02-01 begin
        public bool CheckSNRule(string StrSN, string RuleName, OleExec sfcdb, MESDataObject.DB_TYPE_ENUM _DBType)
        {
            bool        CheckFlag = false;
            T_C_SN_RULE C_SN_RULE = new T_C_SN_RULE(sfcdb, DBType);

            CheckFlag = C_SN_RULE.CheckSNRule(StrSN, RuleName, sfcdb);
            return(CheckFlag);
        }
예제 #4
0
        public R_PANEL_SN LoadPanelBySN(string StrSN, OleExec sfcdb, MESDataObject.DB_TYPE_ENUM _DBType)
        {
            R_PANEL_SN   R_Panel_SN = null;
            T_R_PANEL_SN R_PANEL_SN = new T_R_PANEL_SN(sfcdb, DBType);

            R_Panel_SN = R_PANEL_SN.GetPanelBySn(StrSN, sfcdb);
            return(R_Panel_SN);
        }
예제 #5
0
        public bool CheckPanelVirtualSNExist(string StrSN, OleExec sfcdb, MESDataObject.DB_TYPE_ENUM _DBType)
        {
            bool         CheckFlag  = false;
            T_R_PANEL_SN R_PANEL_SN = new T_R_PANEL_SN(sfcdb, DBType);

            CheckFlag = R_PANEL_SN.CheckPanelVirtualSN(StrSN, sfcdb);
            return(CheckFlag);
        }
예제 #6
0
        /// <summary>
        /// 獲取虛擬SN add by LLF 2018-02-05
        /// </summary>
        /// <param name="StrSN"></param>
        /// <param name="sfcdb"></param>
        /// <param name="_DBType"></param>
        /// <returns></returns>
        public R_PANEL_SN GetPanelVirtualSN(string StrSN, OleExec sfcdb, MESDataObject.DB_TYPE_ENUM _DBType)
        {
            R_PANEL_SN   Row        = null;
            T_R_PANEL_SN R_PANEL_SN = new T_R_PANEL_SN(sfcdb, DBType);

            Row = R_PANEL_SN.GetPanelVirtualSN(StrSN, sfcdb);
            return(Row);
        }
예제 #7
0
        public Row_R_WO_BASE GetWoMode(string strWo, MESDBHelper.OleExec SFCDB, MESDataObject.DB_TYPE_ENUM _DBType)
        {
            DBType = _DBType;
            T_R_WO_BASE TRWB = new T_R_WO_BASE(SFCDB, DBType);

            RBaseWo = TRWB.GetWo(strWo, SFCDB);
            return(RBaseWo);
        }
예제 #8
0
        //WorkOrder wo = new WorkOrder();

        public void Init(string strWo, MESDBHelper.OleExec SFCDB, MESDataObject.DB_TYPE_ENUM _DBType)
        {
            DBType = _DBType;
            T_R_WO_BASE TRWB = new T_R_WO_BASE(SFCDB, DBType);

            //T_R_SN TSN = new T_R_SN(SFCDB, DBType);
            //_SNNO = TSN.GETSN(strWo, SFCDB);
            RBaseWo = TRWB.GetWo(strWo, SFCDB);
            BaseWo  = RBaseWo.GetDataObject();
            _Route  = new Route(RBaseWo.ROUTE_ID, GetRouteType.ROUTEID, SFCDB, DBType);
        }
예제 #9
0
        //Add by LLF 2018-02-22 begin
        public void PanelAndSNLoad(string Sn, OleExec sfcdb, MESDataObject.DB_TYPE_ENUM _DBType)
        {
            this.sfcdb  = sfcdb;
            this.DBType = _DBType;
            T_R_SN trsn = new T_R_SN(sfcdb, DBType);

            if (!string.IsNullOrEmpty(Sn))
            {
                baseSN = trsn.GetDetailByPanelAndSN(Sn, sfcdb);
            }
        }
예제 #10
0
 public List <R_SN> GetPanel(string PanelSN, MESDBHelper.OleExec SFCDB, MESDataObject.DB_TYPE_ENUM _DBType)
 {
     try
     {
         T_R_SN      trs = new T_R_SN(SFCDB, DBType);
         List <R_SN> sn  = trs.GetRSNbyPsn(PanelSN, SFCDB);
         return(sn);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
예제 #11
0
        /*Modify by LLF 2018-02-22
         * public void Init(string StrLotNo, MESDBHelper.OleExec SFCDB, MESDataObject.DB_TYPE_ENUM _DBType)
         * {
         *  string ColoumName = "lot_no";
         *  DBType = _DBType;
         *  T_R_LOT_STATUS TRWB = new T_R_LOT_STATUS(SFCDB, DBType);
         *  T_R_LOT_DETAIL TWC = new T_R_LOT_DETAIL(SFCDB, DBType);
         *  RLotNo = TRWB.GetByInput(StrLotNo, ColoumName, SFCDB);
         *  SLot = RLotNo.GetDataObject();
         *  Rlotdetail = TWC.GetByLotID(SLot.ID, SFCDB);
         *  Slotdetail = Rlotdetail.GetDataObject();
         * }
         *
         * public void Init(string StrLotNo, MESDBHelper.OleExec SFCDB)
         * {
         *  Init(StrLotNo, SFCDB, DBType);
         * }*/

        public void Init(string StrLotNo, string StrSN, MESDBHelper.OleExec SFCDB, MESDataObject.DB_TYPE_ENUM _DBType)
        {
            string ColoumName = "lot_no";

            DBType = _DBType;
            T_R_LOT_STATUS TRWB = new T_R_LOT_STATUS(SFCDB, DBType);
            T_R_LOT_DETAIL TWC  = new T_R_LOT_DETAIL(SFCDB, DBType);

            RLotNo     = TRWB.GetByInput(StrLotNo, ColoumName, SFCDB);
            SLot       = RLotNo.GetDataObject();
            Rlotdetail = TWC.GetByLotID(SLot.ID, StrSN, SFCDB);
            Slotdetail = Rlotdetail.GetDataObject();
        }
예제 #12
0
        public WorkOrder Initwo(string strWo, MESDBHelper.OleExec SFCDB, MESDataObject.DB_TYPE_ENUM _DBType)
        {
            WorkOrder wo = new WorkOrder();

            DBType = _DBType;
            T_R_WO_BASE TRWB = new T_R_WO_BASE(SFCDB, DBType);

            RBaseWo           = TRWB.GetWo(strWo, SFCDB);
            this.BaseWo       = wo.BaseWo;
            this.ProcessingWo = new List <string>();
            this.LabelPaths   = new Dictionary <string, string>();
            this.SkuRoutes    = new List <Route>();
            return(this);
        }
예제 #13
0
 public List <R_SN> GetSnDetail(string strPanel, MESDBHelper.OleExec SFCDB, MESDataObject.DB_TYPE_ENUM _DBType)
 {
     try
     {
         DBType = _DBType;
         T_R_PANEL_SN TRWB = new T_R_PANEL_SN(SFCDB, DBType);
         this.PanelSnList = TRWB.GetSn(strPanel, SFCDB);
         return(PanelSnList);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
예제 #14
0
        //Add by LLF 2018-02-22 end

        public void Load(string Sn, OleExec sfcdb, MESDataObject.DB_TYPE_ENUM _DBType)
        {
            this.sfcdb  = sfcdb;
            this.DBType = _DBType;
            T_R_SN trsn = new T_R_SN(sfcdb, DBType);

            if (!string.IsNullOrEmpty(Sn))
            {
                baseSN = trsn.GetDetailBySN(Sn, sfcdb);
            }
            T_C_KEYPART tKeyPart = new T_C_KEYPART(sfcdb, DBType);

            if (!string.IsNullOrEmpty(baseSN.KP_LIST_ID))
            {
                _keyPartList = tKeyPart.GetKeyPartList(sfcdb, baseSN.KP_LIST_ID);
            }
        }
예제 #15
0
 public void Reload(MESDBHelper.OleExec SFCDB, MESDataObject.DB_TYPE_ENUM _DBType)
 {
     try
     {
         DBType = _DBType;
         T_R_PANEL_SN TRWB = new T_R_PANEL_SN(SFCDB, DBType);
         RPanelList = TRWB.GetPanel(this.PanelNo, SFCDB);
         foreach (R_PANEL_SN item in RPanelList)
         {
             this.PanelCollection.Add(item);
         }
     }
     catch (Exception e)
     {
         throw e;
     }
 }
예제 #16
0
 public Boolean DeletePanelByID(string strID, MESDBHelper.OleExec SFCDB, MESDataObject.DB_TYPE_ENUM _DBType)
 {
     try
     {
         T_R_PANEL_SN   tPanel = new T_R_PANEL_SN(SFCDB, _DBType);
         Row_R_PANEL_SN rPanel = (Row_R_PANEL_SN)tPanel.GetObjByID(strID, SFCDB, _DBType);
         string         strRet = SFCDB.ExecSQL(rPanel.GetDeleteString(_DBType));
         if (Convert.ToInt32(strRet) > 0)
         {
             return(true);
         }
         return(false);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
예제 #17
0
        /// <summary>
        /// 獲取實際連板數量
        /// </summary>
        /// <param name="Sn"></param>
        /// <param name="PanelFlag"></param>
        /// <param name="sfcdb"></param>
        /// <returns></returns>
        //Add by LLF 2018-01-27 Begin
        public int GetLinkQty(string Sn, OleExec sfcdb, MESDataObject.DB_TYPE_ENUM _DBType)
        {
            int LinkQty = 1;

            this.sfcdb  = sfcdb;
            this.DBType = _DBType;
            List <R_SN> ListSN = new List <R_SN>();

            T_R_SN R_SN = new T_R_SN(sfcdb, DBType);

            if (!string.IsNullOrEmpty(Sn))
            {
                ListSN = R_SN.GetRSNbySN(Sn, sfcdb);
                if (ListSN == null)
                {
                    ListSN  = R_SN.GetRSNbyPsn(Sn, sfcdb);
                    LinkQty = ListSN.Count;
                }
            }
            return(LinkQty);
        }
예제 #18
0
 public LotNo(MESDataObject.DB_TYPE_ENUM _dbType)
 {
     DBType = _dbType;
 }
예제 #19
0
 public Panel(string strPanel, MESDBHelper.OleExec SFCDB, MESDataObject.DB_TYPE_ENUM _DBType)
 {
     Init(strPanel, SFCDB, _DBType);
 }
예제 #20
0
        //void GetKeyPart(string PN, string seq)
        //{

        //}


        /// <summary>
        ///  寫入 r_sn_kp
        /// </summary>
        /// <param name="rowWo"></param>
        /// <param name="r_sn"></param>
        /// <param name="sfcdb"></param>
        /// <param name="Station"></param>
        /// <param name="sfcdbType"></param>
        /// <param name=""></param>
        public void InsertR_SN_KP(WorkOrder woObject, R_SN r_sn, OleExec sfcdb, BaseClass.MESStationBase Station, MESDataObject.DB_TYPE_ENUM sfcdbType)
        {
            T_C_KP_LIST             t_c_kp_list             = new T_C_KP_LIST(sfcdb, sfcdbType);
            T_C_KP_List_Item        t_c_kp_list_item        = new T_C_KP_List_Item(sfcdb, sfcdbType);
            T_C_KP_List_Item_Detail t_c_kp_list_item_detail = new T_C_KP_List_Item_Detail(sfcdb, sfcdbType);
            T_R_SN_KP   t_r_sn_kp   = new T_R_SN_KP(sfcdb, sfcdbType);
            T_C_SKU_MPN t_c_sku_mpn = new T_C_SKU_MPN(sfcdb, sfcdbType);
            T_C_KP_Rule c_kp_rule   = new T_C_KP_Rule(sfcdb, sfcdbType);
            Row_R_SN_KP rowSNKP;

            List <C_KP_List_Item>        kpItemList     = new List <C_KP_List_Item>();
            List <C_SKU_MPN>             skuMpnList     = new List <C_SKU_MPN>();
            List <C_KP_List_Item_Detail> itemDetailList = new List <C_KP_List_Item_Detail>();
            C_KP_Rule kpRule  = new C_KP_Rule();
            int       scanseq = 0;
            int       result;
            string    skuMpn = "";

            try
            {
                kpItemList = t_c_kp_list_item.GetItemObjectByListId(woObject.KP_LIST_ID, sfcdb);
                if (kpItemList == null || kpItemList.Count == 0)
                {
                    throw new MESDataObject.MESReturnMessage(MESDataObject.MESReturnMessage.GetMESReturnMessage("MES00000255", new string[] { woObject.SkuNO }));
                }

                foreach (C_KP_List_Item kpItem in kpItemList)
                {
                    itemDetailList = t_c_kp_list_item_detail.GetItemDetailObjectByItemId(kpItem.ID, sfcdb);
                    if (itemDetailList == null || itemDetailList.Count == 0)
                    {
                        throw new MESDataObject.MESReturnMessage(MESDataObject.MESReturnMessage.GetMESReturnMessage("MES00000255", new string[] { woObject.SkuNO }));
                    }

                    skuMpnList = t_c_sku_mpn.GetMpnBySkuAndPartno(sfcdb, woObject.SkuNO, kpItem.KP_PARTNO);
                    if (skuMpnList.Count != 0)
                    {
                        skuMpn = skuMpnList[0].MPN;
                    }

                    foreach (C_KP_List_Item_Detail itemDetail in itemDetailList)
                    {
                        scanseq = scanseq + 1;
                        kpRule  = c_kp_rule.GetKPRule(sfcdb, kpItem.KP_PARTNO, skuMpn, itemDetail.SCANTYPE);
                        if (kpRule == null)
                        {
                            throw new MESDataObject.MESReturnMessage(MESDataObject.MESReturnMessage.GetMESReturnMessage("MES00000256", new string[] { kpItem.KP_PARTNO, skuMpn, itemDetail.SCANTYPE }));
                        }
                        if (kpRule.REGEX == "")
                        {
                            throw new MESDataObject.MESReturnMessage(MESDataObject.MESReturnMessage.GetMESReturnMessage("MES00000256", new string[] { kpItem.KP_PARTNO, skuMpn, itemDetail.SCANTYPE }));
                        }
                        rowSNKP            = (Row_R_SN_KP)t_r_sn_kp.NewRow();
                        rowSNKP.ID         = t_r_sn_kp.GetNewID(Station.BU, sfcdb);
                        rowSNKP.R_SN_ID    = r_sn.ID;
                        rowSNKP.SN         = r_sn.SN;
                        rowSNKP.VALUE      = "";
                        rowSNKP.PARTNO     = kpItem.KP_PARTNO;
                        rowSNKP.KP_NAME    = kpItem.KP_NAME;
                        rowSNKP.MPN        = skuMpn;
                        rowSNKP.SCANTYPE   = itemDetail.SCANTYPE;
                        rowSNKP.ITEMSEQ    = kpItem.SEQ;
                        rowSNKP.SCANSEQ    = scanseq;
                        rowSNKP.DETAILSEQ  = itemDetail.SEQ;
                        rowSNKP.STATION    = kpItem.STATION;
                        rowSNKP.REGEX      = kpRule.REGEX;
                        rowSNKP.VALID_FLAG = 1;
                        rowSNKP.EXKEY1     = "";
                        rowSNKP.EXVALUE1   = "";
                        rowSNKP.EXKEY2     = "";
                        rowSNKP.EXVALUE2   = "";
                        rowSNKP.EDIT_EMP   = Station.LoginUser.EMP_NO;
                        rowSNKP.EDIT_TIME  = Station.GetDBDateTime();
                        result             = Convert.ToInt32(sfcdb.ExecSQL(rowSNKP.GetInsertString(sfcdbType)));
                        if (result <= 0)
                        {
                            throw new MESDataObject.MESReturnMessage(MESDataObject.MESReturnMessage.GetMESReturnMessage("MES00000083", new string[] { "R_SN_KP:" + r_sn.SN, "ADD" }));
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #21
0
 public RouteDetail(string id, OleExec sfcdb, MESDataObject.DB_TYPE_ENUM dbtype)
 {
     getById(id, sfcdb, dbtype);
 }
예제 #22
0
        private void getById(string id, OleExec sfcdb, MESDataObject.DB_TYPE_ENUM dbtype)
        {
            T_C_ROUTE_DETAIL            TC_ROUTE_DETAIL            = new T_C_ROUTE_DETAIL(sfcdb, dbtype);
            T_C_ROUTE_DETAIL_DIRECTLINK TC_ROUTE_DETAIL_DIRECTLINK = new T_C_ROUTE_DETAIL_DIRECTLINK(sfcdb, dbtype);
            T_C_ROUTE_DETAIL_RETURN     TC_ROUTE_DETAIL_RETURN     = new T_C_ROUTE_DETAIL_RETURN(sfcdb, dbtype);
            C_ROUTE_DETAIL getRouteDetail = new C_ROUTE_DETAIL();
            List <C_ROUTE_DETAIL_RETURN>     getDetailReturn     = new List <C_ROUTE_DETAIL_RETURN>();
            List <C_ROUTE_DETAIL_DIRECTLINK> getDetailDirectLink = new List <C_ROUTE_DETAIL_DIRECTLINK>();

            getRouteDetail = TC_ROUTE_DETAIL.GetById(id, sfcdb);
            if (getDetailReturn != null)
            {
                this._ID           = getRouteDetail.ID;
                this._SEQ_NO       = getRouteDetail.SEQ_NO;
                this._ROUTE_ID     = getRouteDetail.ROUTE_ID;
                this._STATION_NAME = getRouteDetail.STATION_NAME;
                this._STATION_TYPE = getRouteDetail.STATION_TYPE;
                this._RETURN_FLAG  = getRouteDetail.RETURN_FLAG;
                if (getRouteDetail.RETURN_FLAG == "Y")
                {
                    getDetailReturn = TC_ROUTE_DETAIL_RETURN.GetByRoute_DetailId(getRouteDetail.ID, sfcdb);
                    if (getDetailReturn != null && getDetailReturn.Count > 0)
                    {
                        List <C_ROUTE_DETAIL> newReturnList = new List <C_ROUTE_DETAIL>();
                        for (int j = 0; j < getDetailReturn.Count; j++)
                        {
                            newReturnList.Add(TC_ROUTE_DETAIL.GetById(getDetailReturn[j].RETURN_ROUTE_DETAIL_ID, sfcdb));
                        }
                        this._RETURNLIST = newReturnList;
                    }
                }
                else
                {
                    this._RETURNLIST = null;
                }
                getDetailDirectLink = TC_ROUTE_DETAIL_DIRECTLINK.GetByDetailId(getRouteDetail.ID, sfcdb);
                if (getDetailDirectLink != null && getDetailDirectLink.Count > 0)
                {
                    List <C_ROUTE_DETAIL> newDirectLinkList = new List <C_ROUTE_DETAIL>();
                    for (int n = 0; n < getDetailDirectLink.Count; n++)
                    {
                        newDirectLinkList.Add(TC_ROUTE_DETAIL.GetById(getDetailDirectLink[n].DIRECTLINK_ROUTE_DETAIL_ID, sfcdb));
                    }
                    this._DIRECTLINKLIST = newDirectLinkList;
                }
                else
                {
                    this._DIRECTLINKLIST = null;
                }
            }
            else
            {
                this._ID             = "";
                this._SEQ_NO         = null;
                this._ROUTE_ID       = "";
                this._STATION_NAME   = "";
                this._STATION_TYPE   = "";
                this._RETURN_FLAG    = "";
                this._DIRECTLINKLIST = null;
                this._RETURNLIST     = null;
                this._NEXTSTATION    = null;
            }
        }
예제 #23
0
 //add by LLF 2018-02-22 end
 public SN(string Sn, OleExec sfcdb, MESDataObject.DB_TYPE_ENUM dbType)
 {
     Load(Sn, sfcdb, dbType);
 }
예제 #24
0
 public void PanelSN(string Sn, OleExec sfcdb, MESDataObject.DB_TYPE_ENUM dbType)
 {
     PanelLoad(Sn, sfcdb, dbType);
 }