Example #1
0
        //public  void AddInputActionS( Newtonsoft.Json.Linq.JToken Data, OleExec sfcdb)
        //{
        // //   OleExec sfcdb = null;
        //    string InsertSql = "";
        //    T_R_Input_Action inputaction;
        //    string ID = Data["ID"].ToString();
        //    string InputID = Data["InputID"].ToString();
        //    string StationActionID = Data["StationActionID"].ToString();
        //    int SeqNo = Convert.ToInt32(Data["SeqNo"]);
        //    string ConfigType = Data["ConfigType"].ToString();
        //    string ConfigValue = Data["ConfigValue"].ToString();
        //    int AddFlag = Convert.ToInt32(Data["AddFlag"]);
        //    try
        //    {
        //        sfcdb = this.DBPools["SFCDB"].Borrow();
        //        inputaction = new T_R_Input_Action(sfcdb, DBTYPE);
        //        DeleteInputAction(ID, sfcdb);
        //        Row_R_Input_Action row = (Row_R_Input_Action)inputaction.NewRow();
        //        row.ID = inputaction.GetNewID(BU, sfcdb);
        //        row.INPUT_ID = InputID;
        //        row.C_STATION_ACTION_ID = StationActionID;
        //        row.SEQ_NO = SeqNo;
        //        row.CONFIG_TYPE = ConfigType;
        //        row.CONFIG_VALUE = ConfigValue;
        //        row.ADD_FLAG = AddFlag;
        //        row.EDIT_EMP = LoginUser.EMP_NO;
        //        row.EDIT_TIME = GetDBDateTime();
        //        InsertSql = row.GetInsertString(DBTYPE);
        //        sfcdb.ExecSQL(InsertSql);
        //    }
        //    catch (Exception e)
        //    {
        //        //this.DBPools["SFCDB"].Return(sfcdb);
        //        throw e;

        //    }

        //}

        //public void DeleteInputAction(String ID, OleExec sfcdb)
        //{
        //    string DeleteSql = "";
        //    T_R_Input_Action stationaction;
        //    try
        //    {
        //        stationaction = new T_R_Input_Action(sfcdb, DBTYPE);
        //        if (stationaction.CheckDataExistByID(ID, sfcdb))
        //        {
        //            Row_R_Input_Action row = (Row_R_Input_Action)stationaction.GetObjByID(ID, sfcdb);
        //            DeleteSql = row.GetDeleteString(DBTYPE);
        //            sfcdb.ExecSQL(DeleteSql);
        //        }
        //    }
        //    catch (Exception e)
        //    {
        //        //  this.DBPools["SFCDB"].Return(sfcdb);
        //        throw e;
        //    }

        //}

        public void DeleteInputAction(Newtonsoft.Json.Linq.JObject requestValue, Newtonsoft.Json.Linq.JObject Data, MESStationReturn StationReturn)
        {
            OleExec          sfcdb     = null;
            string           DeleteSql = "";
            string           StrID     = "";
            T_R_Input_Action inputaction;

            //   string[] ID = Newtonsoft.Json.Linq.JArray(Data["ID"].);
            Newtonsoft.Json.Linq.JArray ID = (Newtonsoft.Json.Linq.JArray)Data["ID"];
            try
            {
                sfcdb = this.DBPools["SFCDB"].Borrow();
                sfcdb.BeginTrain();
                inputaction = new T_R_Input_Action(sfcdb, DBTYPE);
                for (int i = 0; i < ID.Count; i++)
                {
                    StrID = ID[i].ToString();
                    Row_R_Input_Action row = (Row_R_Input_Action)inputaction.GetObjByID(StrID, sfcdb);
                    DeleteSql = row.GetDeleteString(DBTYPE);
                    sfcdb.ExecSQL(DeleteSql);
                }
                sfcdb.CommitTrain();
                StationReturn.Status      = StationReturnStatusValue.Pass;
                StationReturn.MessageCode = "MES00000004";
                this.DBPools["SFCDB"].Return(sfcdb);
            }
            catch (Exception e)
            {
                this.DBPools["SFCDB"].Return(sfcdb);
                throw e;
            }
        }
Example #2
0
        public void AddInputAction(Newtonsoft.Json.Linq.JObject requestValue, Newtonsoft.Json.Linq.JObject Data, MESStationReturn StationReturn)
        {
            OleExec          sfcdb     = null;
            string           InsertSql = "";
            T_R_Input_Action inputaction;
            string           InputID         = Data["InputID"].ToString().Trim();
            string           StationActionID = Data["StationActionID"].ToString().Trim();
            int    SeqNo       = Convert.ToInt32(Data["SeqNo"]);
            string ConfigType  = Data["ConfigType"].ToString();
            string ConfigValue = Data["ConfigValue"].ToString();
            int    AddFlag     = Convert.ToInt32(Data["AddFlag"]);

            try
            {
                sfcdb       = this.DBPools["SFCDB"].Borrow();
                inputaction = new T_R_Input_Action(sfcdb, DBTYPE);
                if (inputaction.CheckDataExist(InputID, StationActionID, sfcdb))
                {
                    Row_R_Input_Action row = (Row_R_Input_Action)inputaction.NewRow();
                    row.ID                  = inputaction.GetNewID(BU, sfcdb);
                    row.INPUT_ID            = InputID;
                    row.C_STATION_ACTION_ID = StationActionID;
                    row.SEQ_NO              = SeqNo;
                    row.CONFIG_TYPE         = ConfigType;
                    row.CONFIG_VALUE        = ConfigValue;
                    row.ADD_FLAG            = AddFlag;
                    row.EDIT_EMP            = LoginUser.EMP_NO;
                    row.EDIT_TIME           = GetDBDateTime();
                    InsertSql               = row.GetInsertString(DBTYPE);
                    sfcdb.ExecSQL(InsertSql);
                    StationReturn.Status      = StationReturnStatusValue.Pass;
                    StationReturn.MessageCode = "MES00000002";
                    this.DBPools["SFCDB"].Return(sfcdb);
                }
                else
                {
                    StationReturn.Status      = StationReturnStatusValue.Fail;
                    StationReturn.MessageCode = "MES00000005";
                }
            }
            catch (Exception e)
            {
                this.DBPools["SFCDB"].Return(sfcdb);
                throw e;
            }
        }
Example #3
0
        public void DeleteInputAction(String ID, OleExec sfcdb)
        {
            string           DeleteSql = "";
            T_R_Input_Action stationaction;

            try
            {
                stationaction = new T_R_Input_Action(sfcdb, DBTYPE);
                if (stationaction.CheckDataExistByID(ID, sfcdb))
                {
                    Row_R_Input_Action row = (Row_R_Input_Action)stationaction.GetObjByID(ID, sfcdb);
                    DeleteSql = row.GetDeleteString(DBTYPE);
                    sfcdb.ExecSQL(DeleteSql);
                }
            }
            catch (Exception e)
            {
                //  this.DBPools["SFCDB"].Return(sfcdb);
                throw e;
            }
        }
Example #4
0
        public void AddInputActionS(Newtonsoft.Json.Linq.JToken Data, OleExec sfcdb)
        {
            //   OleExec sfcdb = null;
            string           InsertSql = "";
            T_R_Input_Action inputaction;
            string           ID              = Data["ID"].ToString();
            string           InputID         = Data["InputID"].ToString();
            string           StationActionID = Data["StationActionID"].ToString();
            int    SeqNo       = Convert.ToInt32(Data["SeqNo"]);
            string ConfigType  = Data["ConfigType"].ToString();
            string ConfigValue = Data["ConfigValue"].ToString();
            int    AddFlag     = Convert.ToInt32(Data["AddFlag"]);

            try
            {
                inputaction = new T_R_Input_Action(sfcdb, DBTYPE);
                DeleteInputAction(ID, sfcdb);
                Row_R_Input_Action row = (Row_R_Input_Action)inputaction.NewRow();
                row.ID                  = ID;
                row.INPUT_ID            = InputID;
                row.C_STATION_ACTION_ID = StationActionID;
                row.SEQ_NO              = SeqNo;
                row.CONFIG_TYPE         = ConfigType;
                row.CONFIG_VALUE        = ConfigValue;
                row.ADD_FLAG            = AddFlag;
                row.EDIT_EMP            = LoginUser.EMP_NO;
                row.EDIT_TIME           = GetDBDateTime();
                InsertSql               = row.GetInsertString(DBTYPE);
                sfcdb.ExecSQL(InsertSql);
            }
            catch (Exception e)
            {
                //this.DBPools["SFCDB"].Return(sfcdb);
                throw e;
            }
        }