Example #1
0
        public ActionResult GetList(PromotionQueryModel model, int pageSize, int pageIndex)
        {
            if (model.PromotionStatusType == -1)
            {
                model.PromotionStatus = null;
            }
            else if (model.PromotionStatusType == 1)
            {
                model.PromotionStatus = new[] { 1, 2, 3 };
            }
            else
            {
                model.PromotionStatus = new[] { model.PromotionStatusType };
            }
            PageOf <PromotionInfoModel> result;

            try
            {
                result = promotionBLL.GetPromotionList(model, pageSize, pageIndex);
            }
            catch (Exception ext)
            {
                LogHelper.Error(ext);
                result = new PageOf <PromotionInfoModel>();
            }
            return(View(result));
        }
Example #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Common.CheckPermission(Common.Module_Promotion, Common.Permission_View, HttpContext.Current))
     {
         string idstr = Request.QueryString["id"];
         int    id    = 0;
         int.TryParse(idstr, out id);
         if (id > 0)
         {
             PromotionBLL          pb    = new PromotionBLL();
             int                   total = 0;
             List <PromotionModel> list  = new List <PromotionModel>();
             pb.GetPromotionList(1, 1, id, null, null, null, out total, out list);
             if (list.Count == 1)
             {
                 PromotionModel model = list[0];
                 title_txt.Text   = model.Title;
                 content_txt.Text = model.Content;
                 date_txt.Text    = string.Format("{0:yyyy-MM-dd}", model.CreateTime);
             }
         }
     }
     else
     {
         Response.Redirect("nopermission.aspx");
     }
 }
Example #3
0
    private void LoadPromo()
    {
        PromotionBLL          pb    = new PromotionBLL();
        int                   total = 0;
        List <PromotionModel> list  = new List <PromotionModel>();

        if (Common.CheckPermission(Common.Module_Promotion, Common.Permission_View, HttpContext.Current))
        {
            promohead = "<tr><th>日期</th><th>标题</th></tr>";
            try
            {
                if (user.Type == AdminType.Dealer)
                {
                    pb.GetPromotionList(1, 5, null, null, user.AdminId, null, out total, out list);
                }
                else if (user.Type == AdminType.Stores)
                {
                    pb.GetPromotionList(1, 5, null, null, null, user.AdminId, out total, out list);
                }
                else
                {
                    pb.GetPromotionList(1, 5, null, null, null, null, out total, out list);
                }

                if (list.Count > 0)
                {
                    for (int i = 0; i < list.Count; i++)
                    {
                        PromotionModel model = list[i];
                        promobody = promobody + "<tr><td>" + model.CreateTime + "</td><td><a target=\"_blank\" href=\"promotion.aspx?id=" + model.PromotionId + "\">" + model.Title + "</a></td></tr>";
                    }
                }
            }
            catch (Exception ex)
            {
                WriteLog.WriteExceptionLog("LoadPromo", ex);
            }
        }
        else
        {
            promopl.Visible = false;
        }
    }
Example #4
0
        public ActionResult GetPromotionList(PromotionQuery query)
        {
            var promotionList = new PageOf <PromotionListModel>();

            try
            {
                var page = new PageDTO()
                {
                    PageIndex = this.PageNo,
                    PageSize  = this.PageSize
                };

                promotionList = _bll.GetPromotionList(this.CurrentUser.SupplierID, query, page);
            }
            catch (Exception ext)
            {
                LogHelper.Error(ext);
            }

            return(View(promotionList));
        }