private void dgScheme_SelectionChanged(object sender, SelectionChangedEventArgs e) { DataGrid dgBySelectData = (DataGrid)sender; if (e.AddedItems == null) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error); return; } if (searchType == "satisfactionMaster" || searchType == "satisfactionRequire") { _dataView = new V_Satisfactions(); _dataView = dgBySelectData.SelectedItem as V_Satisfactions; } else if (searchType == "requireMaster") { _employeeMasterView = new V_EmployeeSurveyMaster(); _employeeMasterView = dgBySelectData.SelectedItem as V_EmployeeSurveyMaster; } else { _employeeAppView = new V_EmployeeSurveyApp(); _employeeAppView = dgBySelectData.SelectedItem as V_EmployeeSurveyApp; } }
/// <summary> /// 新增满意度调查发布申请 /// </summary> public bool AddSatisfactionDistribute(V_Satisfactions addView) { try { base.BeginTransaction(); string _foreignKey = addView.Satisfactionrequireid; if (addView.disibuteEntity.T_OA_SATISFACTIONREQUIREReference.EntityKey == null) { addView.requireEntity.T_OA_SATISFACTIONMASTERReference.EntityKey = Utility.AddEntityKey("T_OA_SATISFACTIONREQUIRE", "SATISFACTIONREQUIREID", _foreignKey); } bool add = base.Add(addView.disibuteEntity); if (add) { foreach (var item in addView.distributeuserList) { dal.Add(item); } base.CommitTransaction(); return(true); } base.RollbackTransaction(); return(false); } catch (Exception ex) { base.RollbackTransaction(); Tracer.Debug("满意度调查发布申请SatisfactionDistributeBll-AddSatisfactionDistribute" + System.DateTime.Now.ToString() + " " + ex.ToString()); return(false); } }
/// <summary> /// 新增满意度调查申请 /// </summary> /// <param name="addRequireEntity">满意度调查实体</param> /// <param name="distributeList">分布范围实体集合</param> /// <returns>返回是否新增成功</returns> public bool AddSatisfactionApp(V_Satisfactions addView) { try { base.BeginTransaction(); bool add = base.Add(addView.requireEntity); if (add) { foreach (var item in addView.distributeuserList) { dal.Add(item); } base.CommitTransaction(); return(true); } base.RollbackTransaction(); return(false); } catch (Exception ex) { dal.RollbackTransaction(); Tracer.Debug("满意度调查方案SatisfactionAppBll-AddSatisfactionApp" + System.DateTime.Now.ToString() + " " + ex.ToString()); return(false); } }
public bool UpdSatisfactionDistribute(V_Satisfactions updView) { if (!string.IsNullOrEmpty(updView.Satisfactionrequireid) && !string.IsNullOrEmpty(updView.SatisfactiondistrbuteidDistrbuteid)) { using (SatisfactionDistributeBll updbuteBll = new SatisfactionDistributeBll()) { return(updbuteBll.UpdSatisfactionDistribute(updView)); } } return(false); }
public bool AddSatisfactionDistribute(V_Satisfactions addView) { if (!string.IsNullOrEmpty(addView.Satisfactionrequireid)) { using (SatisfactionDistributeBll addBll = new SatisfactionDistributeBll()) { return(addBll.AddSatisfactionDistribute(addView)); } } return(false); }
public bool UpdSatisfactionApp(V_Satisfactions updView) { if (!string.IsNullOrEmpty(updView.Satisfactionmasterid) && !string.IsNullOrEmpty(updView.Satisfactionrequireid)) { using (SatisfactionAppBll updBll = new SatisfactionAppBll()) { return(updBll.UpdSatisfactionApp(updView)); } } return(false); }
public bool AddSatisfactionApp(V_Satisfactions addView) { if (!string.IsNullOrEmpty(addView.Satisfactionmasterid)) { using (SatisfactionAppBll appBll = new SatisfactionAppBll()) { return(appBll.AddSatisfactionApp(addView)); } } return(false); }
/// <summary> /// 更新满意度调查申请 /// </summary> /// <param name="updRequireEntity">满意度调查申请实体</param> /// <param name="updDistributeList">发布范围实体集合</param> /// <returns>返回是否修改成功</returns> public bool UpdSatisfactionApp(V_Satisfactions updView) { try { string _foreignKey = updView.requireEntity.SATISFACTIONREQUIREID; string _primeKey = updView.Satisfactionmasterid; var requireEnt = dal.GetObjects <T_OA_SATISFACTIONREQUIRE>() .Where(ents => ents.SATISFACTIONREQUIREID == updView.Satisfactionrequireid) .Select(ent => ent).Single(); base.BeginTransaction(); foreach (var del in updView.oldDistributeuserList) { var delData = dal.GetObjects <T_OA_DISTRIBUTEUSER>() .Where(item => new { item.MODELNAME, item.FORMID, item.VIEWER, item.VIEWTYPE } == new { del.MODELNAME, del.FORMID, del.VIEWER, del.VIEWTYPE }) .Select(data => data) .Single(); dal.DeleteFromContext(delData); } int _delFlag = dal.SaveContextChanges(); if (_delFlag > 0) { foreach (var ents in updView.distributeuserList) { dal.Add(ents); } updView.requireEntity.EntityKey = Utility.AddEntityKey("T_OA_SATISFACTIONREQUIRE", "SATISFACTIONREQUIREID", _primeKey); if (updView.requireEntity.T_OA_SATISFACTIONMASTERReference.EntityKey == null) { updView.requireEntity.T_OA_SATISFACTIONMASTERReference.EntityKey = Utility.AddEntityKey("T_OA_SATISFACTIONMASTER", "SATISFACTIONMASTERID", _foreignKey); } bool _updFlag = base.Add(updView.requireEntity); if (_updFlag) { base.CommitTransaction(); return(true); } } base.RollbackTransaction(); return(false); } catch (Exception ex) { base.RollbackTransaction(); Tracer.Debug("满意度调查方案SatisfactionAppBll-UpdSatisfactionApp" + System.DateTime.Now.ToString() + " " + ex.ToString()); return(false); } }
/// <summary> /// 更新满意度调查发布申请 /// </summary> public bool UpdSatisfactionDistribute(V_Satisfactions updView) { try { string _foreignKey = updView.disibuteEntity.SATISFACTIONDISTRIBUTEID; string _primeKey = updView.Satisfactionrequireid; base.BeginTransaction(); foreach (var ents in updView.oldDistributeuserList) { var ent = from chlidData in dal.GetObjects <T_OA_DISTRIBUTEUSER>() where new { chlidData.MODELNAME, chlidData.FORMID, chlidData.VIEWER, chlidData.VIEWTYPE } == new { ents.MODELNAME, ents.FORMID, ents.VIEWER, ents.VIEWTYPE } select chlidData; if (ent.Count() > 0) { var _delData = ent.FirstOrDefault(); dal.DeleteFromContext(_delData); } } int _delFlag = dal.SaveContextChanges(); if (_delFlag > 0) { foreach (var ents in updView.distributeuserList) { dal.Add(ents); } updView.disibuteEntity.EntityKey = Utility.AddEntityKey("T_OA_SATISFACTIONDISTRIBUTE", "SATISFACTIONDISTRIBUTEID", _primeKey); if (updView.disibuteEntity.T_OA_SATISFACTIONREQUIREReference.EntityKey == null) { updView.disibuteEntity.T_OA_SATISFACTIONREQUIREReference.EntityKey = Utility.AddEntityKey("T_OA_SATISFACTIONREQUIRE", "SATISFACTIONREQUIREID", _foreignKey); } if (base.Add(updView.disibuteEntity)) { base.CommitTransaction(); return(true); } } base.RollbackTransaction(); return(false); } catch (Exception ex) { base.RollbackTransaction(); Tracer.Debug("满意度调查发布申请SatisfactionDistributeBll-UpdSatisfactionDistribute" + System.DateTime.Now.ToString() + " " + ex.ToString()); return(false); } }
void client_GetSatisfactionDistributeChildCompleted(object sender, GetSatisfactionDistributeChildCompletedEventArgs e) { RefreshUI(RefreshedTypes.HideProgressBar); if (e.Error != null) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("GETDATAFAILED"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error); return; } if (e.Result == null) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("NOTFOUNDDATAOFMATCHCON"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Information); return; } distributeView = e.Result; this.contextInfo.DataContext = distributeView.disibuteEntity; RefreshUI(RefreshedTypes.ShowProgressBar); permissionClient.GetSysDictionaryByFatherIDAsync(distributeView.AnswerGroupid); ShowAuditControl(); }
private void dgScheme_SelectionChanged(object sender, SelectionChangedEventArgs e) { DataGrid dgBySelectData=(DataGrid)sender; if (e.AddedItems == null) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error); return; } if (searchType == "satisfactionMaster" || searchType == "satisfactionRequire") { _dataView = new V_Satisfactions(); _dataView = dgBySelectData.SelectedItem as V_Satisfactions; } else if (searchType == "requireMaster") { _employeeMasterView = new V_EmployeeSurveyMaster(); _employeeMasterView = dgBySelectData.SelectedItem as V_EmployeeSurveyMaster; } else { _employeeAppView = new V_EmployeeSurveyApp(); _employeeAppView = dgBySelectData.SelectedItem as V_EmployeeSurveyApp; } }
void client_GetSatisfactionDistributeChildCompleted(object sender, GetSatisfactionDistributeChildCompletedEventArgs e) { RefreshUI(RefreshedTypes.HideProgressBar); if (e.Error != null) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("GETDATAFAILED"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error); return; } if (e.Result == null) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("NOTFOUNDDATAOFMATCHCON"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Information); return; } distributeView = e.Result; this.contextInfo.DataContext = distributeView.disibuteEntity; RefreshUI(RefreshedTypes.ShowProgressBar); permissionClient.GetSysDictionaryByFatherIDAsync(distributeView.AnswerGroupid); ShowAuditControl(); }