예제 #1
0
        public void AddStationOutput(Newtonsoft.Json.Linq.JObject requestValue, Newtonsoft.Json.Linq.JObject Data, MESStationReturn StationReturn)
        {
            OleExec            sfcdb     = null;
            string             InsertSql = "";
            T_R_Station_Output StationOutput;
            string             RStationID = Data["RStationID"].ToString().Trim();
            string             Name       = Data["Name"].ToString().Trim();
            int    SeqNo       = Convert.ToInt32(Data["SeqNo"]);
            string DisplayType = Data["DisplayType"].ToString();
            string SessionType = Data["SessionType"].ToString();
            string SessionKey  = Data["SessionKey"].ToString();

            try
            {
                sfcdb         = this.DBPools["SFCDB"].Borrow();
                StationOutput = new T_R_Station_Output(sfcdb, DBTYPE);
                if (StationOutput.CheckDataExist(RStationID, Name, sfcdb))
                {
                    Row_R_Station_Output row = (Row_R_Station_Output)StationOutput.NewRow();
                    row.ID           = StationOutput.GetNewID(BU, sfcdb);
                    row.R_STATION_ID = RStationID;
                    row.NAME         = Name;
                    row.SEQ_NO       = SeqNo;
                    row.DISPLAY_TYPE = DisplayType;
                    row.SESSION_TYPE = SessionType;
                    row.SESSION_KEY  = SessionKey;
                    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;
            }
        }
예제 #2
0
        public void GetID(Newtonsoft.Json.Linq.JObject requestValue, Newtonsoft.Json.Linq.JObject Data, MESStationReturn StationReturn)
        {
            OleExec            sfcdb;
            T_R_Station_Output stationout;
            string             ID = "";

            sfcdb = this.DBPools["SFCDB"].Borrow();
            try
            {
                stationout                = new T_R_Station_Output(sfcdb, DBTYPE);
                ID                        = stationout.GetNewID(BU, sfcdb);
                StationReturn.Status      = StationReturnStatusValue.Pass;
                StationReturn.Data        = ID;
                StationReturn.MessageCode = "MES00000001";
                this.DBPools["SFCDB"].Return(sfcdb);
            }
            catch (Exception e)
            {
                this.DBPools["SFCDB"].Return(sfcdb);
                throw e;
            }
        }