public ActionResult ImportSubcriber(int?id)
        {
            SubscribersViewModel model = new SubscribersViewModel();

            if (id == null)
            {
                ViewBag.ListName = new SelectList(M_List.GetLists(), "ListID", "ListName", "Select List");
            }
            else
            {
                model.ListID = id;
                return(View(model));
            }
            return(View(model));
        }
        /// <summary>
        /// action is responsible to get view for campaign creation
        /// </summary>
        /// <returns></returns>
        public ActionResult Creation()
        {
            userID = GetUser();
            try
            {
                ViewBag.campTypes = new SelectList(S_CampaignTypes.GetCampTypes(), "CTId", "Name");
                ViewBag.List      = new SelectList(M_List.GetLists(userID), "ListID", "ListName");
            }
            catch (M_CustomException ex)
            {
                ex.LogException();
                ModelState.AddModelError("viewcamp", "problem while showing campaigns");
                return(View("Error"));
            }

            return(View());
        }
 public ActionResult AddSubcriber(int?id)
 {
     userID     = GetUser();
     list       = new M_List();
     subscriber = new M_Subscriber();
     if (id == null)
     {
         // ViewBag.ListName = new SelectList(dbcontext.NewLists, "ListID", "ListName", "Select List");
         ViewBag.ListName = new SelectList(M_List.GetLists(), "ListID", "ListName", "Select List");
     }
     else
     {
         subscriber.ListID = id;
         return(View(subscriber));
     }
     return(View(subscriber));
 }
        public ActionResult editCampaign(int?id)
        {
            userID = GetUser();
            UpdateCampModel campaign = new UpdateCampModel();

            try
            {
                // campaign.Campaigns = dbContext.M_Campaigns.Find(id);
                campaign.Campaigns = M_Campaigns.FindCampaign(id);
                //campaign.Subscribers = dbContext.NewLists.Find(campaign.Campaigns.ListId).Subscribers.ToList();
                campaign.Subscribers = M_Campaigns.subscribersToCampaign(campaign.Campaigns.ListId);
                //WebUtility.HtmlDecode(campaign.Campaigns.EmailContent);
                ViewBag.campTypes        = new SelectList(S_CampaignTypes.GetCampTypes(), "CTId", "Name");
                ViewBag.List             = new SelectList(M_List.GetLists(userID), "ListID", "ListName");
                TempData["emailContent"] = campaign.Campaigns.EmailContent;
                return(View("UpdateCamp", campaign));
            }
            catch (M_CustomException ex)
            {
                if (ex.ErrorCode == 100)
                {
                    ModelState.AddModelError("error", ex.message);
                    return(RedirectToAction("Campaign"));
                }
                else if (ex.ErrorCode == 101)
                {
                    ModelState.AddModelError("Error", "logical exception");
                    return(RedirectToAction("Campaign"));
                }
            }
            catch (InvalidOperationException ex)
            {
                M_CustomException obj = new M_CustomException((int)ErorrTypes.others, ex.Message, ex.StackTrace, ErorrTypes.others.ToString(), Utlities.GetURL());
                obj.LogException();
                ModelState.AddModelError("Error", "Invalid operation");
                return(RedirectToAction("Campaign"));
            }

            return(RedirectToAction("Campaign"));
        }