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

            DelIds.Remove("");
            OleExec      oleDB    = null;
            T_C_KP_Check cKpCheck = null;

            try
            {
                oleDB    = this.DBPools["SFCDB"].Borrow();
                cKpCheck = new T_C_KP_Check(oleDB, DBTYPE);
                oleDB.BeginTrain();
                foreach (var VARIABLE in (string[])DelIds.ToArray(typeof(string)))
                {
                    oleDB.ThrowSqlExeception = true;
                    Row_C_KP_Check row = (Row_C_KP_Check)cKpCheck.GetObjByID(VARIABLE, oleDB, DBTYPE);
                    oleDB.ExecSQL(row.GetDeleteString(DBTYPE));
                }
                oleDB.CommitTrain();
                StationReturn.Status      = StationReturnStatusValue.Pass;
                StationReturn.MessageCode = "MES00000004";
            }
            catch (Exception e)
            {
                oleDB.RollbackTrain();
                throw e;
            }
            finally
            {
                this.DBPools["SFCDB"].Return(oleDB);
            }
        }
Exemple #2
0
        public void UpdateCKpCheck(Newtonsoft.Json.Linq.JObject requestValue, Newtonsoft.Json.Linq.JObject Data, MESStationReturn StationReturn)
        {
            string id             = Data["ID"].ToString().Trim(),
                   Dll            = Data["DLL"].ToString().Trim(),
                   Class          = Data["CLASS"].ToString().Trim(),
                   Function       = Data["FUNCTION"].ToString().Trim();
            OleExec      oleDB    = null;
            T_C_KP_Check cKpCheck = null;

            try
            {
                oleDB    = this.DBPools["SFCDB"].Borrow();
                cKpCheck = new T_C_KP_Check(oleDB, DBTYPE);
                Row_C_KP_Check rowCKpCheck = (Row_C_KP_Check)cKpCheck.GetObjByID(id, oleDB, DBTYPE);
                if (rowCKpCheck == null)
                {
                    StationReturn.Status      = StationReturnStatusValue.Fail;
                    StationReturn.MessageCode = "MES00000005";
                    StationReturn.Data        = "";
                }
                else
                {
                    rowCKpCheck.DLL          = Dll;
                    rowCKpCheck.CLASS        = Class;
                    rowCKpCheck.FUNCTION     = Function;
                    rowCKpCheck.EDIT_EMP     = this.LoginUser.EMP_NO;
                    rowCKpCheck.EDIT_TIME    = GetDBDateTime();
                    oleDB.ThrowSqlExeception = true;
                    oleDB.ExecSQL(rowCKpCheck.GetUpdateString(DBTYPE));
                    StationReturn.Status      = StationReturnStatusValue.Pass;
                    StationReturn.MessageCode = "MES00000004";
                }
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                oleDB.ThrowSqlExeception = false;
                this.DBPools["SFCDB"].Return(oleDB);
            }
        }