Exemplo n.º 1
0
        public void StationInsert(Newtonsoft.Json.Linq.JObject requestValue, Newtonsoft.Json.Linq.JObject Data, MESStationReturn StationReturn)
        {
            OleExec sfcdb = null;

            try
            {
                sfcdb = this.DBPools["SFCDB"].Borrow();
                T_C_STATION   cStation = new T_C_STATION(sfcdb, DB_TYPE_ENUM.Oracle);
                Row_C_STATION rStation = (Row_C_STATION)cStation.NewRow();
                rStation.ID           = cStation.GetNewID(BU, sfcdb);
                rStation.STATION_NAME = (Data["StationName"].ToString()).Trim();
                rStation.TYPE         = (Data["TYPE"].ToString()).Trim();
                string strRet = sfcdb.ExecSQL(rStation.GetInsertString(DB_TYPE_ENUM.Oracle));
                if (Convert.ToInt32(strRet) > 0)
                {
                    StationReturn.Status      = StationReturnStatusValue.Pass;
                    StationReturn.MessageCode = "MES00000002";
                    StationReturn.Data        = strRet;
                }
                else
                {
                    StationReturn.Status      = StationReturnStatusValue.Fail;
                    StationReturn.MessageCode = "MES00000036";
                    StationReturn.Data        = "";
                }
                this.DBPools["SFCDB"].Return(sfcdb);
            }
            catch (Exception e)
            {
                this.DBPools["SFCDB"].Return(sfcdb);
                throw e;
            }
        }
Exemplo n.º 2
0
        public void StationInsert(Newtonsoft.Json.Linq.JObject requestValue, Newtonsoft.Json.Linq.JObject Data, MESStationReturn StationReturn)
        {
            OleExec sfcdb = this.DBPools["SFCDB"].Borrow();

            try
            {
                T_C_STATION   cStation = new T_C_STATION(sfcdb, DB_TYPE_ENUM.Oracle);
                Row_C_STATION rStation = (Row_C_STATION)cStation.NewRow();
                rStation.ID           = cStation.GetNewID(Data["BU"].ToString(), sfcdb);
                rStation.STATION_NAME = Data["StationName"].ToString();
                rStation.TYPE         = Data["TYPE"].ToString();
                string strRet = sfcdb.ExecSQL(rStation.GetInsertString(DB_TYPE_ENUM.Oracle));
                if (Convert.ToInt32(strRet) > 0)
                {
                    StationReturn.Status  = "1";
                    StationReturn.Message = "OK";
                    StationReturn.Data    = strRet;
                }
            }
            catch (Exception e)
            {
                StationReturn.Status  = "0";
                StationReturn.Message = e.Message;
            }
            finally
            {
                this.DBPools["SFCDB"].Return(sfcdb);
            }
        }