Beispiel #1
0
        /// <summary>
        /// 刪除標簽顯示語言數據
        /// </summary>
        /// <param name="requestValue"></param>
        /// <param name="Data"></param>
        /// <param name="StationReturn"></param>
        public void DeletePageLanguage(Newtonsoft.Json.Linq.JObject requestValue, Newtonsoft.Json.Linq.JObject Data, MESStationReturn StationReturn)
        {
            OleExec           sfcdb     = null;
            string            DeleteSql = "";
            string            StrID     = "";
            T_C_LANGUAGE_PAGE 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_LANGUAGE_PAGE(sfcdb, DBTYPE);
                for (int i = 0; i < ID.Count; i++)
                {
                    StrID = ID[i].ToString();
                    Row_C_LANGUAGE_PAGE row = (Row_C_LANGUAGE_PAGE)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)
            {
                sfcdb.RollbackTrain();
                this.DBPools["SFCDB"].Return(sfcdb);
                throw e;
            }
        }
Beispiel #2
0
        /// <summary>
        /// 更新標簽顯示語言數據
        /// </summary>
        /// <param name="requestValue"></param>
        /// <param name="Data"></param>
        /// <param name="StationReturn"></param>
        public void UpdatePageLanguage(Newtonsoft.Json.Linq.JObject requestValue, Newtonsoft.Json.Linq.JObject Data, MESStationReturn StationReturn)
        {
            OleExec           sfcdb     = null;
            string            UpdateSql = "";
            T_C_LANGUAGE_PAGE language;
            string            ID        = Data["ID"].ToString().Trim();
            string            PageName  = Data["PageName"].ToString().Trim();
            string            LabelName = Data["LabelName"].ToString().Trim();
            string            Chinese   = Data["Chinese"].ToString().Trim();
            string            ChineseWT = Data["ChineseWT"].ToString().Trim();
            string            English   = Data["English"].ToString().Trim();

            try
            {
                sfcdb    = this.DBPools["SFCDB"].Borrow();
                language = new T_C_LANGUAGE_PAGE(sfcdb, DBTYPE);
                Row_C_LANGUAGE_PAGE row = (Row_C_LANGUAGE_PAGE)language.GetObjByID(Data["ID"].ToString().Trim(), sfcdb);
                row.ID          = ID;
                row.PAGE_NAME   = PageName;
                row.LABEL_NAME  = LabelName;
                row.CHINESE     = Chinese;
                row.CHINESE_TW  = ChineseWT;
                row.ENGLISH     = English;
                row.EDIT_EMP    = LoginUser.EMP_NO;
                row.SYSTEM_NAME = SystemName;
                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;
            }
        }