コード例 #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);
            }
        }
コード例 #2
0
        public void QueryCKpCheck(Newtonsoft.Json.Linq.JObject requestValue, Newtonsoft.Json.Linq.JObject Data, MESStationReturn StationReturn)
        {
            string       TypeName = Data["TYPENAME"].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);
                List <C_KP_Check> cKpCheckList = new List <C_KP_Check>();
                cKpCheckList = cKpCheck.GetCKpCheckByType(TypeName, oleDB);
                if (cKpCheckList.Count > 0)
                {
                    StationReturn.Status      = StationReturnStatusValue.Pass;
                    StationReturn.MessageCode = "MES00000033";
                    StationReturn.MessagePara.Add(cKpCheckList.Count);
                    StationReturn.Data = cKpCheckList;
                }
                else
                {
                    StationReturn.Status      = StationReturnStatusValue.Fail;
                    StationReturn.MessageCode = "MES00000034";
                    StationReturn.Data        = "";
                }
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                this.DBPools["SFCDB"].Return(oleDB);
            }
        }
コード例 #3
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);
            }
        }
コード例 #4
0
        public void AddCKpCheck(Newtonsoft.Json.Linq.JObject requestValue, Newtonsoft.Json.Linq.JObject Data, MESStationReturn StationReturn)
        {
            string       TypeName = Data["TYPENAME"].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);
                if (cKpCheck.IsExists(TypeName, Dll, Class, Function, oleDB))
                {
                    StationReturn.Status      = StationReturnStatusValue.Fail;
                    StationReturn.MessageCode = "MES00000005";
                    StationReturn.Data        = "";
                }
                else
                {
                    Row_C_KP_Check rowCKpCheck = (Row_C_KP_Check)cKpCheck.NewRow();
                    rowCKpCheck.ID           = cKpCheck.GetNewID(this.BU, oleDB, DBTYPE);
                    rowCKpCheck.TYPENAME     = TypeName;
                    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.GetInsertString(DBTYPE));
                    StationReturn.Status      = StationReturnStatusValue.Pass;
                    StationReturn.MessageCode = "MES00000002";
                    StationReturn.Data        = "";
                }
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                this.DBPools["SFCDB"].Return(oleDB);
            }
        }