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)); }
public ActionResult Delete(CONFIG_TYPE model) { var removeModel = com.CONFIG_TYPE.Find(model.Id); com.CONFIG_TYPE.Remove(removeModel); com.SaveChanges(); return(View("index", "")); }
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); }
public static Dictionary <int, IMessage> GetConfigs(CONFIG_TYPE configType) { if (!allConfigs.TryGetValue(configType, out Dictionary <int, IMessage> configs)) { return(null); } return(configs); }
public static void LoadConfigs(CONFIG_TYPE pmCT) { if (configs == null) { configs = new Dictionary <string, string>(); } configs.Clear(); ct = pmCT; }
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)); }
/// <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); }
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)); }
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)); }
public XMLLoader(CONFIG_TYPE type) { this.type = type; }
public ActionResult Details(CONFIG_TYPE model) { com.CONFIG_TYPE.Find(model.Id); return(View(model)); }
public ActionResult Edit(CONFIG_TYPE model) { com.Entry <CONFIG_TYPE>(model).State = EntityState.Modified; com.SaveChanges(); return(View(model)); }
public ActionResult Create(CONFIG_TYPE model) { com.CONFIG_TYPE.Add(model); com.SaveChanges(); return(View("details", model)); }