示例#1
0
        /// <summary>
        /// 更新题目
        /// </summary>
        /// <param name="surveySubjectInfo"></param>
        /// <returns></returns>
        public int Upd_SSurveySub(T_OA_SATISFACTIONDETAIL surveySubjectInfo)
        {
            try
            {
                if (surveySubjectInfo.EntityKey == null)
                {
                    surveySubjectInfo.EntityKey = new System.Data.EntityKey("TM_SaaS_OA_EFModelContext.T_OA_SATISFACTIONDETAIL", "SATISFACTIONDETAILID", surveySubjectInfo.SATISFACTIONDETAILID);
                }
                T_OA_SATISFACTIONDETAIL tmpobj = base.GetObjectByEntityKey(surveySubjectInfo.EntityKey) as T_OA_SATISFACTIONDETAIL;
                if (surveySubjectInfo.T_OA_SATISFACTIONMASTERReference.EntityKey == null)
                {
                    surveySubjectInfo.T_OA_SATISFACTIONMASTERReference.EntityKey = new EntityKey("TM_SaaS_OA_EFModelContext.T_OA_SATISFACTIONMASTER", "SATISFACTIONMASTERID", surveySubjectInfo.T_OA_SATISFACTIONMASTER.SATISFACTIONMASTERID);
                }
                tmpobj.T_OA_SATISFACTIONMASTER = base.GetObjectByEntityKey(surveySubjectInfo.T_OA_SATISFACTIONMASTERReference.EntityKey) as T_OA_SATISFACTIONMASTER;
                base.UpdateFromContext(surveySubjectInfo);

                int i = SaveContextChanges();
                if (i < 0)
                {
                    return(-1);
                }
                else
                {
                    return(1);
                }
            }
            catch (Exception ex)
            {
                throw (ex);
            }
        }
示例#2
0
 void SatisfactionSurveyChildWindow_Loaded(object sender, RoutedEventArgs e)
 {
     EventResgister();
     masterEntity = new T_OA_SATISFACTIONMASTER();
     detailEntity = new T_OA_SATISFACTIONDETAIL();
     RefreshUI(RefreshedTypes.AuditInfo);
     RefreshUI(RefreshedTypes.All);
     if (!string.IsNullOrEmpty(masterId) && actionType != FormTypes.New)
     {
         if (actionType == FormTypes.Browse)
         {
             this.txtContent.IsEnabled = false;
             this.txtSubject.IsEnabled = false;
             this.dgSubject.IsEnabled  = false;
         }
         RefreshUI(RefreshedTypes.ShowProgressBar);
         client.GetSatisfactionMasterChildAsync(masterId);
     }
     else
     {
         SetMaterData();
         SetDetailList();
     }
     this.contextInfo.DataContext = masterEntity;
     this.dgSubject.ItemsSource   = detailList;
     dgSubject.SelectedIndex      = 0;
 }
 void SatisfactionSurveyChildWindow_Loaded(object sender, RoutedEventArgs e)
 {
     EventResgister();
     masterEntity = new T_OA_SATISFACTIONMASTER();
     detailEntity = new T_OA_SATISFACTIONDETAIL();
     RefreshUI(RefreshedTypes.AuditInfo);
     RefreshUI(RefreshedTypes.All);
     if (!string.IsNullOrEmpty(masterId) && actionType != FormTypes.New)
     {
         if (actionType == FormTypes.Browse)
         {
             this.txtContent.IsEnabled = false;
             this.txtSubject.IsEnabled = false;
             this.dgSubject.IsEnabled = false;
         }
         RefreshUI(RefreshedTypes.ShowProgressBar);
         client.GetSatisfactionMasterChildAsync(masterId);
     }
     else
     {
         SetMaterData();
         SetDetailList();
     }
     this.contextInfo.DataContext = masterEntity;
     this.dgSubject.ItemsSource = detailList;
     dgSubject.SelectedIndex = 0;
 }
示例#4
0
 //根据 回车键,判断 是否新增行,保存修改行。行加载后, 重新计算行题号  1
 private void txtSub_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         if (dg.SelectedIndex == _osub.Count - 1)
         {
             T_OA_SATISFACTIONDETAIL vsub = _osub.LastOrDefault();
             if (vsub.CONTENT != null && vsub.CONTENT.Trim().Length > 0)
             {
                 NewSubject();
                 //foreach (object obj in dg.ItemsSource)
                 //{
                 //    if (dg.Columns[2].GetCellContent(obj) != null)
                 //    {
                 //        TextBox ckbSelect = dg.Columns[2].GetCellContent(obj).FindName("txtSub") as TextBox;
                 //        ckbSelect.Focus();
                 //    }
                 //}
             }
             else
             {
                 Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("OAESURVEYSUBJECTNULL"));
             }
         }
     }
 }
 private void dg_LoadingRow(object sender, DataGridRowEventArgs e)//点击回车新加载一行
 {
     T_OA_SATISFACTIONDETAIL temp = (T_OA_SATISFACTIONDETAIL)e.Row.DataContext;
     ImageButton MyButton_Delbaodao = dg.Columns[3].GetCellContent(e.Row).FindName("myDelete") as ImageButton;
     MyButton_Delbaodao.Margin = new Thickness(0);
     MyButton_Delbaodao.AddButtonAction("/SMT.SaaS.FrameworkUI;Component/Images/ToolBar/ico_16_delete.png", Utility.GetResourceStr("DELETE"));
     MyButton_Delbaodao.Tag = temp;
 }
示例#6
0
 /// <summary>
 /// 设置 题目其它信息
 /// </summary>
 /// <param name="i"></param>
 private static void SetSubject(ref T_OA_SATISFACTIONDETAIL i)
 {
     i.CREATEDATE         = System.DateTime.Now;
     i.CREATEUSERID       = Common.CurrentLoginUserInfo.EmployeeID;
     i.CREATECOMPANYID    = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
     i.CREATEDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
     i.CREATEPOSTID       = Common.CurrentLoginUserInfo.UserPosts[0].PostID;
     i.CREATEUSERNAME     = Common.CurrentLoginUserInfo.EmployeeName;
     i.OWNERID            = Common.CurrentLoginUserInfo.EmployeeID;
     i.OWNERCOMPANYID     = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
     i.OWNERDEPARTMENTID  = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
     i.OWNERPOSTID        = Common.CurrentLoginUserInfo.UserPosts[0].PostID;
     i.OWNERNAME          = Common.CurrentLoginUserInfo.EmployeeName;
 }
示例#7
0
 void SetDetailList()
 {
     detailList = new ObservableCollection <T_OA_SATISFACTIONDETAIL>();
     if (detailList.Count > 0)
     {
         T_OA_SATISFACTIONDETAIL de = detailList[detailList.Count - 1];
         detailEntity.SUBJECTID = de.SUBJECTID + 1;
         SetChildData(ref detailEntity);
     }
     else
     {
         detailEntity.SUBJECTID = 1;
         SetChildData(ref detailEntity);
     }
 }
示例#8
0
        //删除题目
        private void Delete_Click(object sender, RoutedEventArgs e)
        {
            if (_osub.Count > 1) //必须有派车单,司机才能根据派车单提交费用 单
            {
                T_OA_SATISFACTIONDETAIL i = ((Button)sender).DataContext as T_OA_SATISFACTIONDETAIL;
                _osub.Remove(i);

                if (i.SATISFACTIONDETAILID != null) //删除已经保存到服务器中的数据
                {
                    ObservableCollection <T_OA_SATISFACTIONDETAIL> o = new ObservableCollection <T_OA_SATISFACTIONDETAIL>();
                    o.Add(i);
                    _VM.Del_SSurveySubAsync(o);
                    RefreshUI(RefreshedTypes.HideProgressBar);
                }
            }
        }
示例#9
0
 /// <summary>
 /// 添加一个题目
 /// </summary>
 private void NewSubject()
 {
     T_OA_SATISFACTIONDETAIL sub = new T_OA_SATISFACTIONDETAIL();
     sub.SATISFACTIONDETAILID = Guid.NewGuid().ToString();
     sub.SATISFACTIONMASTERID = _survey.RequireMaster.SATISFACTIONMASTERID;
     sub.T_OA_SATISFACTIONMASTER = _survey.RequireMaster;
     if (_osub.Count > 0)
     {
         T_OA_SATISFACTIONDETAIL i = _osub[_osub.Count - 1];
         sub.SUBJECTID = i.SUBJECTID + 1;
     }
     else
         sub.SUBJECTID = 1;// 添加保存后,不能全部删除所有题目。
     SetSubject(ref sub);
     _osub.Add(sub);
 }
示例#10
0
 void SetChildData(ref T_OA_SATISFACTIONDETAIL detailEntity)
 {
     if (detailEntity != null)
     {
         detailEntity.SATISFACTIONDETAILID = Guid.NewGuid().ToString();
         detailEntity.SATISFACTIONMASTERID = masterEntity.SATISFACTIONMASTERID;
         detailEntity.CREATEDATE           = DateTime.Now;
         detailEntity.UPDATEDATE           = DateTime.Now;
         detailEntity.CREATEUSERID         = detailEntity.UPDATEUSERID = detailEntity.OWNERID = Common.CurrentLoginUserInfo.EmployeeID.ToString();
         detailEntity.CREATEUSERNAME       = detailEntity.UPDATEUSERNAME = detailEntity.OWNERNAME = Common.CurrentLoginUserInfo.EmployeeName.ToString();
         detailEntity.CREATECOMPANYID      = detailEntity.OWNERCOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID.ToString();
         detailEntity.CREATEDEPARTMENTID   = detailEntity.OWNERDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID.ToString();
         detailEntity.CREATEPOSTID         = detailEntity.OWNERPOSTID = Common.CurrentLoginUserInfo.UserPosts[0].PostID.ToString();
         detailList.Add(detailEntity);
         return;
     }
     ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
 }
示例#11
0
        /// <summary>
        /// 添加一个题目
        /// </summary>
        private void NewSubject()
        {
            T_OA_SATISFACTIONDETAIL sub = new T_OA_SATISFACTIONDETAIL();

            sub.SATISFACTIONDETAILID    = Guid.NewGuid().ToString();
            sub.SATISFACTIONMASTERID    = _survey.RequireMaster.SATISFACTIONMASTERID;
            sub.T_OA_SATISFACTIONMASTER = _survey.RequireMaster;
            if (_osub.Count > 0)
            {
                T_OA_SATISFACTIONDETAIL i = _osub[_osub.Count - 1];
                sub.SUBJECTID = i.SUBJECTID + 1;
            }
            else
            {
                sub.SUBJECTID = 1;// 添加保存后,不能全部删除所有题目。
            }
            SetSubject(ref sub);
            _osub.Add(sub);
        }
示例#12
0
 private void Save()
 {
     _Survey.RequireMaster.SATISFACTIONTITLE = txtTitle.Text.Trim();
     _Survey.RequireMaster.CONTENT           = txtContent.Text.Trim();
     _Survey.RequireMaster.CHECKSTATE        = _survey.RequireMaster.CHECKSTATE;
     if (_isAdd)
     {
         SetSurvey();
         for (int i = 0; i < _osub.Count; i++)
         {
             if (_osub[i].CONTENT != null && _osub[i].CONTENT.Trim().Length > 0 && _osub[i].CONTENT != "无")
             {
                 T_OA_SATISFACTIONDETAIL sub = _osub[i];
                 _Survey.SubjectViewList.Add(sub);   //题目id
             }
         }
         _VM.Add_SSurveyAsync(_Survey);
     }
     else
     {
         _VM.Upd_SSurveyAsync(_Survey);
     }
 }
 void SetChildData(ref T_OA_SATISFACTIONDETAIL detailEntity)
 {
     if (detailEntity != null)
     {
         detailEntity.SATISFACTIONDETAILID = Guid.NewGuid().ToString();
         detailEntity.SATISFACTIONMASTERID = masterEntity.SATISFACTIONMASTERID;
         detailEntity.CREATEDATE = DateTime.Now;
         detailEntity.UPDATEDATE = DateTime.Now;
         detailEntity.CREATEUSERID = detailEntity.UPDATEUSERID = detailEntity.OWNERID = Common.CurrentLoginUserInfo.EmployeeID.ToString();
         detailEntity.CREATEUSERNAME = detailEntity.UPDATEUSERNAME = detailEntity.OWNERNAME = Common.CurrentLoginUserInfo.EmployeeName.ToString();
         detailEntity.CREATECOMPANYID = detailEntity.OWNERCOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID.ToString();
         detailEntity.CREATEDEPARTMENTID = detailEntity.OWNERDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID.ToString();
         detailEntity.CREATEPOSTID = detailEntity.OWNERPOSTID = Common.CurrentLoginUserInfo.UserPosts[0].PostID.ToString();
         detailList.Add(detailEntity);
         return;
     }
     ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
 }
示例#14
0
 /// <summary>
 /// 设置 题目其它信息
 /// </summary>
 /// <param name="i"></param>
 private static void SetSubject(ref T_OA_SATISFACTIONDETAIL i)
 {
     i.CREATEDATE = System.DateTime.Now;
     i.CREATEUSERID = Common.CurrentLoginUserInfo.EmployeeID;
     i.CREATECOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
     i.CREATEDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
     i.CREATEPOSTID = Common.CurrentLoginUserInfo.UserPosts[0].PostID;
     i.CREATEUSERNAME = Common.CurrentLoginUserInfo.EmployeeName;
     i.OWNERID = Common.CurrentLoginUserInfo.EmployeeID;
     i.OWNERCOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
     i.OWNERDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
     i.OWNERPOSTID = Common.CurrentLoginUserInfo.UserPosts[0].PostID;
     i.OWNERNAME = Common.CurrentLoginUserInfo.EmployeeName;
 }