Exemple #1
0
        public void SelectByColumnName(Newtonsoft.Json.Linq.JObject requestValue, Newtonsoft.Json.Linq.JObject Data, MESStationReturn StationReturn)
        {
            OleExec sfcdb = null;

            try
            {
                sfcdb = this.DBPools["SFCDB"].Borrow();
                string                  data     = (Data["ColumnValue"].ToString()).Trim();
                string                  column   = (Data["ColumnName"].ToString()).Trim();
                T_C_STATION             cStation = new T_C_STATION(sfcdb, DB_TYPE_ENUM.Oracle);
                List <C_STATION_DETAIL> list     = new List <C_STATION_DETAIL>();
                list = cStation.GetDataByColumn(column, data, sfcdb);
                if (list.Count > 0)
                {
                    StationReturn.Data        = list;
                    StationReturn.Status      = StationReturnStatusValue.Pass;
                    StationReturn.MessageCode = "MES00000033";
                    StationReturn.MessagePara.Add(list.Count);
                }
                else
                {
                    StationReturn.Status      = StationReturnStatusValue.Fail;
                    StationReturn.MessageCode = "MES00000034";
                    StationReturn.Data        = "";
                }
                this.DBPools["SFCDB"].Return(sfcdb);
            }
            catch (Exception e)
            {
                this.DBPools["SFCDB"].Return(sfcdb);
                throw e;
            }
        }
        public void SelectByColumnName(Newtonsoft.Json.Linq.JObject requestValue, Newtonsoft.Json.Linq.JObject Data, MESStationReturn StationReturn)
        {
            OleExec sfcdb = this.DBPools["SFCDB"].Borrow();

            try
            {
                string                  data     = (Data["ColumnValue"].ToString()).Trim();
                string                  column   = (Data["ColumnName"].ToString()).Trim();
                T_C_STATION             cStation = new T_C_STATION(sfcdb, DB_TYPE_ENUM.Oracle);
                List <C_STATION_DETAIL> list     = new List <C_STATION_DETAIL>();
                list = cStation.GetDataByColumn(column, data, sfcdb);
                if (list.Count > 0)
                {
                    StationReturn.Data    = list;
                    StationReturn.Status  = "1";
                    StationReturn.Message = "OK";
                }
                else
                {
                    StationReturn.Status  = "0";
                    StationReturn.Message = "No data found";
                }
            }
            catch (Exception e)
            {
                StationReturn.Message = e.Message;
                StationReturn.Status  = "0";
            }
            finally
            {
                this.DBPools["SFCDB"].Return(sfcdb);
            }
        }