Exemplo n.º 1
0
        public TimelogViewModel GetTimelogViewModel(ITimelogUsingView view)
        {
            if (timelogViewModel != null)
            {
                timelogViewModel.TimelogUsingView = view;
                return(timelogViewModel);
            }

            var timelogSettingObj = from TimelogSetting tlSetting in dellAppDB.TimelogSetting
                                    select tlSetting;

            if (timelogSettingObj.Count() > 0)
            {
                timelogViewModel = new TimelogViewModel(timelogSettingObj.Single(), view);
            }
            else
            {
                TimelogSetting newTlSetting = new TimelogSetting()
                {
                    TimelogSettingID = System.Guid.NewGuid().ToString(), TimelogUrl = "https://"
                };
                dellAppDB.TimelogSetting.InsertOnSubmit(newTlSetting);
                dellAppDB.SubmitChanges();
                timelogViewModel = new TimelogViewModel(newTlSetting, view);
            }

            return(timelogViewModel);
        }
Exemplo n.º 2
0
 public void DiscardTlSettingViewModel()
 {
     timelogViewModel = null;
 }