public ActionResult Index()
        {
            CMS_KeywordModels     model  = new CMS_KeywordModels();
            List <SelectListItem> lstAcc = new List <SelectListItem>();
            var lstAccount = _facAcc.GetList();

            if (lstAccount != null && lstAccount.Any())
            {
                lstAccount.ForEach(o =>
                {
                    lstAcc.Add(new SelectListItem
                    {
                        Value = o.Id,
                        Text  = o.Account
                    });
                });
            }
            ViewBag.ListAccount = lstAcc;
            return(View(model));
        }
 public ActionResult LoadGrid(CMS_AccountModels item)
 {
     try
     {
         var  msg     = "";
         bool isCheck = true;
         if (item.Account != null && item.Account.Length > 0 && item.Cookies != null && item.Cookies.Length > 0)
         {
             var temp = ListItem.Where(o => o.Trim() == item.Account.Trim()).FirstOrDefault();
             if (temp == null)
             {
                 var result = _factory.CreateOrUpdate(item, ref msg);
                 if (!result)
                 {
                     isCheck = false;
                 }
             }
             else
             {
                 ViewBag.DuplicateKeyword = "Duplicate account!";
             }
         }
         if (isCheck)
         {
             var model = _factory.GetList();
             return(PartialView("_ListData", model));
         }
         else
         {
             return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
         }
     }
     catch (Exception e)
     {
         //_logger.Error("Keyword_Search: " + e);
         return(new HttpStatusCodeResult(400, e.Message));
     }
 }