示例#1
0
        public ActionResult <Response <bool> > SavePromotions([FromBody] Promotions promotions)
        {
            try
            {
                var rtn = new Response <bool>();

                rtn.Value       = PromotionsMapper.SavePromotions(promotions);
                rtn.MessageType = MessageType.OK;
                rtn.Message     = "Promocion Grabada con Exito";
                return(Ok(rtn));
            }
            catch (Exception)
            {
                throw;
            }
        }
示例#2
0
        public ActionResult <Response <Promotions> > GetPromotions([FromQuery] int sucursalId, bool activeOnly = false)
        {
            try
            {
                var rtn = new Response <Promotions>();

                rtn.Items = PromotionsMapper.GetPromotions(sucursalId, activeOnly);
                if (rtn is null || rtn.Items is null || rtn.Items.Count == 0)
                {
                    return(NotFound());
                }
                return(Ok(rtn));
            }
            catch (Exception)
            {
                throw;
            }
        }