Ejemplo n.º 1
0
        public ActionResult AjaxDelete(string channelNo)
        {
            SWfsChannelService service = new SWfsChannelService();
            int i = service.DeleteChannel(channelNo);

            if (i >= 0)
            {
                #region 日志信息
                SWfsSubjectService      channelService = new SWfsSubjectService();
                SWfsSubjectOrChannelLog log            = new SWfsSubjectOrChannelLog();
                log.SubjectOrChannelNo = channelNo;
                log.TypeValue          = 1; //1频道
                log.DateOperator       = DateTime.Now;
                log.OperatorContent    = "删除频道";
                log.OperatorUserId     = PresentationHelper.GetPassport().UserName;
                log.OperatorActionType = LogActionType.Delete.GetHashCode();
                channelService.InsertSubjectOrChannelLog(log);
                #endregion

                return(Json(new { result = "1", message = "删除成功!" }));
            }
            else
            {
                return(Json(new { result = "0", message = "删除失败!" }));
            }
        }
Ejemplo n.º 2
0
        public ActionResult AjaxUpdateStatus(string channelNo, string status)
        {
            SWfsChannelService service = new SWfsChannelService();
            SWfsChannel        channel = service.GetChannelInfo(channelNo);

            channel.Status = Convert.ToInt16(status == "1" ? "0" : "1");
            try
            {
                service.UpdateStatus(channel);

                #region 日志信息
                SWfsSubjectService      channelService = new SWfsSubjectService();
                SWfsSubjectOrChannelLog log            = new SWfsSubjectOrChannelLog();
                log.SubjectOrChannelNo = channelNo;
                log.TypeValue          = 1; //1频道
                log.DateOperator       = DateTime.Now;
                log.OperatorContent    = (status.Equals("1") ? "关闭频道" : "开启频道");
                log.OperatorUserId     = PresentationHelper.GetPassport().UserName;
                log.OperatorActionType = LogActionType.Edit.GetHashCode();
                channelService.InsertSubjectOrChannelLog(log);
                #endregion

                string str = status == "0" ? "开启成功!" : "关闭成功!";
                return(Json(new { result = "1", message = str }));
            }
            catch (Exception ex)
            {
                return(Json(new { result = "0", message = ex.Message }));
            }
        }
Ejemplo n.º 3
0
        public ActionResult SubjectStatusModify(string subjectNo)
        {
            SWfsSubjectService service = new SWfsSubjectService();
            SubjectInfo        subject = service.GetSubjectInfo(subjectNo);

            //没有获取到活动信息
            if (subject == null)
            {
                return(Json(new { result = "0", message = "信息获取错误" }));
            }
            string tempStatue = subject.Status == 0 ? "1" : "0";

            //如果状态是关闭活动 点击后开启
            if (subject.Status == 0)
            {
                IList <string> list = service.GetProductListBySubjectNo(subjectNo, "0");
                //存在商品
                if (list != null && list.Count > 0)
                {
                    if (string.IsNullOrEmpty(subject.BelongsSubjectPic) || string.IsNullOrEmpty(subject.TitlePic2) || string.IsNullOrEmpty(subject.IPhonePic))
                    {
                        return(Json(new { result = "0", message = "由于此活动的图片上传不完全,所以不能开启该活动!" }));
                    }

                    if (subject.SubjectPreStartTemplateType != 1 && string.IsNullOrEmpty(subject.BackgroundPic))
                    {
                        return(Json(new { result = "0", message = "由于此活动的图片上传不完全,所以不能开启该活动!" }));
                    }
                }
                else
                {
                    return(Json(new { result = "0", message = "此活动中没有符合前台网站售卖条件的商品,不能开启!" }));
                }
            }
            try
            {
                service.SubjectStatusModify(subjectNo, tempStatue);
                #region 修改活动状态日志
                SWfsSubjectOrChannelLog log = new SWfsSubjectOrChannelLog();
                log.SubjectOrChannelNo = subjectNo;
                log.TypeValue          = 0;
                log.DateOperator       = DateTime.Now;
                log.OperatorContent    = "修改活动状态";
                log.OperatorUserId     = PresentationHelper.GetPassport().UserName;
                service.InsertSubjectOrChannelLog(log);
                #endregion
                return(Json(new { result = "1", message = "活动状态修改成功!" }));
            }
            catch (Exception ex)
            {
                return(Json(new { result = "0", message = "活动状态修改失败!" }));
            }
        }