private void Save() { try { if (archives.ARCHIVESTITLE == null || string.IsNullOrEmpty(archives.ARCHIVESTITLE.Trim())) { //HtmlPage.Window.Alert("档案标题不能为空!"); Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STRINGNOTNULL", "ARCHIVESTITLE")); //this.txtTitle.Focus(); return; } if (txtContent.GetRichTextbox().Xaml == "") //if (archives.CONTENT == null || txtContent.GetRichTextbox().Xaml == "") { //HtmlPage.Window.Alert("档案内容不能为空!"); Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STRINGNOTNULL", "ARCHIVESCONTENT")); //this.txtContent.Focus(); return; } //archives.ARCHIVESTITLE = txtTitle.Text.Trim(); //Items cbxItems = this.comboxType.SelectedItem as Items; archives.RECORDTYPE = Utility.GetCbxSelectItemText(comboxType); //archives.CONTENT = txtContent.Text.Trim(); archives.SOURCEFLAG = "1"; archives.CONTENT = txtContent.RichTextBoxContext; RefreshUI(RefreshedTypes.ProgressBar); if (actions == Action.Add) //新增操作 { //应考虑新增时先点保存再点保存并关闭的情况 此时还是执行新增操作 archives.ARCHIVESID = System.Guid.NewGuid().ToString(); archives.COMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID; archives.CREATEUSERID = Common.CurrentLoginUserInfo.EmployeeID; archives.CREATEUSERNAME = Common.CurrentLoginUserInfo.EmployeeName; archives.CREATEPOSTID = Common.CurrentLoginUserInfo.UserPosts[0].PostID; archives.CREATEDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID; archives.CREATECOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID; archives.OWNERID = Common.CurrentLoginUserInfo.EmployeeID; archives.OWNERNAME = Common.CurrentLoginUserInfo.EmployeeName; archives.OWNERPOSTID = Common.CurrentLoginUserInfo.UserPosts[0].PostID; archives.OWNERDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID; archives.OWNERCOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID; archives.CREATEDATE = DateTime.Now; client.AddArchivesAsync(archives); } else //更新操作 { archives.UPDATEDATE = DateTime.Now; archives.UPDATEUSERID = Common.CurrentLoginUserInfo.EmployeeID; archives.UPDATEUSERNAME = Common.CurrentLoginUserInfo.EmployeeName; client.UpdateArchivesAsync(archives); } } catch (Exception ex) { //HtmlPage.Window.Alert(ex.ToString()); RefreshUI(RefreshedTypes.ProgressBar); Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), ex.ToString()); } }