예제 #1
0
        public async Task <IHttpActionResult> PutCONFIG_TYPE(int id, CONFIG_TYPE cONFIG_TYPE)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != cONFIG_TYPE.Id)
            {
                return(BadRequest());
            }

            db.Entry(cONFIG_TYPE).State = EntityState.Modified;

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!CONFIG_TYPEExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
예제 #2
0
        public ActionResult Delete(CONFIG_TYPE model)
        {
            var removeModel = com.CONFIG_TYPE.Find(model.Id);

            com.CONFIG_TYPE.Remove(removeModel);
            com.SaveChanges();
            return(View("index", ""));
        }
예제 #3
0
        public static T GetConfigs <T>(CONFIG_TYPE configType, int index) where T : Dictionary <int, IMessage>
        {
            if (!allConfigs.TryGetValue(configType, out Dictionary <int, IMessage> configs))
            {
                return(null);
            }

            return((T)configs);
        }
예제 #4
0
        public static Dictionary <int, IMessage> GetConfigs(CONFIG_TYPE configType)
        {
            if (!allConfigs.TryGetValue(configType, out Dictionary <int, IMessage> configs))
            {
                return(null);
            }

            return(configs);
        }
예제 #5
0
        public static void LoadConfigs(CONFIG_TYPE pmCT)
        {
            if (configs == null)
            {
                configs = new Dictionary <string, string>();
            }
            configs.Clear();

            ct = pmCT;
        }
예제 #6
0
        public async Task <IHttpActionResult> GetCONFIG_TYPE(int id)
        {
            CONFIG_TYPE cONFIG_TYPE = await db.CONFIG_TYPE.FindAsync(id);

            if (cONFIG_TYPE == null)
            {
                return(NotFound());
            }

            return(Ok(cONFIG_TYPE));
        }
예제 #7
0
        /// <summary>
        /// Used to get config values as it is in DB
        /// </summary>
        /// <param name="companyCode"></param>
        /// <param name="config_Type"></param>
        /// <param name="config_Key"></param>
        /// <returns></returns>
        public string GetConfigValueasperDB(string companyCode, CONFIG_TYPE config_Type, CONFIG_KEY config_Key)
        {
            // Creates the SP Data instance.
            _objSPData = new SPData();

            // Call SPData method.
            string configDefaultValue = _objSPData.GetConfigDefaultValue(companyCode, config_Type, config_Key);

            // DB retruns value if null returns the default value.
            return(configDefaultValue == null ? "" : configDefaultValue);
        }
예제 #8
0
        public async Task <IHttpActionResult> PostCONFIG_TYPE(CONFIG_TYPE cONFIG_TYPE)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.CONFIG_TYPE.Add(cONFIG_TYPE);
            await db.SaveChangesAsync();

            return(CreatedAtRoute("DefaultApi", new { id = cONFIG_TYPE.Id }, cONFIG_TYPE));
        }
예제 #9
0
        public async Task <IHttpActionResult> DeleteCONFIG_TYPE(int id)
        {
            CONFIG_TYPE cONFIG_TYPE = await db.CONFIG_TYPE.FindAsync(id);

            if (cONFIG_TYPE == null)
            {
                return(NotFound());
            }

            db.CONFIG_TYPE.Remove(cONFIG_TYPE);
            await db.SaveChangesAsync();

            return(Ok(cONFIG_TYPE));
        }
예제 #10
0
 public XMLLoader(CONFIG_TYPE type)
 {
     this.type = type;
 }
예제 #11
0
 public ActionResult Details(CONFIG_TYPE model)
 {
     com.CONFIG_TYPE.Find(model.Id);
     return(View(model));
 }
예제 #12
0
 public ActionResult Edit(CONFIG_TYPE model)
 {
     com.Entry <CONFIG_TYPE>(model).State = EntityState.Modified;
     com.SaveChanges();
     return(View(model));
 }
예제 #13
0
 public ActionResult Create(CONFIG_TYPE model)
 {
     com.CONFIG_TYPE.Add(model);
     com.SaveChanges();
     return(View("details", model));
 }