public ActionResult AddUpdate(ViewModel input)
        {
            //TODO if file doesn't exist, send back "file doesn't exist notification
            //get current setting value

            string suiteStatus = getSuiteStatus();

            var suiteOnlineStatusTypes =
                _selectListItemService.CreateList(SuiteOnlineStatusType.GetAll<SuiteOnlineStatusType>(),
                                                  z => z.Key,
                                                  z => z.Key,
                                                  false);
            var model = new SiteConfigurationViewModel
                            {
                                Title = WebLocalizationKeys.SITE_CONFIGURATION.ToString(),
                                SuiteOnlineStatusType = suiteStatus,
                                SuiteConfigFile = _configFilePath,
                                SuiteSiteFullPath = _suiteWebsiteFullPath,

                                SuiteOnlineStatusTypeList = suiteOnlineStatusTypes

                                //TODO ...show other settings as Readonly
                            };

            return View(model);
        }
 public ActionResult AddUpdate(ViewModel input)
 {
     Company item = input.EntityId > 0 ? _repository.Find<Company>(input.EntityId) : new Company();
     var model = new CompanyViewModel{
         Company = item,
         _Title = WebLocalizationKeys.CLIENT.ToString(),
     };
     return View(model);
 }
 public ActionResult AddUpdate(ViewModel input)
 {
     EmailTemplate item = input.EntityId > 0 ? _repository.Find<EmailTemplate>(input.EntityId) : new EmailTemplate();
     var client = _repository.Find<Company>(input.ParentId);
     var model = new EmailTemplateViewModel
     {
         EmailTemplate = item,
         _Title = WebLocalizationKeys.EMAIL_TEMPLATE.ToString(),
         Company = client
     };
     return View(model);
 }
 public ActionResult ItemList(ViewModel input)
 {
     var url = UrlContext.GetUrlForAction<EmailTemplateListController>(x=>x.Items(null))+"/"+input.EntityId;
     var gridDefinition = _grid.GetGridDefinition(url);
     var model = new ListViewModel
     {
         _Title = WebLocalizationKeys.EMAIL_TEMPLATE.ToString(),
         gridDef = gridDefinition,
         ParentId = input.EntityId
     };
     model.headerButtons.Add("new");
     return Json(model,JsonRequestBehavior.AllowGet);
 }
 public ActionResult ItemList(ViewModel input)
 {
     var addUpdateUrl = UrlContext.GetUrlForAction<CompanyController>(x => x.AddUpdate(null));
     var url = UrlContext.GetUrlForAction<CompanyListController>(x=>x.Items(null));
     var gridDefinition = _grid.GetGridDefinition(url);
     var model = new ListViewModel
     {
         Title = WebLocalizationKeys.CLIENT.ToString(),
         gridDef = gridDefinition,
         addUpdateUrl = addUpdateUrl
     };
     model.headerButtons.Add("new");
     return Json(model,JsonRequestBehavior.AllowGet);
 }
 public ActionResult Login(ViewModel input)
 {
     var repository = ObjectFactory.Container.GetInstance<IRepository>();
     var uli = repository.Find<UserLoginInfo>(input.EntityId);
     uli.ByPassToken = Guid.NewGuid();
     repository.Save(uli);
     repository.Commit();
     var notification = new Notification
                            {
                                Success = true,
                                Variable = uli.ByPassToken.ToString(),
                                EntityId = uli.User.EntityId
                            };
     return Json(notification, JsonRequestBehavior.AllowGet);
 }
        public ActionResult AddUpdate(ViewModel input)
        {
            var companys = _selectListItemService.CreateList<Company>(x => x.Name, x => x.EntityId, true);

            User user;
            UserLoginInfo loginInfo = new UserLoginInfo();
            int subscriptionLevel = 0;
            if (input.EntityId > 0)
            {
                loginInfo = _repository.Find<UserLoginInfo>(input.EntityId);
                user = loginInfo.User;
            }
            else
            {
                user = new User();
            }

            var model = new UserViewModel
                            {
                                User = user,
                                UserLoginInfo = loginInfo,
                                CompanyList = companys,
                                _Title =
                                    input.EntityId > 0
                                        ? WebLocalizationKeys.USER.ToString()
                                        : WebLocalizationKeys.ADD_NEW + " " + WebLocalizationKeys.USER,
                            };
            if (loginInfo.CompanyId > 0)
            {
                // stupid problem with dropdownlists
                var company = _repository.Find<Company>(loginInfo.CompanyId);
                model.Client = loginInfo.CompanyId;
                model.UsersCompany = company;
            }
            return View(model);
        }