public JsonResult SaveCampaignInfo(ACM.Model.Campaign campaign)
        {
            try
            {
                DateTime minDate = DateTime.Parse("01/01/2000");
                if (campaign.CampaignStartDate < minDate || campaign.CampaingEndDate < minDate)
                {
                    if (campaign.CampaignStartDate < minDate && !campaign.CampaignStartDate.Equals(DateTime.MinValue))
                    {
                        ModelState.AddModelError("Camapaign StartDate", "Invalid date entered in Start Date. Please enter the date over 01/01/2000 ");
                    }
                    if (campaign.CampaingEndDate < minDate && !campaign.CampaingEndDate.Equals(DateTime.MinValue))
                    {
                        ModelState.AddModelError("Camapaign EndtDate", "Invalid date entered in End Date. Please enter the date over 01/01/2000 ");
                    }
                }
                if (!campaign.CampaingEndDate.Equals(DateTime.MinValue))
                {
                    if (campaign.CampaingEndDate <= campaign.CampaignStartDate)
                    {
                        ModelState.AddModelError("Camapaign EndDate", "End Date cannot be prior than Start Date");
                    }
                }
                if (campaign.CampaignTypeId == null)
                {
                    ModelState.AddModelError("CamapaignType", "The CamapaignType field is required.");
                }

                string loginId = Utility.LoginId(User.Identity.Name);
                ACM.BO.Admin.UsersBO usersBO = new ACM.BO.Admin.UsersBO();
                // ACM.BO.Campaign.CampaignRequestBO campaignRequestBO = new ACM.BO.Campaign.CampaignRequestBO();
                ViewBag.test = loginId;
                var userDetail = usersBO.GetUserDetail(loginId);

                if (ModelState.IsValid)
                {
                    DateTime dt;
                    string[] splitDates = campaign.Notes.Split('|');

                    if (DateTime.TryParse(splitDates[0], out dt) && DateTime.TryParse(splitDates[0], out dt))
                    {
                        campaign.Notes = string.Empty;
                        if (campaign.CampaignId == 0)
                        {
                            campaign.CreatedBy = userDetail.UserId;
                            Guid gid = Guid.NewGuid();
                            campaign.CampaignGuid = gid.ToString();

                            var campaignInq = campaignServiceClient.CampaignAdd(campaign);
                            Session["CampaignId"] = campaignInq.CampaignId;
                            return(Json(campaignInq));
                        }
                        else
                        {
                            campaign.ModifiedBy = userDetail.UserId;

                            campaignServiceClient.CampaignMod(campaign);
                            return(Json(campaign));
                        }
                    }
                    else
                    {
                        return(Json("DateError"));
                    }
                }
                else
                {
                    IEnumerable <ModelError> errors = ModelState.Values.SelectMany(v => v.Errors);
                    return(Json(errors));
                }
            }
            catch
            {
                return(Json("Error"));
            }
        }