public string approveRejectFlyer(int flyerID, bool approveRejectFlag) { ReturnObject <int> output = null; try { FlyersHandler handler = new FlyersHandler(); int flyer = handler.approveRejectFlyer(flyerID, approveRejectFlag); output = new ReturnObject <int>(ErrorConstants.SUCCESS, flyer); if (flyer > 0) { return(JsonConvert.SerializeObject(output)); } else { return(JsonConvert.SerializeObject(new ReturnObject <string>(ErrorConstants.ERROR_FAILED_TO_UPDATE_FLYER_STATUS, ErrorConstants.ERROR_FAILED_TO_UPDATE_FLYER_STATUS_MSG))); } } catch (Exception ex) { return(JsonConvert.SerializeObject(new ReturnObject <string>(ErrorConstants.ERROR_EXCEPTION, ex.Message))); } }
public string deleteFlyerAndProductsByID(int flyerID) { ReturnObject <int> output = null; try { FlyersHandler handler = new FlyersHandler(); int flyer = handler.deleteFlyerByID(flyerID); output = new ReturnObject <int>(ErrorConstants.SUCCESS, flyer); if (flyer > 0) { return(JsonConvert.SerializeObject(output)); } else { return(JsonConvert.SerializeObject(new ReturnObject <string>(ErrorConstants.ERROR_FAILED_TO_DELETE_FLYER, ErrorConstants.ERROR_FAILED_TO_DELETE_FLYER_MSG))); } } catch (Exception ex) { return(JsonConvert.SerializeObject(new ReturnObject <string>(ErrorConstants.ERROR_EXCEPTION, ex.Message))); } }
public string getFlyerBasicData(int flyerID) { ReturnObject <GET_FLYER_BASIC_DATAResult> output = null; try { FlyersHandler handler = new FlyersHandler(); GET_FLYER_BASIC_DATAResult flyerData = handler.GET_FLYER_DATA(flyerID); output = new ReturnObject <GET_FLYER_BASIC_DATAResult>(ErrorConstants.SUCCESS, flyerData); if (flyerData != null) { return(JsonConvert.SerializeObject(output)); } else { return(JsonConvert.SerializeObject(new ReturnObject <string>(ErrorConstants.ERROR_FAILED_TO_GET_FLYER_DATA, ErrorConstants.ERROR_FAILED_TO_GET_FLYER_DATA_MSG))); } } catch (Exception ex) { return(JsonConvert.SerializeObject(new ReturnObject <string>(ErrorConstants.ERROR_EXCEPTION, ex.Message))); } }
public string addNewFlyerBasicData(OFFER_FLYER flyer, string action) { ReturnObject <int> flyerObj = null; try { FlyersHandler handler = new FlyersHandler(); var flyerID = handler.AddNewFlyer(flyer, action); if (flyerID != -1) { flyerObj = new ReturnObject <int>(ErrorConstants.SUCCESS, flyerID); } else { return(JsonConvert.SerializeObject(new ReturnObject <string>(ErrorConstants.ERROR_FAILED_TO_ADD_FLYER, ErrorConstants.ERROR_FAILED_TO_ADD_FLYER_MSG))); } return(JsonConvert.SerializeObject(flyerObj)); } catch (Exception ex) { return(JsonConvert.SerializeObject(new ReturnObject <string>(ErrorConstants.ERROR_EXCEPTION, ex.Message))); } }
public string getAllFlyers(int userID) { List <GET_ALL_FLYERS_PROCDResult> allFlyers = new List <GET_ALL_FLYERS_PROCDResult>(); try { FlyersHandler handler = new FlyersHandler(); allFlyers = handler.getAllFlyers(userID); } catch (Exception ex) { return(JsonConvert.SerializeObject(new ReturnObject <string>(ErrorConstants.ERROR_EXCEPTION, ex.Message))); } if (allFlyers != null && allFlyers.Count > 0) { return(JsonConvert.SerializeObject(new ReturnObject <List <GET_ALL_FLYERS_PROCDResult> >(ErrorConstants.SUCCESS, allFlyers))); } else { return(JsonConvert.SerializeObject(new ReturnObject <string>(ErrorConstants.ERROR_NO_FLYERS_FOUND, ErrorConstants.ERROR_NO_FLYERS_FOUND_MSG))); } }
public string getAllOfferTypes() { List <OFFER_TYPE> types = null; try { FlyersHandler handler = new FlyersHandler(); types = handler.getAllOfferTypes(); } catch (Exception ex) { return(JsonConvert.SerializeObject(new ReturnObject <string>(ErrorConstants.ERROR_EXCEPTION, ex.Message))); } if (types != null) { return(JsonConvert.SerializeObject(new ReturnObject <List <OFFER_TYPE> >(ErrorConstants.SUCCESS, types))); } else { return(JsonConvert.SerializeObject(new ReturnObject <string>(ErrorConstants.ERROR_NO_OFFER_TYPES_FOUND, ErrorConstants.ERROR_NO_OFFER_TYPES_FOUND_MSG))); } }