public void DeleteActionPara(Newtonsoft.Json.Linq.JObject requestValue, Newtonsoft.Json.Linq.JObject Data, MESStationReturn StationReturn) { OleExec sfcdb = null; string DeleteSql = ""; string StrID = ""; T_C_ACTION_PARA language; // 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(); language = new T_C_ACTION_PARA(sfcdb, DBTYPE); for (int i = 0; i < ID.Count; i++) { StrID = ID[i].ToString(); Row_C_ACTION_PARA row = (Row_C_ACTION_PARA)language.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; } }
/// <summary> /// 更新標簽顯示語言數據 /// </summary> /// <param name="requestValue"></param> /// <param name="Data"></param> /// <param name="StationReturn"></param> public void UpdateActionPara(Newtonsoft.Json.Linq.JObject requestValue, Newtonsoft.Json.Linq.JObject Data, MESStationReturn StationReturn) { OleExec sfcdb = null; string UpdateSql = ""; T_C_ACTION_PARA actionpara; string ID = Data["ID"].ToString().Trim(); string StationActionID = Data["StationActionID"].ToString().Trim(); Double Seq = Convert.ToDouble(Data["Seq"]); string Name = Data["Name"].ToString().Trim(); string Desc = Data["Desc"].ToString(); try { sfcdb = this.DBPools["SFCDB"].Borrow(); actionpara = new T_C_ACTION_PARA(sfcdb, DBTYPE); Row_C_ACTION_PARA row = (Row_C_ACTION_PARA)actionpara.GetObjByID(ID, sfcdb); row.ID = ID; row.C_STATION_ACTION_ID = StationActionID; row.SEQ_NO = Seq; row.NAME = Name; row.DESCRIPTION = Desc; row.EDIT_EMP = LoginUser.EMP_NO; row.EDIT_TIME = GetDBDateTime(); UpdateSql = row.GetUpdateString(DBTYPE); sfcdb.ExecSQL(UpdateSql); StationReturn.Status = StationReturnStatusValue.Pass; StationReturn.MessageCode = "MES00000003"; this.DBPools["SFCDB"].Return(sfcdb); } catch (Exception e) { this.DBPools["SFCDB"].Return(sfcdb); throw e; } }