Пример #1
0
 public NewsServices()
 {
     servers    = new BasicServices();
     client     = servers.PlatformClient;
     publicWS   = new Saas.Tools.PublicInterfaceWS.PublicServiceClient();
     fileClient = new Saas.Tools.NewFileUploadWS.UploadServiceClient();
     RegisterServices();
 }
Пример #2
0
 public NewsServices()
 {
     servers = new BasicServices();
     client = servers.PlatformClient;
     publicWS = new Saas.Tools.PublicInterfaceWS.PublicServiceClient();
     fileClient = new Saas.Tools.NewFileUploadWS.UploadServiceClient();
     RegisterServices();
 }
Пример #3
0
        public NewsServices()
        {
            servers        = new BasicServices();
            client         = servers.PlatformClient;
            callBackClient = servers.CallBackClient;
            publicWS       = new Saas.Tools.PublicInterfaceWS.PublicServiceClient();

            RegisterServices();
        }
Пример #4
0
        public NewsServices()
        {
            servers = new BasicServices();
            client = servers.PlatformClient;
            callBackClient = servers.CallBackClient;
            publicWS = new Saas.Tools.PublicInterfaceWS.PublicServiceClient();

            RegisterServices();
        }
Пример #5
0
 public NewsShow()
 {
     InitializeComponent();
     rtbContent.HideHeadToolbars();
     services = new BasicServices();
     publicWS = new Saas.Tools.PublicInterfaceWS.PublicServiceClient();
     client   = services.PlatformClient;
     client.GetNewsModelByIDCompleted += new EventHandler <GetNewsModelByIDCompletedEventArgs>(client_GetNewsModelByIDCompleted);
     publicWS.GetContentCompleted     += new EventHandler <Saas.Tools.PublicInterfaceWS.GetContentCompletedEventArgs>(publicWS_GetContentCompleted);
 }
Пример #6
0
 public NewsShow()
 {
     InitializeComponent();
     rtbContent.HideHeadToolbars();
     services = new BasicServices();
     publicWS = new Saas.Tools.PublicInterfaceWS.PublicServiceClient();
     client = services.PlatformClient;
     client.GetNewsModelByIDCompleted += new EventHandler<GetNewsModelByIDCompletedEventArgs>(client_GetNewsModelByIDCompleted);
     publicWS.GetContentCompleted += new EventHandler<Saas.Tools.PublicInterfaceWS.GetContentCompletedEventArgs>(publicWS_GetContentCompleted);
 }
Пример #7
0
        /// <summary>
        /// 转发按钮事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void btnForward_Click(object sender, RoutedEventArgs e)
        {
            //当表单需要审核时,才会出现转发的按钮
            if (EntityEditor is IAudit)
            {
                SMT.Saas.Tools.PublicInterfaceWS.PublicServiceClient PublicInterface = new SMT.Saas.Tools.PublicInterfaceWS.PublicServiceClient();
                //不存在出差报销的转发,改为出差申请的转发
                if (AuditCtrl.AuditEntity.ModelCode.Equals("T_OA_TRAVELREIMBURSEMENT"))
                {
                    AuditCtrl.AuditEntity.ModelCode = "T_OA_BUSINESSTRIP";
                }
                PublicInterface.GetBusinessObjectAsync(AuditCtrl.AuditEntity.SystemCode, AuditCtrl.AuditEntity.ModelCode);
                PublicInterface.GetBusinessObjectCompleted += (fo, fe) =>
                {
                    if (fe.Error == null)
                    {
                        AuditCtrl.AuditEntity.BusinessObjectDefineXML = fe.Result;

                        ((IAudit)EntityEditor).SetFlowRecordEntity(AuditCtrl.AuditEntity);
                        if (AuditCtrl.AuditEntity.ModelCode.Equals("T_OA_TRAVELREIMBURSEMENT"))
                        {
                            AuditCtrl.AuditEntity.ModelCode = "T_OA_BUSINESSTRIP";
                        }
                        string strExceptionMsg = string.Empty;
                        if (string.IsNullOrEmpty(AuditCtrl.AuditEntity.ModelCode))
                        {
                            strExceptionMsg = "模块代码不能为空";

                            ComfirmWindow.ConfirmationBox("转发异常:" + Utility.GetResourceStr("ERROR"), strExceptionMsg, Utility.GetResourceStr("CONFIRMBUTTON"));
                            return;
                        }

                        if (string.IsNullOrEmpty(AuditCtrl.AuditEntity.FormID))
                        {
                            strExceptionMsg = "表单ID不能为空";

                            ComfirmWindow.ConfirmationBox("转发异常:" + Utility.GetResourceStr("ERROR"), strExceptionMsg, Utility.GetResourceStr("CONFIRMBUTTON"));
                            return;
                        }

                        string strOwnerID = string.Empty, strXmlObjectSource = string.Empty, strAppInfo = string.Empty;
                        strXmlObjectSource = AuditCtrl.AuditEntity.XmlObject;

                        strOwnerID = GetValueFromXMLObjectSource("Attribute", "Name", "OWNERID", "DataValue", strXmlObjectSource);
                        //如果为事项审批,则获取单号
                        if (AuditCtrl.AuditEntity.ModelCode.Equals("T_OA_APPROVALINFO"))
                        {
                            //事项审批单号
                            strAppInfo = GetValueFromXMLObjectSource("Attribute", "Name", "APPROVALCODE", "DataValue", strXmlObjectSource);
                        }
                        if (string.IsNullOrWhiteSpace(strOwnerID))
                        {
                            strExceptionMsg = "转发人信息未正常获取";

                            ComfirmWindow.ConfirmationBox("转发异常:" + Utility.GetResourceStr("ERROR"), strExceptionMsg, Utility.GetResourceStr("CONFIRMBUTTON"));
                            return;
                        }

                        // 转发 start
                        bool canForward = false;
                        if (AuditCtrl != null && AuditCtrl.AuditPersonList != null)
                        {
                            canForward = AuditCtrl.AuditPersonList.Contains(SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID);
                        }
                        else
                        {
                            canForward = strOwnerID == AuditCtrl.AuditEntity.CreateUserID;
                        }
                        if (!canForward)
                        {
                            strExceptionMsg = "禁止转发他人的单据";

                            ComfirmWindow.ConfirmationBox("转发异常:" + Utility.GetResourceStr("ERROR"), strExceptionMsg, Utility.GetResourceStr("CONFIRMBUTTON"));
                            return;
                        }
                        //  转发 end

                        //选择转发的对象
                        SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup lookup = new SMT.SaaS.FrameworkUI.OrganizationControl.OrganizationLookup(SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID, "6", AuditCtrl.AuditEntity.ModelCode);

                        lookup.SelectedObjType = OrgTreeItemTypes.Personnel;
                        lookup.MultiSelected = true;   //不允许多选,避免选择对象太多,导致长时间调用WCF服务


                        lookup.SelectedClick += (obj, ev) =>
                        {
                            ObservableCollection<SMT.Saas.Tools.PersonalRecordWS.T_PF_PERSONALRECORD> entPersonalRecordList = new ObservableCollection<SMT.Saas.Tools.PersonalRecordWS.T_PF_PERSONALRECORD>();

                            if (lookup.SelectedObj != null)
                            {
                                ShowProgressBars();
                                string strDBName = GetValueFromXMLObjectSource("Name", strXmlObjectSource);
                                string strFormName = AuditCtrl.AuditEntity.ModelCode;
                                string strModelId = AuditCtrl.AuditEntity.FormID;

                                foreach (OrganizationControl.ExtOrgObj item in lookup.SelectedObj)
                                {
                                    SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE entEmployee = item.ObjectInstance as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE;
                                    if (entEmployee != null)
                                    {
                                        // 转发
                                        if (strOwnerID == entEmployee.EMPLOYEEID)
                                        {
                                            HideProgressBars();
                                            strExceptionMsg = "不能选择单据所属人";

                                            ComfirmWindow.ConfirmationBox("转发异常:" + Utility.GetResourceStr("ERROR"), strExceptionMsg, Utility.GetResourceStr("CONFIRMBUTTON"));
                                            return;
                                        }
                                        SMT.Saas.Tools.PersonalRecordWS.T_PF_PERSONALRECORD entPersonalRecord = new Saas.Tools.PersonalRecordWS.T_PF_PERSONALRECORD();
                                        entPersonalRecord.PERSONALRECORDID = System.Guid.NewGuid().ToString().ToUpper();
                                        entPersonalRecord.SYSTYPE = strDBName;
                                        entPersonalRecord.MODELCODE = strFormName;
                                        entPersonalRecord.MODELID = strModelId;
                                        entPersonalRecord.CHECKSTATE = "2";
                                        entPersonalRecord.OWNERID = entEmployee.EMPLOYEEID;
                                        entPersonalRecord.OWNERPOSTID = entEmployee.OWNERPOSTID;
                                        entPersonalRecord.OWNERDEPARTMENTID = entEmployee.OWNERDEPARTMENTID;
                                        entPersonalRecord.OWNERCOMPANYID = entEmployee.OWNERCOMPANYID;
                                        entPersonalRecord.CREATEDATE = DateTime.Now;
                                        entPersonalRecord.UPDATEDATE = DateTime.Now;
                                        entPersonalRecord.CONFIGINFO = SetSubmitXmlObj(strDBName, strFormName, strModelId, "VIEW");
                                        entPersonalRecord.MODELDESCRIPTION = string.Format("{0}于{1}向您转发了一张{2}单{3},请查阅!", SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeName, entPersonalRecord.CREATEDATE.Value.ToString("yyyy年MM月dd日HH:mm:ss"), entPersonalRecord.MODELCODE, strAppInfo);
                                        entPersonalRecord.ISFORWARD = "1";
                                        entPersonalRecord.ISVIEW = "0";

                                        // 转发 start 
                                        entPersonalRecord.FromOwnerID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
                                        entPersonalRecord.FromOwnerName = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeName;

                                        var userInfo = item;

                                        SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj post = (SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj)userInfo.ParentObject;
                                        SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj dept = (SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj)post.ParentObject;
                                        SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY corp = (dept.ObjectInstance as SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT).T_HR_COMPANY;
                                        string postName = post.ObjectName;//岗位
                                        string deptName = dept.ObjectName;//部门
                                        string corpName = corp.CNAME;//公司
                                        string StrEmployee = userInfo.ObjectName + "-" + post.ObjectName + "-" + dept.ObjectName + "-" + corp.CNAME;
                                        entPersonalRecord.ToOwnerName = StrEmployee;
                                        // 转发 end 

                                        entPersonalRecordList.Add(entPersonalRecord);
                                    }
                                }
                            }

                            if (entPersonalRecordList.Count() > 0)
                            {
                                SMT.Saas.Tools.PersonalRecordWS.PersonalRecordServiceClient clinetPersonalRecord = new Saas.Tools.PersonalRecordWS.PersonalRecordServiceClient();
                                clinetPersonalRecord.AddPersonalRecordsAsync(entPersonalRecordList);
                                clinetPersonalRecord.AddPersonalRecordsCompleted += (o, pe) =>
                                {
                                    if (pe.Error == null)
                                    {
                                        HideProgressBars();
                                        ComfirmWindow.ConfirmationBox("转发成功:", "单据转发成功!", Utility.GetResourceStr("CONFIRMBUTTON"));
                                        BindAudit(); 
                                    }
                                    else
                                    {
                                        ComfirmWindow.ConfirmationBox("转发异常:", Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("CONFIRMBUTTON"));
                                    }
                                };
                            }
                        };

                        lookup.Show<string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { });
                    }
                };
            }
        }