private void SaveResult() { ObservableCollection <T_OA_REQUIRERESULT> resultList = new ObservableCollection <T_OA_REQUIRERESULT>(); SurveyShowList ssL = null; T_OA_REQUIRERESULT resultInfo = null; bool AnswerIsNull = true; string StrAnswer = ""; for (int i = 0; i < spSurveysList.Children.Count; i++) { ssL = new SurveyShowList(); ssL = spSurveysList.Children[i] as SurveyShowList; if (string.IsNullOrEmpty(ssL.ResultDetail.RESULT)) { AnswerIsNull = false; StrAnswer += (i + 1).ToString() + ","; continue; } resultInfo = ssL.ResultDetail; resultInfo.REQUIRERESULTID = System.Guid.NewGuid().ToString(); resultInfo.T_OA_REQUIREMASTER = employeeSurveyInfo.RequireMaster; resultInfo.T_OA_REQUIRE = require; resultInfo.CREATEUSERID = Common.CurrentLoginUserInfo.EmployeeID; resultInfo.CREATECOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID; resultInfo.CREATEDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID; resultInfo.CREATEPOSTID = Common.CurrentLoginUserInfo.UserPosts[0].PostID; resultInfo.CREATEUSERNAME = Common.CurrentLoginUserInfo.EmployeeName; resultInfo.OWNERID = Common.CurrentLoginUserInfo.EmployeeID; resultInfo.OWNERCOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID; resultInfo.OWNERDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID; resultInfo.OWNERPOSTID = Common.CurrentLoginUserInfo.UserPosts[0].PostID; resultInfo.OWNERNAME = Common.CurrentLoginUserInfo.EmployeeName; resultInfo.UPDATEUSERID = Common.CurrentLoginUserInfo.EmployeeID; resultInfo.UPDATEUSERNAME = Common.CurrentLoginUserInfo.EmployeeName; resultInfo.UPDATEDATE = System.DateTime.Now; resultList.Add(resultInfo); } if (!AnswerIsNull) { StrAnswer = StrAnswer.Substring(0, StrAnswer.Length - 1); Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("ERROR"), "第" + StrAnswer + "道题没有答案"); } if (resultList.Count() > 0) { empSurveysWS.SubmitResultAsync(resultList); } else { Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("ERROR"), "请填写答案"); } }
public bool AddRequireResult(T_OA_REQUIRERESULT requireResultInfo) { try { requireResultInfo.T_OA_REQUIREMASTER = base.GetObjectByEntityKey(requireResultInfo.T_OA_REQUIREMASTER.EntityKey) as T_OA_REQUIREMASTER; int i = base.Add(requireResultInfo); return(i > 0 ? true : false); } catch (Exception ex) { throw (ex); } }
public bool UpdateRequireResult(T_OA_REQUIRERESULT requireResultInfo) { try { T_OA_REQUIRERESULT tmpobj = base.GetObjectByEntityKey(requireResultInfo.EntityKey) as T_OA_REQUIRERESULT; tmpobj.T_OA_REQUIREMASTER = base.GetObjectByEntityKey(requireResultInfo.T_OA_REQUIREMASTER.EntityKey) as T_OA_REQUIREMASTER; int i = base.Update(requireResultInfo); return(i >= 0 ? true : false); } catch (Exception ex) { throw (ex); } }
private void RowFilterButton_Click(object sender, RoutedEventArgs e) { V_REQUIRERESULTMODE detail = (V_REQUIRERESULTMODE)((CheckBox)sender).Tag; CheckBox RowFilterButton = dgResult.Columns[0].GetCellContent(detail).FindName("RowFilterButton") as CheckBox; T_OA_REQUIRERESULT result = new T_OA_REQUIRERESULT(); result.REQUIRERESULTID = Guid.NewGuid().ToString(); result.T_OA_REQUIREMASTER = new T_OA_REQUIREMASTER(); result.T_OA_REQUIREMASTER = model.T_OA_REQUIREMASTER; result.T_OA_REQUIRE = new T_OA_REQUIRE(); result.T_OA_REQUIRE = model.T_OA_REQUIRE; result.SUBJECTID = detail.T_OA_REQUIREDETAIL.SUBJECTID; result.CODE = detail.T_OA_REQUIREDETAIL.CODE; result.RESULT = "1"; // 结果 result.CONTENT = this.textContent.Text; // 补充意见 result.OWNERCOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID; result.OWNERDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID; result.OWNERPOSTID = Common.CurrentLoginUserInfo.UserPosts[0].PostID; result.OWNERID = Common.CurrentLoginUserInfo.EmployeeID; result.CREATECOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID; result.CREATEUSERNAME = Common.CurrentLoginUserInfo.EmployeeName; result.CREATEDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID; result.CREATEPOSTID = Common.CurrentLoginUserInfo.UserPosts[0].PostID; result.OWNERNAME = Common.CurrentLoginUserInfo.EmployeeName; result.CREATEDATE = DateTime.Now; result.CREATEUSERID = Common.CurrentLoginUserInfo.EmployeeID; result.UPDATEDATE = DateTime.Now; result.UPDATEUSERID = Common.CurrentLoginUserInfo.EmployeeID; if (RowFilterButton.IsChecked == true) // 选中 添加 { listResult.Add(result); // deleteResult.Add(result); } else // 删除 { listResult.Remove(result); IDs = new ObservableCollection <string>(); IDs.Add(detail.T_OA_REQUIRERESULT.REQUIRERESULTID); } }
/// <summary> /// 保存 /// </summary> private void Save() { resultList = new ObservableCollection <T_OA_REQUIRERESULT>(); foreach (var item in subjectList) { foreach (var items in item.AnswerList) { T_OA_REQUIRERESULT result = new T_OA_REQUIRERESULT(); result.CONTENT = textSuggest.Text.Trim().ToString(); //result.SUBJECTID = item.Subject.SUBJECTID; result.REQUIRERESULTID = Guid.NewGuid().ToString(); result.RESULT = items.CONTENT; Utility.CreateUserInfo <T_OA_REQUIRERESULT>(result); resultList.Add(result); } } RefreshUI(RefreshedTypes.ShowProgressBar); client.AddSurveyingAsync(resultList, surveryingView.MasterID, surveryingView.RequireID); }
private void RowFilterButton_Click(object sender, RoutedEventArgs e) { V_REQUIRERESULTMODE detail = (V_REQUIRERESULTMODE)((CheckBox)sender).Tag; CheckBox RowFilterButton = dgResult.Columns[0].GetCellContent(detail).FindName("RowFilterButton") as CheckBox; T_OA_REQUIRERESULT result = new T_OA_REQUIRERESULT(); result.REQUIRERESULTID = Guid.NewGuid().ToString(); result.T_OA_REQUIREMASTER = new T_OA_REQUIREMASTER(); result.T_OA_REQUIREMASTER = model.T_OA_REQUIREMASTER; result.T_OA_REQUIRE = new T_OA_REQUIRE(); result.T_OA_REQUIRE = model.T_OA_REQUIRE; result.SUBJECTID =detail.T_OA_REQUIREDETAIL.SUBJECTID; result.CODE = detail.T_OA_REQUIREDETAIL.CODE; result.RESULT = "1"; // 结果 result.CONTENT = this.textContent.Text; // 补充意见 result.OWNERCOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID; result.OWNERDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID; result.OWNERPOSTID = Common.CurrentLoginUserInfo.UserPosts[0].PostID; result.OWNERID = Common.CurrentLoginUserInfo.EmployeeID; result.CREATECOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID; result.CREATEUSERNAME = Common.CurrentLoginUserInfo.EmployeeName; result.CREATEDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID; result.CREATEPOSTID = Common.CurrentLoginUserInfo.UserPosts[0].PostID; result.OWNERNAME = Common.CurrentLoginUserInfo.EmployeeName; result.CREATEDATE = DateTime.Now; result.CREATEUSERID = Common.CurrentLoginUserInfo.EmployeeID; result.UPDATEDATE = DateTime.Now; result.UPDATEUSERID = Common.CurrentLoginUserInfo.EmployeeID; if(RowFilterButton.IsChecked==true) // 选中 添加 { listResult.Add(result); // deleteResult.Add(result); } else // 删除 { listResult.Remove(result); IDs = new ObservableCollection<string>(); IDs.Add(detail.T_OA_REQUIRERESULT.REQUIRERESULTID); } }
/// <summary> /// 保存 /// </summary> private void Save() { resultList = new ObservableCollection<T_OA_REQUIRERESULT>(); foreach (var item in subjectList) { foreach (var items in item.AnswerList) { T_OA_REQUIRERESULT result = new T_OA_REQUIRERESULT(); result.CONTENT = textSuggest.Text.Trim().ToString(); //result.SUBJECTID = item.Subject.SUBJECTID; result.REQUIRERESULTID = Guid.NewGuid().ToString(); result.RESULT = items.CONTENT; Utility.CreateUserInfo<T_OA_REQUIRERESULT>(result); resultList.Add(result); } } RefreshUI(RefreshedTypes.ShowProgressBar); client.AddSurveyingAsync(resultList,surveryingView.MasterID,surveryingView.RequireID); }