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; } }
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; } }