// POST: odata/MemberGameInfoStages public IHttpActionResult Post(MemberGameInfoStages memberGameInfoStages) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.MemberGameInfoStages.Add(memberGameInfoStages); try { db.SaveChanges(); } catch (DbUpdateException) { if (MemberGameInfoStagesExists(memberGameInfoStages.MemberGameInfoStageID)) { return(Conflict()); } else { throw; } } return(Created(memberGameInfoStages)); }
public ActionResult Create([Bind(Include = "MemberGameInfoStageID,MemberID,StageName,StageStatus,Category1,Category2,Category3,Mission1,Mission2,Mission3,Mission4,Mission5,Points,StageStat1,StageStat2,StageStat3,StageStat4,StageStat5,sCol1,sCol2,sCol3,sCol4,sCol5,sCol6,sCol7,sCol8,sCol9,sCol10,HideYN,DeleteYN,CreatedAt,UpdatedAt,DataFromRegion,DataFromRegionDT")] MemberGameInfoStages memberGameInfoStages) { try { // Create 세션체크 if (!CheckSession()) { return(Redirect("/AdminLogin/Login")); } if (ModelState.IsValid) { // 입력값 자동 처리 memberGameInfoStages.CreatedAt = DateTimeOffset.UtcNow; memberGameInfoStages.UpdatedAt = DateTimeOffset.UtcNow; // Insert : 암호화 처리 if (globalVal.CloudBreadCryptSetting == "AES256") { EncryptResult(memberGameInfoStages); } db.MemberGameInfoStages.Add(memberGameInfoStages); // 관리자 접근 로그 logMessage.memberID = this.Session["AdminID"].ToString(); logMessage.Level = "INFO"; logMessage.Logger = "MemberGameInfoStagesController-Create(memberGameInfoStages)"; logMessage.Message = JsonConvert.SerializeObject(memberGameInfoStages); Logging.RunLog(logMessage); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(memberGameInfoStages)); } catch (Exception ex) { //에러로그 logMessage.memberID = this.Session["AdminID"].ToString(); logMessage.Level = "ERROR"; logMessage.Logger = "MemberGameInfoStagesController-Create(memberGameInfoStages)"; logMessage.Message = JsonConvert.SerializeObject(memberGameInfoStages); logMessage.Exception = ex.ToString(); Logging.RunLog(logMessage); throw; } }
// DELETE: odata/MemberGameInfoStages(5) public IHttpActionResult Delete([FromODataUri] string key) { MemberGameInfoStages memberGameInfoStages = db.MemberGameInfoStages.Find(key); if (memberGameInfoStages == null) { return(NotFound()); } db.MemberGameInfoStages.Remove(memberGameInfoStages); db.SaveChanges(); return(StatusCode(HttpStatusCode.NoContent)); }
// GET: MemberGameInfoStages/Delete/5 public ActionResult Delete(string id) { try { // Delete 세션체크 if (!CheckSession()) { return(Redirect("/AdminLogin/Login")); } if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MemberGameInfoStages memberGameInfoStages = db.MemberGameInfoStages.Find(id); if (memberGameInfoStages == null) { return(HttpNotFound()); } // 관리자 접근 로그 logMessage.memberID = this.Session["AdminID"].ToString(); logMessage.Level = "INFO"; logMessage.Logger = "MemberGameInfoStagesController-Delete(id)"; logMessage.Message = string.Format("id : {0}", id); Logging.RunLog(logMessage); return(View(memberGameInfoStages)); } catch (Exception ex) { //에러로그 logMessage.memberID = this.Session["AdminID"].ToString(); logMessage.Level = "ERROR"; logMessage.Logger = "MemberGameInfoStagesController-Delete(id)"; logMessage.Message = string.Format("id : {0}", id); logMessage.Exception = ex.ToString(); Logging.RunLog(logMessage); throw; } }
//암호화 처리 public MemberGameInfoStages EncryptResult(MemberGameInfoStages item) { try { item.MemberGameInfoStageID = Crypto.AES_encrypt(item.MemberGameInfoStageID, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.MemberID = Crypto.AES_encrypt(item.MemberID, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.Members.Name1 = Crypto.AES_encrypt(item.Members.Name1, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.StageName = Crypto.AES_encrypt(item.StageName, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.StageStatus = Crypto.AES_encrypt(item.StageStatus, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.Category1 = Crypto.AES_encrypt(item.Category1, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.Category2 = Crypto.AES_encrypt(item.Category2, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.Category3 = Crypto.AES_encrypt(item.Category3, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.Mission1 = Crypto.AES_encrypt(item.Mission1, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.Mission2 = Crypto.AES_encrypt(item.Mission2, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.Mission3 = Crypto.AES_encrypt(item.Mission3, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.Mission4 = Crypto.AES_encrypt(item.Mission4, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.Mission5 = Crypto.AES_encrypt(item.Mission5, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.Points = Crypto.AES_encrypt(item.Points, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.StageStat1 = Crypto.AES_encrypt(item.StageStat1, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.StageStat2 = Crypto.AES_encrypt(item.StageStat2, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.StageStat3 = Crypto.AES_encrypt(item.StageStat3, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.StageStat4 = Crypto.AES_encrypt(item.StageStat4, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.StageStat5 = Crypto.AES_encrypt(item.StageStat5, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol1 = Crypto.AES_encrypt(item.sCol1, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol2 = Crypto.AES_encrypt(item.sCol2, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol3 = Crypto.AES_encrypt(item.sCol3, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol4 = Crypto.AES_encrypt(item.sCol4, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol5 = Crypto.AES_encrypt(item.sCol5, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol6 = Crypto.AES_encrypt(item.sCol6, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol7 = Crypto.AES_encrypt(item.sCol7, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol8 = Crypto.AES_encrypt(item.sCol8, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol9 = Crypto.AES_encrypt(item.sCol9, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol10 = Crypto.AES_encrypt(item.sCol10, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); } catch (Exception) { throw; } return(item); }
// PUT: odata/MemberGameInfoStages(5) public IHttpActionResult Put([FromODataUri] string key, Delta <MemberGameInfoStages> patch) { Validate(patch.GetEntity()); if (!ModelState.IsValid) { return(BadRequest(ModelState)); } MemberGameInfoStages memberGameInfoStages = db.MemberGameInfoStages.Find(key); if (memberGameInfoStages == null) { return(NotFound()); } patch.Put(memberGameInfoStages); try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!MemberGameInfoStagesExists(key)) { return(NotFound()); } else { throw; } } return(Updated(memberGameInfoStages)); }
public ActionResult DeleteConfirmed(string id) { try { // Delete 세션체크 if (!CheckSession()) { return(Redirect("/AdminLogin/Login")); } MemberGameInfoStages memberGameInfoStages = db.MemberGameInfoStages.Find(id); db.MemberGameInfoStages.Remove(memberGameInfoStages); db.SaveChanges(); // 관리자 접근 로그 logMessage.memberID = this.Session["AdminID"].ToString(); logMessage.Level = "INFO"; logMessage.Logger = "MemberGameInfoStagesController-DeleteConfirm(id)"; logMessage.Message = string.Format("id : {0}", id); Logging.RunLog(logMessage); return(RedirectToAction("Index")); } catch (Exception ex) { //에러로그 logMessage.memberID = this.Session["AdminID"].ToString(); logMessage.Level = "ERROR"; logMessage.Logger = "MemberGameInfoStagesController-DeleteConfirm(id)"; logMessage.Message = string.Format("id : {0}", id); logMessage.Exception = ex.ToString(); Logging.RunLog(logMessage); throw; } }