Beispiel #1
0
        public void AddSeries(Newtonsoft.Json.Linq.JObject requestValue, Newtonsoft.Json.Linq.JObject Data, MESStationReturn StationReturn)
        {
            OleExec    sfcdb        = null;
            T_C_SERIES table        = null;
            string     SeriesObject = string.Empty;
            C_SERIES   series       = null;
            string     result       = string.Empty;

            try
            {
                sfcdb            = this.DBPools["SFCDB"].Borrow();
                table            = new T_C_SERIES(sfcdb, DBTYPE);
                SeriesObject     = Data["SeriesObject"].ToString();
                series           = (C_SERIES)JsonConvert.Deserialize(SeriesObject, typeof(C_SERIES));
                series.EDIT_EMP  = "A0225204";// LoginUser.EMP_NO;
                series.EDIT_TIME = DateTime.Now;
                result           = table.UpdateSeries(BU, series, "ADD", sfcdb);

                if (Int32.Parse(result) > 0)
                {
                    //添加成功
                    ConstructReturns(
                        ref StationReturn,
                        StationReturnStatusValue.Pass,
                        MESReturnMessage.GetMESReturnMessage("UpdateOK", new string[] { result }),
                        result);
                }
                else
                {
                    //沒有添加任何數據
                    ConstructReturns(
                        ref StationReturn,
                        StationReturnStatusValue.Pass,
                        MESReturnMessage.GetMESReturnMessage("UpdateNoData"),
                        result);
                }
            }
            catch (Exception e)
            {
                ConstructReturns(
                    ref StationReturn,
                    StationReturnStatusValue.Fail,
                    MESReturnMessage.GetMESReturnMessage("Exception", new string[] { e.Message }),
                    e.Message);
            }
            finally
            {
                this.DBPools["SFCDB"].Return(sfcdb);
            }
        }
Beispiel #2
0
        public void DeleteSeriesById(Newtonsoft.Json.Linq.JObject requestValue, Newtonsoft.Json.Linq.JObject Data, MESStationReturn StationReturn)
        {
            OleExec    sfcdb    = null;
            T_C_SERIES table    = null;
            C_SERIES   series   = null;
            string     result   = string.Empty;
            string     SeriesId = string.Empty;

            try
            {
                sfcdb     = this.DBPools["SFCDB"].Borrow();
                table     = new T_C_SERIES(sfcdb, DBTYPE);
                SeriesId  = Data["SeriesID"].ToString();
                series    = new C_SERIES();
                series.ID = SeriesId;
                result    = table.UpdateSeries(BU, series, "DELETE", sfcdb);

                if (Int32.Parse(result) > 0)
                {
                    //刪除成功
                    ConstructReturns(
                        ref StationReturn,
                        StationReturnStatusValue.Pass,
                        MESReturnMessage.GetMESReturnMessage("UpdateOK", new string[] { result }),
                        result);
                }
                else
                {
                    //沒有刪除任何數據
                    ConstructReturns(
                        ref StationReturn,
                        StationReturnStatusValue.Pass,
                        MESReturnMessage.GetMESReturnMessage("UpdateNoData"),
                        result);
                }
            }
            catch (Exception e)
            {
                ConstructReturns(
                    ref StationReturn,
                    StationReturnStatusValue.Fail,
                    MESReturnMessage.GetMESReturnMessage("Exception", new string[] { e.Message }),
                    e.Message);
            }
            finally
            {
                this.DBPools["SFCDB"].Return(sfcdb);
            }
        }