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 System.Web.Security;
using LHDN.CRM.BC.Common;

namespace LHDN.CRM.Web.Areas.Outbound.Controllers
{
    public class HCLEmailBlastSegmentiseController : BaseController
    {
        public HCLEmailBlastSegmentiseController()
        {
            ViewBag.IsHCLEmailBlast = true;
        }

        // GET: Outbound/HCLEmailBlastSegmentise
        public ActionResult Detail(int id)
        {
            if(id > 0 )
            {
                ViewBag.ViewID = id;
                ViewBag.IsManageHCLCampaignRole = Roles.Provider.IsUserInRole(User.Identity.Name, Constant.Authentication.HCL.CreateHCLEmailCampaign);

                AddAntiforgeryToken();

                return View("Index");
            }
             else
            {
               return View();
            }
        
           
        }

        [HttpPost]
        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");


        }

    }
}