Exemple #1
0
        public override bool CustomerSaveData(object data)
        {
            ServiceReference2.StudentPending studentP = new ServiceReference2.StudentPending();
            Utility.CopyObjectProperties <Student, ServiceReference2.StudentPending>(dataSave, studentP);

            studentP.StudentId           = dataSave.StudentId;
            studentP.StudentAge          = dataSave.StudentAge;
            studentP.StudentClass        = dataSave.StudentClass;
            studentP.StudentName         = dataSave.StudentName;
            studentP.StudentSex          = (int?)dataSave.StudentSex;
            studentP.AUDIT_STATE         = (int?)EnumAuditState.Submit;
            studentP.CHECK_OPERATOR_ID   = null;
            studentP.CHECK_OPERATOR_TIME = null;
            studentP.CREATE_OPERATOR_ID  = Shar.user;
            studentP.CREATE_TIME         = DateTime.Now;
            studentP.OPERATOR_TYPE       = (int?)EnumOperatorType.Add;
            studentP.UPDATE_OPERATOR_ID  = Shar.user;
            studentP.UPDATE_TIME         = DateTime.Now;
            ServiceReference2.Service1Client client = new ServiceReference2.Service1Client();
            //存入pending表
            client.addStudentPendingCompleted += (se, de) =>
            {
                if (de.Result > 0)
                {
                    MessageBox.Show("存入成功!请到SearchWindow查看!");
                    this.Close();
                }
            };
            client.addStudentPendingAsync(studentP);
            return(true);
        }
        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            if (dataForm1.CommitEdit())
            {
                var student = dataForm1.ItemsSource.GetEnumerator().Current;
                ServiceReference2.StudentPending studentP = (ServiceReference2.StudentPending)student;

                //ServiceReference2.StudentHistory studentH = new ServiceReference2.StudentHistory();
                //studentH = (ServiceReference2.StudentHistory)student;
                MessageBoxResult resut = MessageBox.Show("是否要执行该操作", "提示信息", MessageBoxButton.OKCancel);
                if (resut == MessageBoxResult.OK)
                {
                    studentO = student;
                    ServiceReference2.Service1Client client = new ServiceReference2.Service1Client();
                    client.addStudentPendingCompleted += (se, de) =>
                    {
                        if (de.Result > 0)
                        {
                            MessageBox.Show("已添加到未审核列表中!");
                        }
                    };
                    client.addStudentPendingAsync(studentP);
                }
            }
            this.DialogResult = true;
        }
        private void BtnEdit_Click(object sender, RoutedEventArgs e)
        {
            var items = queryReject.GetCheckedResultCollection <StudentPending>().ToArray();

            if (items.Count() <= 0)
            {
                return;
            }
            ServiceReference2.Service1Client client = new ServiceReference2.Service1Client();

            ObservableCollection <ServiceReference2.StudentPending> studentPs = new ObservableCollection <ServiceReference2.StudentPending>();

            foreach (var item in items)
            {
                ServiceReference2.StudentPending studentP = new ServiceReference2.StudentPending();
                Utility.CopyObjectProperties <StudentPending, ServiceReference2.StudentPending>(item, studentP, new string[] { "OperatorType", "IsCheck" });
                studentP.OPERATOR_TYPE      = (int?)NCS.Business.DataFlow.EnumOperatorType.Edit;
                studentP.AUDIT_STATE        = (int?)NCS.Business.DataFlow.EnumAuditState.Submit;
                studentP.UPDATE_OPERATOR_ID = Shar.user;
                studentP.UPDATE_TIME        = DateTime.Now;
                studentPs.Add(studentP);
            }

            if (MessageBoxResult.OK == MessageBox.Show("是否要修改选中的数据", "提示信息", MessageBoxButton.OKCancel))
            {
                client.updateStudentPendidngsCompleted += (se, de) =>
                {
                    if (de.Result)
                    {
                        MessageBox.Show("修改已提交,等待审核!");
                        var stitem   = queryReject.ResultCollection as ObservableCollection <StudentPending>;
                        var selected = queryReject.GetCheckedResultCollection <StudentPending>().ToArray();
                        foreach (var selectItem in selected)
                        {
                            stitem.Remove(selectItem);
                        }
                    }
                    else
                    {
                        MessageBox.Show("执行失败了!");
                    }
                };
                client.updateStudentPendidngsAsync(studentPs);
            }
        }
Exemple #4
0
        private void BtnApprove_Click(object sender, RoutedEventArgs e)
        {
            ServiceReference2.Service1Client client = new ServiceReference2.Service1Client();
            var items = queryExamine.GetCheckedResultCollection <StudentPending>().ToArray();

            if (items.Count() <= 0)
            {
                return;
            }
            ObservableCollection <ServiceReference2.StudentPending> studentPs = new ObservableCollection <ServiceReference2.StudentPending>();

            foreach (var item in items)
            {
                ServiceReference2.StudentPending studentP = new ServiceReference2.StudentPending();
                Utility.CopyObjectProperties <StudentPending, ServiceReference2.StudentPending>(item, studentP, new string[] { "IsCheck" });
                studentP.CHECK_OPERATOR_ID   = Shar.user;
                studentP.CHECK_OPERATOR_TIME = DateTime.Now;
                studentP.AUDIT_STATE         = (int?)NCS.Business.DataFlow.EnumAuditState.Approve;
                studentPs.Add(studentP);
            }
            if (MessageBoxResult.OK == MessageBox.Show("是否要审核选择的数据", "提示信息", MessageBoxButton.OKCancel))
            {
                client.AduitCompleted += (se, de) =>
                {
                    if (de.Result)
                    {
                        MessageBox.Show("审核完毕!");
                        var stitems   = queryExamine.ResultCollection as ObservableCollection <StudentPending>;
                        var selecteds = queryExamine.GetCheckedResultCollection <StudentPending>().ToArray();
                        foreach (var selected in selecteds)
                        {
                            stitems.Remove(selected);
                        }
                    }
                    else
                    {
                        MessageBox.Show("未审核完毕");
                    }
                };
                client.AduitAsync(studentPs);
            }
        }
        private void BtnDel_Click(object sender, RoutedEventArgs e)
        {
            var stItems = queryFormal.GetCheckedResultCollection <Student>().ToArray();

            if (stItems.Count() <= 0)
            {
                return;
            }
            ServiceReference2.Service1Client client = new ServiceReference2.Service1Client();
            System.Collections.ObjectModel.ObservableCollection <ServiceReference2.StudentPending> studentPs = new System.Collections.ObjectModel.ObservableCollection <ServiceReference2.StudentPending>();
            foreach (var item in stItems)
            {
                ServiceReference2.StudentPending studentP = new ServiceReference2.StudentPending();
                Utility.CopyObjectProperties <Student, ServiceReference2.StudentPending>(item, studentP, new string[] { "OperatorType", "IsCheck", "EntityKey" });
                studentP.UPDATE_OPERATOR_ID = Shar.user;
                studentP.UPDATE_TIME        = DateTime.Now;
                studentP.OPERATOR_TYPE      = (int?)NCS.Business.DataFlow.EnumOperatorType.Delete;
                studentP.AUDIT_STATE        = (int?)NCS.Business.DataFlow.EnumAuditState.Submit;
                studentPs.Add(studentP);
            }
            if (MessageBoxResult.OK == MessageBox.Show("是否要删除选中的数据", "提示信息", MessageBoxButton.OKCancel))
            {
                client.delStudentPendingCompleted += (se, de) =>
                {
                    if (de.Result)
                    {
                        MessageBox.Show("删除完成,请到PendingWindow表查看!");
                        var selected = queryFormal.GetCheckedResultCollection <Student>().ToArray();
                        foreach (var selectItem in selected)
                        {
                            selectItem.IsCheck = false;
                        }
                    }
                    else
                    {
                        MessageBox.Show("执行失败了!");
                    }
                };
                client.delStudentPendingAsync(studentPs);
            }
        }