Esempio n. 1
0
        public void GetSkunoByWo(Newtonsoft.Json.Linq.JObject requestValue, Newtonsoft.Json.Linq.JObject Data, MESStationReturn StationReturn)
        {
            OleExec          oleDB       = null;
            T_R_WO_BASE      sec         = null;
            string           WORKORDERNO = string.Empty;
            string           SKUNO       = string.Empty;
            List <R_WO_BASE> list        = new List <R_WO_BASE>();

            try
            {
                oleDB       = this.DBPools["SFCDB"].Borrow();
                sec         = new T_R_WO_BASE(oleDB, DBTYPE);
                WORKORDERNO = Data["WORKORDERNO"].ToString().Trim();
                list        = sec.GetSkunoByWO(WORKORDERNO, SKUNO, oleDB);
                if (list.Count > 0)
                {
                    StationReturn.Status      = StationReturnStatusValue.Pass;
                    StationReturn.MessageCode = "MES00000033";
                    StationReturn.MessagePara.Add(list.Count);
                    StationReturn.Data = list;
                }
                else
                {
                    StationReturn.Status      = StationReturnStatusValue.Pass;
                    StationReturn.MessageCode = "MES00000034";
                    StationReturn.Data        = new object();
                }
                if (oleDB != null)
                {
                    this.DBPools["SFCDB"].Return(oleDB);
                }
            }
            catch (Exception exception)
            {
                this.DBPools["SFCDB"].Return(oleDB);
                StationReturn.Status  = StationReturnStatusValue.Fail;
                StationReturn.Message = exception.Message;
                StationReturn.Data    = "";
                if (oleDB != null)
                {
                    this.DBPools["SFCDB"].Return(oleDB);
                }
            }
        }