Esempio n. 1
0
        public void MarkWO(Newtonsoft.Json.Linq.JObject requestValue, Newtonsoft.Json.Linq.JObject Data, MESStationReturn StationReturn)
        {
            OleExec sfcdb = null;

            try
            {
                sfcdb = this.DBPools["SFCDB"].Borrow();
                T_R_WO_REGION   wo     = new T_R_WO_REGION(sfcdb, DB_TYPE_ENUM.Oracle);
                Row_R_WO_REGION r      = (Row_R_WO_REGION)wo.GetObjByID(Data["ID"].ToString(), sfcdb, DB_TYPE_ENUM.Oracle);
                string          strRet = sfcdb.ExecSQL(r.GetDeleteString(DB_TYPE_ENUM.Oracle));
                if (Convert.ToInt32(strRet) > 0)
                {
                    StationReturn.Status      = StationReturnStatusValue.Pass;
                    StationReturn.MessageCode = "MES00000004";
                    StationReturn.Data        = "";
                }
                else
                {
                    StationReturn.Status      = StationReturnStatusValue.Fail;
                    StationReturn.MessageCode = "NotLatestData";
                }
                this.DBPools["SFCDB"].Return(sfcdb);
            }
            catch (Exception e)
            {
                this.DBPools["SFCDB"].Return(sfcdb);
                throw e;
            }
        }
Esempio n. 2
0
        public void DeleteWoRange(Newtonsoft.Json.Linq.JObject requestValue, Newtonsoft.Json.Linq.JObject Data, MESStationReturn StationReturn)
        {
            OleExec sfcdb = null;

            try
            {
                sfcdb = this.DBPools["SFCDB"].Borrow();
                T_R_WO_REGION wo = new T_R_WO_REGION(sfcdb, DB_TYPE_ENUM.Oracle);
                foreach (var item in Data["ID"])
                {
                    Row_R_WO_REGION r      = (Row_R_WO_REGION)wo.GetObjByID(item.ToString(), sfcdb, DB_TYPE_ENUM.Oracle);
                    string          strRet = sfcdb.ExecSQL(r.GetDeleteString(DB_TYPE_ENUM.Oracle));
                    if (Convert.ToInt32(strRet) > 0)
                    {
                        StationReturn.Status      = StationReturnStatusValue.Pass;
                        StationReturn.MessageCode = "MES00000004";
                        StationReturn.Data        = "";
                        //writeLog
                        T_R_MES_LOG   mesLog    = new T_R_MES_LOG(sfcdb, DB_TYPE_ENUM.Oracle);
                        string        id        = mesLog.GetNewID(this.BU, sfcdb);
                        Row_R_MES_LOG rowMESLog = (Row_R_MES_LOG)mesLog.NewRow();
                        rowMESLog.ID             = id;
                        rowMESLog.PROGRAM_NAME   = "Web";
                        rowMESLog.CLASS_NAME     = this.GetType().ToString();
                        rowMESLog.FUNCTION_NAME  = "DeleteWoRange";
                        rowMESLog.LOG_MESSAGE    = "Success";
                        rowMESLog.LOG_SQL        = r.GetDeleteString(DB_TYPE_ENUM.Oracle);
                        rowMESLog.EDIT_EMP       = this.LoginUser.EMP_NO;
                        rowMESLog.EDIT_TIME      = System.DateTime.Now;
                        sfcdb.ThrowSqlExeception = true;
                        sfcdb.ExecSQL(rowMESLog.GetInsertString(DB_TYPE_ENUM.Oracle));
                    }
                    else
                    {
                        StationReturn.Status      = StationReturnStatusValue.Fail;
                        StationReturn.MessageCode = "NotLatestData";
                    }
                }
                this.DBPools["SFCDB"].Return(sfcdb);
            }
            catch (Exception e)
            {
                this.DBPools["SFCDB"].Return(sfcdb);
                throw e;
            }
        }