using LHDN.CRM.Web.Controllers;
using LHDN.CRM.Models.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Newtonsoft.Json;
using LHDN.CRM.BC.Common;
using LHDN.CRM.Web.Filters;
using System.Web.Security;

namespace LHDN.CRM.Web.Areas.Outbound.Controllers
{
    public class SegmentiseController : BaseController
    {
        // GET: Outbound/Segmentise
        [CRMAuthorize(Constant.Authentication.Outbound.ManageSegmentization)]
        public ActionResult Detail(string id)
        {
            ViewBag.ViewID = id;
            ViewBag.IsManageOutboundCampaignRole = Roles.Provider.IsUserInRole(User.Identity.Name, Constant.Authentication.Outbound.ManageCampaign);
            AddAntiforgeryToken();

            return View("Index");
        }

        [HttpPost]
        [CRMAuthorize(Constant.Authentication.Outbound.ManageSegmentization)]
        public ActionResult New(OpenNewSegViewModel model)
        {

            AddAntiforgeryToken();
            ViewBag.JSonStringBasic = model.jSonStringBasic;
            ViewBag.JSonStringAdvanced = model.jSonStringAdvanced;
            ViewBag.NewSegJenisKempenID = model.newSegJenisKempenID;
            ViewBag.NewSegViewID = model.newSegViewID;
            ViewBag.newSegCCCampaignID = model.newSegCCCampaignID;
            ViewBag.newSegCampaignName = model.newSegCampaignName;
            ViewBag.newSegInteractionChannelID = model.newSegInteractionChannelID;
            ViewBag.newSegKategori1ID = model.newSegKategori1ID;
            ViewBag.newSegKategori2ID = model.newSegKategori2ID;
            ViewBag.newSegKategori3ID = model.newSegKategori3ID;
            ViewBag.newSegEmailTemplateID = model.newSegEmailTemplateID;
            ViewBag.newSegCCFromID = model.newSegCCFromID;
            ViewBag.CheckCampaignExist = model.CheckCampaignExist;

            return View("Index");


        }

    }
}