public ActionResult AddDesign(pcms_design Design, FormCollection col) { try { Design.INSERTED_DATE = DateTime.Now; Design.TS_CNT = 0; Design.INSERTED_BY = Session["userKey"].ToString(); var res = objBAL.AddDesign(Design); if (res.Contains("Inserted")) { return(RedirectToAction("Design")); } else if (res.Contains("Duplicate")) { ViewBag.Error = "design Name must be unique"; return(View()); } else { ViewBag.Error = "Something went wrong while adding Design"; 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 pcms_design EditDesign(int query) { try { pcms_design _design = new pcms_design(); PCMS_DbContext context = new PCMS_DbContext(); var res = context.pcms_design.Single(content => content.DESIGN_ID == query); pcms_design dn = new pcms_design(); _design.DESIGN_ID = res.DESIGN_ID; _design.DESIGN_NAME = Cryptographys.Decrypt(res.DESIGN_NAME); _design.DESIGN_DESCRIPTION = Cryptographys.Decrypt(res.DESIGN_DESCRIPTION); _design.DESIGN_HTML = Cryptographys.Decrypt(res.DESIGN_HTML); _design.INSERTED_BY = res.INSERTED_BY; _design.INSERTED_DATE = res.INSERTED_DATE; _design.DESIGN_ISDELETED = res.DESIGN_ISDELETED; _design.TS_CNT = res.TS_CNT; return(_design); } catch (Exception ex) { Utilities objUtilities = new Utilities(); objUtilities.LogError(ex); return(null); } }
public string DeleteDesign(int query) { string Msg = ""; try { PCMS_DbContext context = new PCMS_DbContext(); pcms_design content = context.pcms_design.Single(x => x.DESIGN_ID == query); context.pcms_design.DeleteObject(content); context.SaveChanges(); Msg = "Deleted"; return(Msg); } catch (Exception ex) { Utilities objUtilities = new Utilities(); objUtilities.LogError(ex); Msg = "Something went wrong"; return(null); } }
public string UpdateDesign(pcms_design _Design) { string Msg = ""; try { PCMS_DbContext context = new PCMS_DbContext(); pcms_design nUser = context.pcms_design.Single(u => u.DESIGN_ID == _Design.DESIGN_ID); nUser.DESIGN_DESCRIPTION = Cryptographys.Encrypt(_Design.DESIGN_DESCRIPTION); nUser.DESIGN_HTML = Cryptographys.Encrypt(_Design.DESIGN_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 AddDesign(pcms_design _Design) { string Msg = ""; try { PCMS_DbContext context = new PCMS_DbContext(); if (!context.pcms_campaign.Any(u => u.CAMPAIGN_NAME == _Design.DESIGN_NAME)) { pcms_design dn = new pcms_design(); dn.DESIGN_PK = Guid.NewGuid(); dn.DESIGN_NAME = Cryptographys.Encrypt(_Design.DESIGN_NAME); dn.DESIGN_DESCRIPTION = Cryptographys.Encrypt(_Design.DESIGN_DESCRIPTION); dn.DESIGN_HTML = Cryptographys.Encrypt(_Design.DESIGN_HTML); dn.INSERTED_BY = _Design.INSERTED_BY; dn.INSERTED_DATE = _Design.INSERTED_DATE; dn.DESIGN_ISDELETED = _Design.DESIGN_ISDELETED; dn.TS_CNT = _Design.TS_CNT; context.AddTopcms_design(dn); 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 EditDesign(pcms_design _design) { try { _design.TS_CNT = 1; _design.UPDATED_DATE = DateTime.Now; _design.UPDATED_BY = Convert.ToString(Session["userKey"]); var Resultset = objBAL.UpdateDesign(_design); if (Resultset.Contains("Updated")) { return(RedirectToAction("Design", "Home", null)); } else { return(RedirectToAction("Design", "Home", null)); } } catch (Exception ex) { ErrorLog obj = new ErrorLog(); obj.LogError(ex); return(null); } }
public string AddDesign(pcms_design _Design) { return(objDAL.AddDesign(_Design)); }
public string UpdateDesign(pcms_design _Design) { return(objDAL.UpdateDesign(_Design)); }