Esempio n. 1
0
        public void DeleteWoReplaceKpWithSku(Newtonsoft.Json.Linq.JObject requestValue, Newtonsoft.Json.Linq.JObject Data, MESStationReturn StationReturn)
        {
            string    RWOKPREPLACEIDS = Data["RWOKPREPLACEIDS"].ToString().Trim();
            ArrayList DelIds          = new ArrayList(RWOKPREPLACEIDS.Split(','));

            DelIds.Remove("");
            OleExec           oleDB        = null;
            T_R_WO_KP_Repalce rWoKpRepalce = null;

            try
            {
                oleDB        = this.DBPools["SFCDB"].Borrow();
                rWoKpRepalce = new T_R_WO_KP_Repalce(oleDB, DBTYPE);
                oleDB.BeginTrain();
                foreach (var VARIABLE in (string[])DelIds.ToArray(typeof(string)))
                {
                    oleDB.ThrowSqlExeception = true;
                    Row_R_WO_KP_Repalce rowCSkuMpn = (Row_R_WO_KP_Repalce)rWoKpRepalce.GetObjByID(VARIABLE, oleDB, DBTYPE);
                    oleDB.ExecSQL(rowCSkuMpn.GetDeleteString(DBTYPE));
                }
                oleDB.CommitTrain();
                StationReturn.Status      = StationReturnStatusValue.Pass;
                StationReturn.MessageCode = "MES00000004";
            }
            catch (Exception e)
            {
                oleDB.RollbackTrain();
                throw e;
            }
            finally
            {
                this.DBPools["SFCDB"].Return(oleDB);
            }
        }