Ejemplo n.º 1
0
        private void btnDelete_Click(object sender, RoutedEventArgs e)//删除
        {
            ObservableCollection <V_Satisfaction> selectItems = GetSelectList();

            if (selectItems != null)
            {
                for (int i = 0; i < dg.SelectedItems.Count; i++)
                {
                    V_Satisfaction ent = dg.SelectedItems[i] as V_Satisfaction;
                    if (ent.RequireMaster.CHECKSTATE == ((int)CheckStates.UnSubmit).ToString())
                    {
                        string        Result = "";
                        ComfirmWindow com    = new ComfirmWindow();
                        com.OnSelectionBoxClosed += (obj, result) =>
                        {
                            try { client.Del_SSurveysAsync(selectItems); }
                            catch { }
                        };
                        com.SelectionBox(Utility.GetResourceStr("DELETECONFIRM"), Utility.GetResourceStr("DELETEALTER"), ComfirmWindow.titlename, Result);
                    }
                    else
                    {
                        Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("NOTONLYDIDNOSUBMITANDREVIEWTHEDATACANBEDELETEDBY"));
                        return;
                    }
                }
            }
            else
            {
                ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "DELETE"), Utility.GetResourceStr("CONFIRMBUTTON"));
            }
        }
Ejemplo n.º 2
0
        private void btnAudit_Click(object sender, RoutedEventArgs e)//审核
        {
            ObservableCollection <V_Satisfaction> selectItems = GetSelectList();

            if (selectItems != null)
            {
                V_Satisfaction ent = dg.SelectedItems[0] as V_Satisfaction;
                if (ent.RequireMaster.CHECKSTATE == ((int)CheckStates.Approving).ToString() ||
                    ent.RequireMaster.CHECKSTATE == ((int)CheckStates.WaittingApproval).ToString() ||
                    ent.RequireMaster.CHECKSTATE == ((int)CheckStates.UnSubmit).ToString())
                {
                    SatisfactionSurveyChildWindow form = new SatisfactionSurveyChildWindow(FormTypes.Audit, ent.RequireMaster.SATISFACTIONMASTERID);
                    EntityBrowser browser = new EntityBrowser(form);
                    browser.FormType         = FormTypes.Audit;
                    browser.MinHeight        = 550;
                    browser.MinWidth         = 750;
                    browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent);
                    browser.Show <string>(DialogMode.Default, Common.ParentLayoutRoot, "", (result) => { }, true);
                }
                else
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SELECTRECORDNOTOPERATEPLEASEAGAIN"));
                    return;
                }
            }
            else
            {
                ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "AUDIT"), Utility.GetResourceStr("CONFIRMBUTTON"));
            }
        }
Ejemplo n.º 3
0
 public int Add_SSurvey(V_Satisfaction v)
 {
     using (SatisfactionBll satBll = new SatisfactionBll())
     {
         return(satBll.Add_SSurvey(v));
     }
 }
Ejemplo n.º 4
0
        private void btnEdit_Click(object sender, RoutedEventArgs e)//修改
        {
            ObservableCollection <V_Satisfaction> selectItems = GetSelectList();

            if (selectItems != null)
            {
                V_Satisfaction ent = dg.SelectedItems[0] as V_Satisfaction;
                if (ent.RequireMaster.CHECKSTATE == ((int)CheckStates.UnSubmit).ToString() || ent.RequireMaster.CHECKSTATE == ((int)CheckStates.UnApproved).ToString())
                {
                    SatisfactionSurveyChildWindow form = new SatisfactionSurveyChildWindow(FormTypes.Edit, ent.RequireMaster.SATISFACTIONMASTERID);
                    EntityBrowser browser = new EntityBrowser(form);
                    browser.FormType         = FormTypes.Edit;
                    browser.MinHeight        = 500;
                    browser.MinWidth         = 650;
                    browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent);
                    browser.Show <string>(DialogMode.Default, Common.ParentLayoutRoot, "", (result) => { }, true);
                }
                else
                {
                    ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("NOTONLYCANMODIFYTHEDATASUBMITTED"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                    return;
                }
            }
            else
            {
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SELECTDATAALERT"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
            }
        }
Ejemplo n.º 5
0
 public int Upd_SSurveyChecked(V_Satisfaction infoView)
 {
     using (SatisfactionBll satBll = new SatisfactionBll())
     {
         return(satBll.Upd_SSurveyChecked(infoView));
     }
 }
Ejemplo n.º 6
0
 void Get_SSurveyCompleted(object sender, Get_SSurveyCompletedEventArgs e)
 {
     if (e.Result != null)
     {
         _survey = e.Result;
         Load_Data();
     }
 }
Ejemplo n.º 7
0
 private void dg_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     _lst.Clear();
     if (dg.SelectedIndex > -1)
     {
         V_Satisfaction vd = dg.SelectedItem as V_Satisfaction;
         _lst.Add(vd);
     }
 }
Ejemplo n.º 8
0
        //更新方案、题目
        public int Upd_SSurvey(V_Satisfaction infoView)
        {
            try
            {
                SatisfactionDal satDal = new SatisfactionDal();
                this.BeginTransaction();
                //更新方案
                if (Upd_SSurveys(infoView.RequireMaster) < 1)
                {
                    this.RollbackTransaction();
                    return(-1);
                }
                //题目 添加、更新
                List <T_OA_SATISFACTIONDETAIL> subjectViewList = Get_SubByParentID(infoView.RequireMaster.SATISFACTIONMASTERID).ToList();
                //////删除
                IEnumerable <T_OA_SATISFACTIONDETAIL> lstsub = infoView.SubjectViewList;
                foreach (T_OA_SATISFACTIONDETAIL i in lstsub)
                {
                    bool isAdd = true;

                    foreach (T_OA_SATISFACTIONDETAIL v in subjectViewList)
                    {
                        if (i.SATISFACTIONDETAILID.Equals(v.SATISFACTIONDETAILID))
                        {
                            isAdd = false; break;
                        }
                    }
                    if (isAdd)
                    {      //添加   题目
                        Utility.RefreshEntity(i);
                        if (dal.Add(i) < 1)
                        {
                            this.RollbackTransaction();
                            return(-1);
                        }
                    }
                    else
                    {
                        //更新题目
                        if (satDal.Upd_SSurveySub(i) < 1)
                        {
                            this.RollbackTransaction();
                            return(-1);
                        }
                    }
                }
                this.CommitTransaction();
                return(1);
            }
            catch (Exception ex)
            {
                Tracer.Debug("满意度调查SatisfactionBll-Upd_SSurvey" + System.DateTime.Now.ToString() + " " + ex.ToString());
                return(-1);
            }
        }
Ejemplo n.º 9
0
 public int Upd_SSurvey(V_Satisfaction infoView)
 {
     using (SatisfactionBll satBll = new SatisfactionBll())
     {
         if (satBll.Upd_SSurvey(infoView) == 1)
         {
             return(1);
         }
         return(-1);
     }
 }
Ejemplo n.º 10
0
        public int Add_SSurvey(V_Satisfaction v)
        {
            int n = 0;

            base.Add(v.RequireMaster);
            foreach (T_OA_SATISFACTIONDETAIL subjectView in v.SubjectViewList)
            {
                subjectView.T_OA_SATISFACTIONMASTER = base.GetObjectByEntityKey(v.RequireMaster.EntityKey) as T_OA_SATISFACTIONMASTER;
                //base.Add(subjectView);
                base.AddToContext(subjectView);
            }
            n = SaveContextChanges();
            return(n);
        }
Ejemplo n.º 11
0
        private void LayoutRoot_Loaded(object sender, RoutedEventArgs e)
        {
            _Survey = new V_Satisfaction();
            _Survey.RequireMaster = new T_OA_SATISFACTIONMASTER();
            _Survey.RequireMaster.SATISFACTIONMASTERID = System.Guid.NewGuid().ToString();
            _survey.RequireMaster.CHECKSTATE           = ((int)CheckStates.UnSubmit).ToString();

            _Survey.SubjectViewList = new ObservableCollection <T_OA_SATISFACTIONDETAIL>();

            NewSubject();
            dg.ItemsSource   = _osub;
            dg.SelectedIndex = 0;

            RefreshUI(RefreshedTypes.AuditInfo);
            RefreshUI(RefreshedTypes.All);
        }
Ejemplo n.º 12
0
        void Get_SSurveyCompleted(object sender, Get_SSurveyCompletedEventArgs e)
        {
            if (e.Result != null)
            {
                employeeSurveyInfo = e.Result as V_Satisfaction;
                txbTitle.Text = EmployeeSurveyInfo.RequireMaster.SATISFACTIONTITLE;
                txbContent.Text = EmployeeSurveyInfo.RequireMaster.CONTENT;

                //题目,答案
                foreach (T_OA_SATISFACTIONDETAIL subInfo in EmployeeSurveyInfo.SubjectViewList)
                {
                    SurveyShowList_sat subjectItem = new SurveyShowList_sat();
                    subjectItem.SubjectViewInfo = subInfo;
                    //subjectItem.ResultDetail = subInfo;
                    subjectItem.oanswer = _oanswer;
                    subjectItem.IsShowResult = 0;
                    spSurveysList.Children.Add(subjectItem);
                }
            }
        }
Ejemplo n.º 13
0
 //更新审核状态
 public int Upd_SSurveyChecked(V_Satisfaction infoView)
 {
     try
     {
         SatisfactionDal satDal = new SatisfactionDal();
         if (satDal.Upd_SSurvey(infoView.RequireMaster) > 0)
         {
             return(1);
         }
         else
         {
             return(0);
         }
     }
     catch (Exception ex)
     {
         Tracer.Debug("满意度调查SatisfactionBll-Upd_SSurveyChecked" + System.DateTime.Now.ToString() + " " + ex.ToString());
         return(-1);
     }
 }
Ejemplo n.º 14
0
        void Get_SSurveyCompleted(object sender, Get_SSurveyCompletedEventArgs e)
        {
            if (e.Result != null)
            {
                employeeSurveyInfo = e.Result as V_Satisfaction;
                txbTitle.Text      = EmployeeSurveyInfo.RequireMaster.SATISFACTIONTITLE;
                txbContent.Text    = EmployeeSurveyInfo.RequireMaster.CONTENT;

                //题目,答案
                foreach (T_OA_SATISFACTIONDETAIL subInfo in EmployeeSurveyInfo.SubjectViewList)
                {
                    SurveyShowList_sat subjectItem = new SurveyShowList_sat();
                    subjectItem.SubjectViewInfo = subInfo;
                    //subjectItem.ResultDetail = subInfo;
                    subjectItem.oanswer      = _oanswer;
                    subjectItem.IsShowResult = 0;
                    spSurveysList.Children.Add(subjectItem);
                }
            }
        }
Ejemplo n.º 15
0
        void Get_SSurveyCompleted(object sender, Get_SSurveyCompletedEventArgs e)
        {
            if (e.Result != null)
            {
                employeeSurveyInfo = e.Result as V_Satisfaction;

                txtAnswerID.Text   = distribute.ANSWERID;
                txtPercentAge.Text = distribute.PERCENTAGE.ToString();
                txtStartDate.Text  = Convert.ToDateTime(distribute.T_OA_SATISFACTIONREQUIRE.STARTDATE).ToShortDateString();
                txtEndDate.Text    = Convert.ToDateTime(distribute.T_OA_SATISFACTIONREQUIRE.ENDDATE).ToShortDateString();
                txbTitle.Text      = EmployeeSurveyInfo.RequireMaster.SATISFACTIONTITLE;
                txbContent.Text    = EmployeeSurveyInfo.RequireMaster.CONTENT;

                //获取统计结果
                _VM.Result_SurveyByRequireIDAsync(distribute.T_OA_SATISFACTIONREQUIRE.SATISFACTIONREQUIREID);
            }
            else
            {
                loadbar.Stop();
            }
        }
Ejemplo n.º 16
0
 public int Add_SSurvey(V_Satisfaction v)
 {
     try
     {
         int n = 0;
         Utility.RefreshEntity(v.RequireMaster);
         n += dal.Add(v.RequireMaster);
         foreach (T_OA_SATISFACTIONDETAIL subjectView in v.SubjectViewList)
         {
             Utility.RefreshEntity(subjectView);
             //n += dal.Add(subjectView);
             dal.AddToContext(subjectView);
         }
         n = dal.SaveContextChanges();
         return(n);
     }
     catch (Exception ex)
     {
         Tracer.Debug("满意度调查SatisfactionBll-Add_SSurvey" + System.DateTime.Now.ToString() + " " + ex.ToString());
         return(-1);
     }
 }
Ejemplo n.º 17
0
 void Get_SSurveyCompleted(object sender, Get_SSurveyCompletedEventArgs e)
 {
     if (e.Result != null)
     {
         _survey = e.Result;
         Load_Data();
     }
 }
Ejemplo n.º 18
0
        void Get_SSurveyCompleted(object sender, Get_SSurveyCompletedEventArgs e)
        {
            if (e.Result != null)
            {
                employeeSurveyInfo = e.Result as V_Satisfaction;

                txtAnswerID.Text = distribute.ANSWERID;
                txtPercentAge.Text = distribute.PERCENTAGE.ToString();
                txtStartDate.Text = Convert.ToDateTime(distribute.T_OA_SATISFACTIONREQUIRE.STARTDATE).ToShortDateString();
                txtEndDate.Text = Convert.ToDateTime(distribute.T_OA_SATISFACTIONREQUIRE.ENDDATE).ToShortDateString();
                txbTitle.Text = EmployeeSurveyInfo.RequireMaster.SATISFACTIONTITLE;
                txbContent.Text = EmployeeSurveyInfo.RequireMaster.CONTENT;

                //获取统计结果
                _VM.Result_SurveyByRequireIDAsync(distribute.T_OA_SATISFACTIONREQUIRE.SATISFACTIONREQUIREID);
            }
            else
                loadbar.Stop();
        }