public ActionResult AddPopup(pcms_popup Popup, FormCollection col) { try { Popup.INSERTED_DATE = DateTime.Now; Popup.TS_CNT = 0; Popup.INSERTED_BY = Session["userKey"].ToString(); var res = objBAL.Addpopup(Popup); if (res.Contains("Inserted")) { return(RedirectToAction("Popup")); } else if (res.Contains("Duplicate")) { ViewBag.Error = "Popup Name must be unique"; return(View()); } else { ViewBag.Error = "Something went wrong while adding Popu"; return(View()); } } catch (Exception ex) { ErrorLog obj = new ErrorLog(); obj.LogError(ex); return(null); } }
public pcms_popup EditpopUp(int query) { try { pcms_popup _popup = new pcms_popup(); PCMS_DbContext context = new PCMS_DbContext(); var res = context.pcms_popup.Single(popup => popup.POPUP_ID == query); pcms_design dn = new pcms_design(); _popup.POPUP_ID = res.POPUP_ID; _popup.POPUP_NAME = Cryptographys.Decrypt(res.POPUP_NAME); _popup.POPUP_DESCRIPTION = Cryptographys.Decrypt(res.POPUP_DESCRIPTION); _popup.POPUP_HTML = Cryptographys.Decrypt(res.POPUP_HTML); _popup.INSERTED_BY = res.INSERTED_BY; _popup.INSERTED_DATE = res.INSERTED_DATE; _popup.POPUP_ISDELETED = res.POPUP_ISDELETED; _popup.TS_CNT = res.TS_CNT; return(_popup); } catch (Exception ex) { Utilities objUtilities = new Utilities(); objUtilities.LogError(ex); return(null); } }
public string DeletepopUp(int query) { string Msg = ""; try { PCMS_DbContext context = new PCMS_DbContext(); pcms_popup poupu = context.pcms_popup.Single(x => x.POPUP_ID == query); context.pcms_popup.DeleteObject(poupu); context.SaveChanges(); Msg = "Deleted"; return(Msg); } catch (Exception ex) { Utilities objUtilities = new Utilities(); objUtilities.LogError(ex); Msg = "Something went wrong"; return(null); } }
public string UpdatepopUp(pcms_popup _Popup) { string Msg = ""; try { PCMS_DbContext context = new PCMS_DbContext(); pcms_popup nUser = context.pcms_popup.Single(u => u.POPUP_ID == _Popup.POPUP_ID); nUser.POPUP_DESCRIPTION = Cryptographys.Encrypt(_Popup.POPUP_DESCRIPTION); nUser.POPUP_HTML = Cryptographys.Encrypt(_Popup.POPUP_HTML); context.SaveChanges(); Msg = "Updated"; return(Msg); } catch (Exception ex) { Utilities objUtilities = new Utilities(); objUtilities.LogError(ex); Msg = "Something went wrong"; return(null); } }
public string AddpopUp(pcms_popup _Popup) { string Msg = ""; try { PCMS_DbContext context = new PCMS_DbContext(); if (!context.pcms_popup.Any(u => u.POPUP_NAME == _Popup.POPUP_NAME)) { pcms_popup pu = new pcms_popup(); pu.POPUP_PK = Guid.NewGuid(); pu.POPUP_NAME = Cryptographys.Encrypt(_Popup.POPUP_NAME); pu.POPUP_DESCRIPTION = Cryptographys.Encrypt(_Popup.POPUP_DESCRIPTION); pu.POPUP_HTML = Cryptographys.Encrypt(_Popup.POPUP_HTML); pu.INSERTED_BY = _Popup.INSERTED_BY; pu.INSERTED_DATE = _Popup.INSERTED_DATE; pu.POPUP_ISDELETED = _Popup.POPUP_ISDELETED; pu.TS_CNT = _Popup.TS_CNT; context.AddTopcms_popup(pu); context.SaveChanges(); Msg = "Inserted"; } else { Msg = "Duplicate"; } return(Msg); } catch (Exception ex) { Utilities objUtilities = new Utilities(); objUtilities.LogError(ex); Msg = "Something went wrong"; return(null); } }
public ActionResult EditPopup(pcms_popup _popup) { try { _popup.TS_CNT = 1; _popup.UPDATED_DATE = DateTime.Now; _popup.UPDATED_BY = Convert.ToString(Session["userKey"]); var Resultset = objBAL.UpdatePopup(_popup); if (Resultset.Contains("Updated")) { return(RedirectToAction("Popup", "Home", null)); } else { return(RedirectToAction("Popup", "Home", null)); } } catch (Exception ex) { ErrorLog obj = new ErrorLog(); obj.LogError(ex); return(null); } }
public string UpdatePopup(pcms_popup _Popup) { return(objDAL.UpdatepopUp(_Popup)); }
public string Addpopup(pcms_popup _Popup) { return(objDAL.AddpopUp(_Popup)); }