示例#1
0
        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;
            }
        }
示例#2
0
 /// <summary>
 /// 新增员工调查申请
 ///// </summary>
 public bool AddRequire(V_EmployeeSurveyApp addApp)
 {
     try
     {
         base.BeginTransaction();
         bool add = base.Add(addApp.requireEntity);
         if (add)
         {
             foreach (var item in addApp.distributeuserList)
             {
                 dal.Add(item);
             }
             base.CommitTransaction();
             return(true);
         }
         base.RollbackTransaction();
         return(false);
     }
     catch (Exception ex)
     {
         base.RollbackTransaction();
         Tracer.Debug("员工调查申请EmployeeSurveyAppBll-AddRequire" + System.DateTime.Now.ToString() + " " + ex.ToString());
         return(false);
     }
 }
示例#3
0
 public V_EmployeeSurveyApp GetRequireData(string requireKey)
 {
     using (EmployeeSurveyAppBll getBll = new EmployeeSurveyAppBll())
     {
         V_EmployeeSurveyApp data = getBll.GetRequireData(requireKey);
         return(data != null ? data : null);
     }
 }
示例#4
0
 public bool UpdRequire(V_EmployeeSurveyApp updApp)
 {
     if (!(string.IsNullOrEmpty(updApp.MasterId)))
     {
         using (EmployeeSurveyAppBll updBll = new EmployeeSurveyAppBll())
         {
             return(updBll.UpdRequire(updApp));
         }
     }
     return(false);
 }
示例#5
0
 public bool AddRequire(V_EmployeeSurveyApp addApp)
 {
     if (!string.IsNullOrEmpty(addApp.MasterId))
     {
         using (EmployeeSurveyAppBll addBll = new EmployeeSurveyAppBll())
         {
             return(addBll.AddRequire(addApp));
         }
     }
     return(false);
 }
        /// <summary>
        /// WCF事件注册和全局变量初始化
        /// </summary>
        private void EventRegister()
        {
            client                                    = new SmtOAPersonOfficeClient();
            personalClient                            = new Saas.Tools.PersonnelWS.PersonnelServiceClient();
            client.AddRequireCompleted               += new EventHandler <AddRequireCompletedEventArgs>(client_AddRequireCompleted);
            client.UpdRequireCompleted               += new EventHandler <UpdRequireCompletedEventArgs>(client_UpdRequireCompleted);
            client.GetRequireDataCompleted           += new EventHandler <GetRequireDataCompletedEventArgs>(client_GetRequireDataCompleted);
            personalClient.GetEmployeeByIDsCompleted += new EventHandler <Saas.Tools.PersonnelWS.GetEmployeeByIDsCompletedEventArgs>(personalClient_GetEmployeeByIDsCompleted);
            client.CheckRequireCompleted             += new EventHandler <CheckRequireCompletedEventArgs>(client_CheckRequireCompleted);
            appView                                   = new V_EmployeeSurveyApp();
            appView.requireEntity                     = new T_OA_REQUIRE();
            appView.distributeuserList                = new ObservableCollection <T_OA_DISTRIBUTEUSER>();
            distributeuserList                        = new ObservableCollection <T_OA_DISTRIBUTEUSER>();
            lookupObjectList                          = new List <ExtOrgObj>();

            personalClient.GetEmployeeDetailByParasPagingCompleted += new EventHandler <GetEmployeeDetailByParasPagingCompletedEventArgs>(personalClient_GetEmployeeDetailByParasPagingCompleted);
        }
 void client_GetRequireDataCompleted(object sender, GetRequireDataCompletedEventArgs e)
 {
     RefreshUI(RefreshedTypes.HideProgressBar);
     if (e.Error != null)
     {
         ShowMessage("error", "ERROR", "GETDATAFAILED", "", false);
         return;
     }
     if (e.Result == null)
     {
         ShowMessage("", "NODATA", "DIDNOTFINDRELEVANT", "", true);
         return;
     }
     appView = e.Result;
     this.contextInfo.DataContext  = appView.requireEntity;
     this.IsFill.IsChecked         = appView.requireEntity.WAY == "1" ? true : false;
     this.IsImplement.IsChecked    = appView.requireEntity.OPTFLAG == "1" ? true : false;
     appView.oldDistributeuserList = new ObservableCollection <T_OA_DISTRIBUTEUSER>();
     appView.oldDistributeuserList = appView.distributeuserList.Clone();//先克隆,以备删除
     distributeuserList            = appView.distributeuserList;
     ConvertByGetData(distributeuserList);
     BindingDataGrid();
     ShowAuditControl();
 }
示例#8
0
 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;
     }
 }
示例#9
0
        /// <summary>
        /// 修改员工调查申请:分发范围待完善
        /// </summary>
        public bool UpdRequire(V_EmployeeSurveyApp updApp)
        {
            string _masterID   = updApp.MasterId;
            string _requireID  = updApp.requireEntity.REQUIREID;
            string _checkState = updApp.requireEntity.CHECKSTATE;

            try
            {
                base.BeginTransaction();
                foreach (var ents in updApp.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)
                {
                    var data = from items in dal.GetObjects <T_OA_REQUIRE>()
                               where items.REQUIREID == _requireID
                               select items;
                    if (data.Count() > 0)
                    {
                        //建立entityKey,表示数据库不更新此字段(主键不允许更新)
                        updApp.requireEntity.EntityKey = Utility.AddEntityKey("T_OA_REQUIRE", "REQUIREID", _requireID);
                        if (updApp.requireEntity.T_OA_REQUIREMASTERReference.EntityKey == null)
                        {
                            updApp.requireEntity.T_OA_REQUIREMASTERReference.EntityKey = Utility.AddEntityKey("T_OA_REQUIREMASTER", "REQUIREMASTERID", _masterID);
                        }
                        int updFlag = dal.Update(updApp.requireEntity);
                        if (updFlag > 0)
                        {
                            foreach (var users in updApp.distributeuserList)
                            {
                                dal.Add(users);
                            }
                            base.CommitTransaction();
                            if (_checkState == ((int)CheckStates.Approved).ToString())
                            {
                                foreach (var items in updApp.distributeuserList)
                                {
                                    CreateNotifyTask(items);
                                }
                            }
                            return(true);
                        }
                    }
                }
                base.RollbackTransaction();
                return(false);
            }
            catch (Exception ex)
            {
                base.RollbackTransaction();
                Tracer.Debug("员工调查申请EmployeeSurveyAppBll-UpdRequire" + System.DateTime.Now.ToString() + " " + ex.ToString());
                return(false);
            }
        }