private void Save_Click(object sender, System.Windows.RoutedEventArgs e) { if (ApplicationViewModel.Instance.DemoMode) { DemoMode dm = new DemoMode(); dm.Show(); return; } //SaveFile(element); //applicationViewModel.LoadCanvasUserList(user); //UserDTO user = new UserDTO(); //user.UserID = applicationViewModel.LoggedInUser.UserDto.UserID; //User ewavUser = applicationViewModel.LoggedInUser; //ewavUser.UserDto = user; //applicationViewModel.LoggedInUser = ewavUser; // new UserDTO() { UserID = "1" }; //applicationViewModel.DatasourceId = 1; //if (applicationViewModel.UserIdForOpenedCanvas == Convert.ToInt32(applicationViewModel.LoggedInUser.UserDto.UserID)) //{ // applicationViewModel.CurrentCanvasId = applicationViewModel.CanvasIdForOpenedCanvas; //} if (applicationViewModel.CurrentCanvasId > 0) { XElement element = applicationViewModel.SerializeCanvas(); CanvasDto dto = new CanvasDto(); //dto.CanvasName = txtSaveTitle.Text; //dto.CanvasDescription = txtSaveDesc.Text; //dto.CreatedDate = DateTime.Now; dto.ModifiedDate = DateTime.Now; dto.CreatedDate = DateTime.Now; //dto.DatasourceID = applicationViewModel.LoggedInUser.UserDto.DatasourceID; dto.XmlData = element; //dto.UserId = Convert.ToInt32(applicationViewModel.LoggedInUser.UserDto.UserID); //dto.UserId.UserId1 = "1"; dto.IsNewCanvas = false; dto.CanvasId = applicationViewModel.CurrentCanvasId; applicationViewModel.SaveCanvas(element, dto); savedash = new SaveDash("success"); savedash.Closed += new EventHandler(savedash_Closed); savedash.Show(); } else { SaveAsCall(); } }
private void SaveAsCall() { savedash = new SaveDash(); savedash.Closed += new EventHandler(savedash_Closed); savedash.Show(); }