public string DeleteRules(string query) { string Msg = ""; try { PCMS_DbContext context = new PCMS_DbContext(); pcms_rules rule = context.pcms_rules.Single(x => x.RULE_ID == Convert.ToInt16(query)); context.pcms_rules.DeleteObject(rule); context.SaveChanges(); Msg = "Deleted"; return(Msg); } catch (Exception ex) { Utilities objUtilities = new Utilities(); objUtilities.LogError(ex); Msg = "Something went wrong"; return(null); } }
public string DeleteContent(int query) { string Msg = ""; try { PCMS_DbContext context = new PCMS_DbContext(); pcms_content content = context.pcms_content.Single(x => x.CONTENT_ID == query); context.pcms_content.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 updateRules(pcms_rules Rule) { string Msg = ""; try { PCMS_DbContext context = new PCMS_DbContext(); if (!context.pcms_rules.Any(u => u.RULE_NAME == Rule.RULE_NAME)) { pcms_rules pu = new pcms_rules(); pu.RULE_NAME = Cryptographys.Encrypt(Rule.RULE_NAME); pu.RULE_LOCATION = Rule.RULE_LOCATION; pu.RULE_USER_TYPE = Rule.RULE_USER_TYPE; pu.RULE_PK = Guid.NewGuid(); pu.RULE_PARAMETER_KEY_VALUE = Rule.RULE_PARAMETER_KEY_VALUE; pu.RULE_APPLIED_URL = Cryptographys.Encrypt(Rule.RULE_APPLIED_URL); pu.RULE_ISDELETED = Rule.RULE_ISDELETED; pu.INSERTED_BY = Rule.INSERTED_BY; pu.INSERTED_DATE = Rule.INSERTED_DATE; pu.WEBSITE_URL = Cryptographys.Encrypt(Rule.WEBSITE_URL); pu.TS_CNT = Rule.TS_CNT; context.AddTopcms_rules(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 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 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 UpdateContent(pcms_content _content) { string Msg = ""; try { PCMS_DbContext context = new PCMS_DbContext(); pcms_content nUser = context.pcms_content.Single(u => u.CONTENT_ID == _content.CONTENT_ID); nUser.CONTENT_DESCRIPTION = Cryptographys.Encrypt(_content.CONTENT_DESCRIPTION); nUser.CONTENT_HTML = Cryptographys.Encrypt(_content.CONTENT_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 UpdateCamaign(pcms_campaign _campaign) { string Msg = ""; try { using (PCMS_DbContext _pcmsDbContext = new PCMS_DbContext()) { //Perform Update operation pcms_campaign cm = _pcmsDbContext.pcms_campaign.Single(u => u.CAMPAIGN_ID == _campaign.CAMPAIGN_ID); cm.CAMPAIGN_NAME = _campaign.CAMPAIGN_NAME; cm.CAMPAIGN_DESCRIPTION = Cryptographys.Encrypt(_campaign.CAMPAIGN_DESCRIPTION); cm.CAMPAIGN_START_DATE = Convert.ToDateTime(_campaign.CAMPAIGN_START_DATE); cm.CAMPAIGN_END_DATE = Convert.ToDateTime(_campaign.CAMPAIGN_END_DATE); cm.CAMPAIGN_STATUS = _campaign.CAMPAIGN_STATUS; cm.CAMPAIGN_DESIGN_ID = _campaign.CAMPAIGN_DESIGN_ID; cm.CAMPAIGN_CONTENT_ID = _campaign.CAMPAIGN_CONTENT_ID; cm.CAMPAIGN_POPUP_STATUS = _campaign.CAMPAIGN_POPUP_STATUS; cm.CAMPAIGN_POPUP_ID = _campaign.CAMPAIGN_POPUP_ID; cm.CAMPAIGN_RULE_ID = _campaign.CAMPAIGN_RULE_ID; cm.CAMPAIGN_URL = Cryptographys.Encrypt(_campaign.CAMPAIGN_URL); cm.CAMPAIGN_REDIRECT_URL = Cryptographys.Encrypt(_campaign.CAMPAIGN_REDIRECT_URL); cm.CAMPAIGN_CONTAINER_ID = _campaign.CAMPAIGN_CONTAINER_ID; cm.INSERTED_BY = _campaign.INSERTED_BY; cm.INSERTED_DATE = _campaign.INSERTED_DATE; cm.TS_CNT = _campaign.TS_CNT; _pcmsDbContext.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 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); } }