Пример #1
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;
            }
        }
Пример #2
0
        public static void WriteIntoMESLog(OleExec SFCDB, string bu, string programName, string className, string functionName, string logMessage, string logSql, string editEmp)
        {
            //OleExec SFCDB = new OleExec(db, false);
            T_R_MES_LOG   mesLog    = new T_R_MES_LOG(SFCDB, DB_TYPE_ENUM.Oracle);
            string        id        = mesLog.GetNewID(bu, SFCDB);
            Row_R_MES_LOG rowMESLog = (Row_R_MES_LOG)mesLog.NewRow();

            rowMESLog.ID             = id;
            rowMESLog.PROGRAM_NAME   = programName;
            rowMESLog.CLASS_NAME     = className;
            rowMESLog.FUNCTION_NAME  = functionName;
            rowMESLog.LOG_MESSAGE    = logMessage;
            rowMESLog.LOG_SQL        = logSql;
            rowMESLog.EDIT_EMP       = editEmp;
            rowMESLog.EDIT_TIME      = System.DateTime.Now;
            SFCDB.ThrowSqlExeception = true;
            SFCDB.ExecSQL(rowMESLog.GetInsertString(DB_TYPE_ENUM.Oracle));
        }