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

namespace LHDN.CRM.Web.Areas.Activity.Controllers
{
    public class ProfileController : BaseController
    {
        // GET: Activity/Profile
        [CRMAuthorize(Constant.Authentication.Activity.ViewActivityProfile)]
        [HttpGet]
        public ActionResult Detail(long id)
        {
            if(id > 0)
            {
                ViewBag.ActivityID = id;
                AddAntiforgeryToken();

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


        [HttpPost]
        [DisableCache]
        [CRMAuthorize(Constant.Authentication.Activity.CreateUpdateProfile)]
        //[ActionName("Index")]
        public ActionResult New(OpenNewActViewModel model) //Model
        {
            ViewBag.TPID = model.TPID;
            ViewBag.CaseID = model.CaseID;
            ViewBag.OutboundID = model.OutboundID;
            ViewBag.ReMSDataID = model.ReMSDataID;
            ViewBag.JenisKempenID = model.JenisKempenID;
            ViewBag.IDNo = model.IDNo;
            ViewBag.IDType = model.IDType;
            ViewBag.IDTypeCode = model.IDTypeCode;
            ViewBag.NoCukai = model.NoCukai;
            ViewBag.IDTypeDesc = model.IDTypeDesc;
            ViewBag.TPName = model.TPName;
            ViewBag.FBTWDisplayName = model.FBTWDisplayName;
            ViewBag.TelNo = model.TelNo;
            ViewBag.CallAttempts = model.CallAttempts;
            ViewBag.PrevActivityID = model.PrevActivityID;
            ViewBag.Kategori1ID = model.Kategori1ID;
            ViewBag.Kategori2ID = model.Kategori2ID;
            ViewBag.Kategori3ID = model.Kategori3ID;
            ViewBag.ActChannelID = model.ActChannelID;
            ViewBag.Aliran = model.Aliran; // IN / OUT
            ViewBag.UUID = model.UUID;
            ViewBag.IsInboundMissCall = model.IsInboundMissCall;
            ViewBag.LanguageCode = model.LanguageCode;
            ViewBag.SkillSet = model.SkillSet;
            ViewBag.IsReplyToTPCFF = model.IsReplyToTPCFF;
            ViewBag.IsResendEmail = model.IsResendEmail;
            ViewBag.IsFrCRM = model.IsFrCRM;
            ViewBag.OutlookSubject = model.OutlookSubject;
            ViewBag.OutlookSender = model.OutlookSender;
            ViewBag.OutlookTo = model.OutlookTo;
            ViewBag.OutlookCC = model.OutlookCC;
            ViewBag.OutlookContent = model.OutlookContent;
            ViewBag.OutlookReceivedDate = model.OutlookReceivedDate;
            ViewBag.InteractionID = model.InteractionID;
            ViewBag.IsOrphanTP = model.IsOrphanTP;
            ViewBag.IsSelfSelectOutbound = model.IsSelfSelectOutbound;
            ViewBag.CCCampaignName = model.CCCampaignName;
            ViewBag.Email = model.Email;


            if (model.SessionKey == null)
                ViewBag.SessionKey = Guid.NewGuid();
            else
                ViewBag.SessionKey = model.SessionKey;

            AddAntiforgeryToken();

            //this.HttpContext.Response.Cache("")
            //string Telno, sstring language 
            return View("Index");
        }
    }
}