示例#1
0
        //void ctrFile_Event_AllFilesFinished(object sender, SMT.SaaS.FrameworkUI.FileUpload.FileCountEventArgs e)
        //{
        //    RefreshUI(RefreshedTypes.HideProgressBar);
        //}
        #endregion

        #region InitData
        private void InitData()
        {
            if (actions == FormTypes.New)
            {
                ContractViewObj            = new T_OA_CONTRACTVIEW();
                ContractViewObj.CHECKSTATE = ((int)CheckStates.UnSubmit).ToString();
                client.GetEmployeeDetailByIDAsync(Common.CurrentLoginUserInfo.EmployeeID);//获取当期用户信息
                this.txtFile.Visibility         = Visibility.Collapsed;
                this.ContractText.Visibility    = Visibility.Collapsed;
                this.txtContractText.Visibility = Visibility.Collapsed;
            }
            else
            {
                if (actions == FormTypes.Audit)
                {
                    actionFlag = DataActionFlag.SubmitComplete;
                }
                cmsfc.GetContractViewByIdAsync(contractViewID);
            }
            if (actions == FormTypes.Audit || actions == FormTypes.Edit)
            {
                this.txtContractText.Visibility = Visibility.Collapsed;
                this.txtFile.Visibility         = Visibility.Collapsed;
                this.ContractText.Visibility    = Visibility.Collapsed;
                //this.ctrFile.Visibility = Visibility.Collapsed;
            }
            if (actions == FormTypes.Browse)
            {
                this.txtContractText.Visibility = Visibility.Collapsed;
                this.ContractText.Visibility    = Visibility.Collapsed;
                this.txtTELL.IsReadOnly         = true;
            }
        }
        //void ctrFile_Event_AllFilesFinished(object sender, SMT.SaaS.FrameworkUI.FileUpload.FileCountEventArgs e)
        //{
        //    RefreshUI(RefreshedTypes.HideProgressBar);
        //}
        #endregion

        #region InitData
        private void InitData()
        {
            if (actions == FormTypes.New)
            {
                ContractViewObj = new T_OA_CONTRACTVIEW();
                ContractViewObj.CHECKSTATE = ((int)CheckStates.UnSubmit).ToString();
                client.GetEmployeeDetailByIDAsync(Common.CurrentLoginUserInfo.EmployeeID);//获取当期用户信息
                this.txtFile.Visibility = Visibility.Collapsed;
                this.ContractText.Visibility = Visibility.Collapsed;
                this.txtContractText.Visibility = Visibility.Collapsed;
            }
            else
            {
                if (actions == FormTypes.Audit)
                {
                    actionFlag = DataActionFlag.SubmitComplete;
                }
                cmsfc.GetContractViewByIdAsync(contractViewID);
            }
            if (actions == FormTypes.Audit || actions == FormTypes.Edit)
            {
                this.txtContractText.Visibility = Visibility.Collapsed;
                this.txtFile.Visibility = Visibility.Collapsed;
                this.ContractText.Visibility = Visibility.Collapsed;
                //this.ctrFile.Visibility = Visibility.Collapsed;
            }
            if (actions == FormTypes.Browse)
            {
                this.txtContractText.Visibility = Visibility.Collapsed;
                this.ContractText.Visibility = Visibility.Collapsed;
                this.txtTELL.IsReadOnly = true;
            }
        }
 public T_OA_CONTRACTVIEW GetContractViewById(string contractViewID)
 {
     using (ContractViewapplicationsBLL cvb = new ContractViewapplicationsBLL())
     {
         T_OA_CONTRACTVIEW ContractView = cvb.GetContractViewById(contractViewID);
         return(ContractView == null ? null : ContractView);
     }
 }
 [OperationContract]//(更新合同查看申请)提交审核
 public string UpdateContractView(T_OA_CONTRACTVIEW contractView)
 {
     using (ContractViewapplicationsBLL cvb = new ContractViewapplicationsBLL())
     {
         string result = "";
         if (!cvb.UpdateContractView(contractView))
         {
             result = "更新数据失败!";
         }
         return(result);
     }
 }
        [OperationContract]//添加合同查看申请
        public string ContractViewapplicationsAdd(T_OA_CONTRACTVIEW ContractApplicationView)
        {
            using (ContractViewapplicationsBLL cvb = new ContractViewapplicationsBLL())
            {
                string returnStr = "";

                if (!cvb.ContractViewapplicationsAdd(ContractApplicationView))
                {
                    returnStr = "添加数据失败";
                }
                return(returnStr);
            }
        }
示例#6
0
        void cmsfc_GetContractViewByIdCompleted(object sender, GetContractViewByIdCompletedEventArgs e)//根据查看ID查询
        {
            try
            {
                if (e.Error == null)
                {
                    if (e.Result != null)
                    {
                        ContractViewObj = e.Result;        //合同查看申请视图
                        if (actions == FormTypes.Resubmit) //重新提交
                        {
                            ContractViewObj.CHECKSTATE = (Convert.ToInt32(CheckStates.UnSubmit)).ToString();
                        }
                        cprinting = ContractViewObj.T_OA_CONTRACTPRINT;                                           //打印视图
                        ctapp     = ContractViewObj.T_OA_CONTRACTPRINT.T_OA_CONTRACTAPP;
                        ContractID.SelectedText   = ctapp.CONTRACTCODE;                                           //合同编号
                        ContractTitle.Text        = ctapp.CONTRACTTITLE;                                          //标题
                        this.txtCompanyId.Text    = Utility.GetCompanyName(ContractViewObj.OWNERCOMPANYID);       //所属公司ID
                        this.txtDepartmentId.Text = Utility.GetDepartmentName(ContractViewObj.OWNERDEPARTMENTID); //所属部门ID

                        txtTELL.Text       = ContractViewObj.TEL;
                        txtCreateUser.Text = ContractViewObj.OWNERNAME;
                        //if (actions == FormTypes.Audit)
                        //{
                        //    audit.XmlObject = DataObjectToXml<T_OA_CONTRACTVIEW>.ObjListToXml(ContractViewObj, "OA");
                        //}
                        //InitAudit();//审批
                        RefreshUI(RefreshedTypes.AuditInfo);
                        RefreshUI(RefreshedTypes.All);
                        //ctrFile.Load_fileData(cprinting.CONTRACTPRINTID);
                    }
                }
                else
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), e.Error.Message);
                }
            }
            catch (Exception ex)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), ex.ToString());
            }
        }
示例#7
0
        /// <summary>
        /// 根据传回的XML,添加合同查看申请信息
        /// </summary>
        /// <param name="xele"></param>
        private static string ContractViewapplicationsAdd(IEnumerable<XElement> eGFunc)
        {
            try
            {
                if (eGFunc.Count() == 0)
                {
                    return "";
                }
                string strEmployeeID = string.Empty;
                string strOwnerID = string.Empty;
                string strOwnerPostID = string.Empty;
                string strOwnerDepartmentID = string.Empty;
                string strOwnerCompanyID = string.Empty;

                foreach (var q in eGFunc)
                {
                    string strName = q.Attribute("Name").Value;
                    switch (strName)
                    {
                        case "CREATEUSERID":
                            strEmployeeID = q.Attribute("Value").Value;
                            break;
                        case "OWNERID":
                            strOwnerID = q.Attribute("Value").Value;
                            break;
                        case "OWNERPOSTID":
                            strOwnerPostID = q.Attribute("Value").Value;
                            break;
                        case "OWNERDEPARTMENTID":
                            strOwnerDepartmentID = q.Attribute("Value").Value;
                            break;
                        case "OWNERCOMPANYID":
                            strOwnerCompanyID = q.Attribute("Value").Value;
                            break;
                    }
                }
                SmtOADocumentAdmin doc = new SmtOADocumentAdmin();

                string employeeid = strEmployeeID.Replace("{", "").Replace("}", "");

                T_OA_CONTRACTVIEW entity = new T_OA_CONTRACTVIEW();
                entity.CONTRACTVIEWID = Guid.NewGuid().ToString();

                entity.CREATEDATE = DateTime.Now;
                entity.OWNERID = strOwnerID;
                entity.OWNERPOSTID = strOwnerPostID;
                entity.OWNERDEPARTMENTID = strOwnerDepartmentID;
                entity.OWNERCOMPANYID = strOwnerCompanyID;
                entity.CREATEUSERID = strOwnerID;
                entity.CREATEPOSTID = strOwnerPostID;
                entity.CREATEDEPARTMENTID = strOwnerDepartmentID;
                entity.CREATECOMPANYID = strOwnerCompanyID;
                doc.ContractViewapplicationsAdd(entity);
                return entity.CONTRACTVIEWID;
            }
            catch (Exception e)
            {
                string abc = "<OA>Message=[" + e.Message + "]" + "<OA>Source=[" + e.Source + "]<OA>StackTrace=[" + e.StackTrace + "]<OA>TargetSite=[" + e.TargetSite + "]";
                Tracer.Debug(abc);
                return abc;
            }
        }
        private void Save()
        {
            try
            {

                RefreshUI(RefreshedTypes.ShowProgressBar);//点击保存后显示进度条

                if (string.IsNullOrEmpty(this.ContractTitle.Text))
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("PLEASECHOOSETOVIEWTHECONTRACT"));
                    RefreshUI(RefreshedTypes.HideProgressBar);//点击保存后显示进度条
                    return;
                }

                if (string.IsNullOrEmpty(txtTELL.Text))
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STRINGNOTNULL", "TELL"));
                    RefreshUI(RefreshedTypes.HideProgressBar);//点击保存后显示进度条
                    txtTELL.Focus();
                    return;
                }

                //ctrFile.FormID = cprinting.CONTRACTPRINTID;//附件
                //ctrFile.Save();
                if (actions == FormTypes.New)
                {
                    contractViewObj = new T_OA_CONTRACTVIEW();
                    if (employeepost != null)
                    {
                        contractViewObj.OWNERPOSTID = employeepost.EMPLOYEEPOSTS[0].T_HR_POST.POSTID;//岗位ID
                        contractViewObj.OWNERCOMPANYID = employeepost.EMPLOYEEPOSTS[0].T_HR_POST.T_HR_DEPARTMENT.T_HR_COMPANY.COMPANYID;//公司ID
                        contractViewObj.OWNERDEPARTMENTID = employeepost.EMPLOYEEPOSTS[0].T_HR_POST.T_HR_DEPARTMENT.DEPARTMENTID;//部门ID
                        contractViewObj.OWNERID = employeepost.EMPLOYEEPOSTS[0].T_HR_EMPLOYEE.EMPLOYEEID;//员工ID
                        contractViewObj.OWNERNAME = employeepost.EMPLOYEEPOSTS[0].T_HR_EMPLOYEE.EMPLOYEECNAME; //员工姓名
                    }
                    contractViewObj.CONTRACTVIEWID = System.Guid.NewGuid().ToString();
                    contractViewObj.T_OA_CONTRACTPRINT = cprinting;      //打印实体
                    contractViewObj.TEL = txtTELL.Text;//联系电话
                    contractViewObj.CHECKSTATE = Utility.GetCheckState(CheckStates.UnSubmit);//未提交
                    contractViewObj.CREATEUSERID = Common.CurrentLoginUserInfo.EmployeeID;//创建人
                    contractViewObj.CREATEUSERNAME = Common.CurrentLoginUserInfo.EmployeeName;//创建人姓名
                    contractViewObj.OWNERID = Common.CurrentLoginUserInfo.EmployeeID;//所属用户ID
                    contractViewObj.OWNERNAME = Common.CurrentLoginUserInfo.EmployeeName;//所属用户名
                    contractViewObj.OWNERCOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;//所属公司ID
                    contractViewObj.OWNERDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;//所属部门ID
                    contractViewObj.OWNERPOSTID = Common.CurrentLoginUserInfo.UserPosts[0].PostID;//所属岗位ID
                    contractViewObj.CREATECOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;//创建公司ID
                    contractViewObj.CREATEDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;//创建部门ID
                    contractViewObj.CREATEPOSTID = Common.CurrentLoginUserInfo.UserPosts[0].PostID;//创建岗位ID

                    cmsfc.ContractViewapplicationsAddAsync(contractViewObj);
                }
                else if (actions == FormTypes.Edit)
                {
                    contractViewObj.T_OA_CONTRACTPRINT = cprinting;      //打印实体
                    contractViewObj.TEL = txtTELL.Text;//联系电话
                    contractViewObj.CHECKSTATE = Utility.GetCheckState(CheckStates.UnSubmit);//未提交

                    cmsfc.UpdateContractViewAsync(contractViewObj, "Edit");
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.SendException("保存合同查看申请Save事件", "OA", "T_OA_CONTRACTVIEW", "保存合同查看申请时返回错误", ex, ExceptionLevel.Middle, ExceptionType.Error);
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("ERRORINFO"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
            }
        }
        void cmsfc_GetContractViewByIdCompleted(object sender, GetContractViewByIdCompletedEventArgs e)//根据查看ID查询
        {
            try
            {
                if (e.Error == null)
                {
                    if (e.Result != null)
                    {
                        ContractViewObj = e.Result;//合同查看申请视图
                        if (actions == FormTypes.Resubmit)//重新提交
                        {
                            ContractViewObj.CHECKSTATE = (Convert.ToInt32(CheckStates.UnSubmit)).ToString();
                        }
                        cprinting = ContractViewObj.T_OA_CONTRACTPRINT;//打印视图
                        ctapp = ContractViewObj.T_OA_CONTRACTPRINT.T_OA_CONTRACTAPP;
                        ContractID.SelectedText = ctapp.CONTRACTCODE;//合同编号
                        ContractTitle.Text = ctapp.CONTRACTTITLE;//标题 
                        this.txtCompanyId.Text = Utility.GetCompanyName(ContractViewObj.OWNERCOMPANYID);//所属公司ID
                        this.txtDepartmentId.Text = Utility.GetDepartmentName(ContractViewObj.OWNERDEPARTMENTID);//所属部门ID

                        txtTELL.Text = ContractViewObj.TEL;
                        txtCreateUser.Text = ContractViewObj.OWNERNAME;
                        //if (actions == FormTypes.Audit)
                        //{
                        //    audit.XmlObject = DataObjectToXml<T_OA_CONTRACTVIEW>.ObjListToXml(ContractViewObj, "OA");
                        //}
                        //InitAudit();//审批
                        RefreshUI(RefreshedTypes.AuditInfo);
                        RefreshUI(RefreshedTypes.All);
                        //ctrFile.Load_fileData(cprinting.CONTRACTPRINTID);
                    }
                }
                else
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), e.Error.Message);
                }
            }
            catch (Exception ex)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), ex.ToString());
            }
        }
示例#10
0
 [OperationContract]//(更新合同查看申请)提交审核
 public string UpdateContractView(T_OA_CONTRACTVIEW contractView)
 {
     using (ContractViewapplicationsBLL cvb = new ContractViewapplicationsBLL())
     {
         string result = "";
         if (!cvb.UpdateContractView(contractView))
         {
             result = "更新数据失败!";
         }
         return result;
     }
 }
示例#11
0
        [OperationContract]//添加合同查看申请
        public string ContractViewapplicationsAdd(T_OA_CONTRACTVIEW ContractApplicationView)
        {
            using (ContractViewapplicationsBLL cvb = new ContractViewapplicationsBLL())
            {
                string returnStr = "";

                if (!cvb.ContractViewapplicationsAdd(ContractApplicationView))
                {
                    returnStr = "添加数据失败";
                }
                return returnStr;
            }
        }
示例#12
0
        private void Save()
        {
            try
            {
                RefreshUI(RefreshedTypes.ShowProgressBar);//点击保存后显示进度条

                if (string.IsNullOrEmpty(this.ContractTitle.Text))
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("PLEASECHOOSETOVIEWTHECONTRACT"));
                    RefreshUI(RefreshedTypes.HideProgressBar);//点击保存后显示进度条
                    return;
                }

                if (string.IsNullOrEmpty(txtTELL.Text))
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STRINGNOTNULL", "TELL"));
                    RefreshUI(RefreshedTypes.HideProgressBar);//点击保存后显示进度条
                    txtTELL.Focus();
                    return;
                }

                //ctrFile.FormID = cprinting.CONTRACTPRINTID;//附件
                //ctrFile.Save();
                if (actions == FormTypes.New)
                {
                    contractViewObj = new T_OA_CONTRACTVIEW();
                    if (employeepost != null)
                    {
                        contractViewObj.OWNERPOSTID       = employeepost.EMPLOYEEPOSTS[0].T_HR_POST.POSTID;                                 //岗位ID
                        contractViewObj.OWNERCOMPANYID    = employeepost.EMPLOYEEPOSTS[0].T_HR_POST.T_HR_DEPARTMENT.T_HR_COMPANY.COMPANYID; //公司ID
                        contractViewObj.OWNERDEPARTMENTID = employeepost.EMPLOYEEPOSTS[0].T_HR_POST.T_HR_DEPARTMENT.DEPARTMENTID;           //部门ID
                        contractViewObj.OWNERID           = employeepost.EMPLOYEEPOSTS[0].T_HR_EMPLOYEE.EMPLOYEEID;                         //员工ID
                        contractViewObj.OWNERNAME         = employeepost.EMPLOYEEPOSTS[0].T_HR_EMPLOYEE.EMPLOYEECNAME;                      //员工姓名
                    }
                    contractViewObj.CONTRACTVIEWID     = System.Guid.NewGuid().ToString();
                    contractViewObj.T_OA_CONTRACTPRINT = cprinting;                                             //打印实体
                    contractViewObj.TEL                = txtTELL.Text;                                          //联系电话
                    contractViewObj.CHECKSTATE         = Utility.GetCheckState(CheckStates.UnSubmit);           //未提交
                    contractViewObj.CREATEUSERID       = Common.CurrentLoginUserInfo.EmployeeID;                //创建人
                    contractViewObj.CREATEUSERNAME     = Common.CurrentLoginUserInfo.EmployeeName;              //创建人姓名
                    contractViewObj.OWNERID            = Common.CurrentLoginUserInfo.EmployeeID;                //所属用户ID
                    contractViewObj.OWNERNAME          = Common.CurrentLoginUserInfo.EmployeeName;              //所属用户名
                    contractViewObj.OWNERCOMPANYID     = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;    //所属公司ID
                    contractViewObj.OWNERDEPARTMENTID  = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID; //所属部门ID
                    contractViewObj.OWNERPOSTID        = Common.CurrentLoginUserInfo.UserPosts[0].PostID;       //所属岗位ID
                    contractViewObj.CREATECOMPANYID    = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;    //创建公司ID
                    contractViewObj.CREATEDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID; //创建部门ID
                    contractViewObj.CREATEPOSTID       = Common.CurrentLoginUserInfo.UserPosts[0].PostID;       //创建岗位ID

                    cmsfc.ContractViewapplicationsAddAsync(contractViewObj);
                }
                else if (actions == FormTypes.Edit)
                {
                    contractViewObj.T_OA_CONTRACTPRINT = cprinting;                           //打印实体
                    contractViewObj.TEL        = txtTELL.Text;                                //联系电话
                    contractViewObj.CHECKSTATE = Utility.GetCheckState(CheckStates.UnSubmit); //未提交

                    cmsfc.UpdateContractViewAsync(contractViewObj, "Edit");
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.SendException("保存合同查看申请Save事件", "OA", "T_OA_CONTRACTVIEW", "保存合同查看申请时返回错误", ex, ExceptionLevel.Middle, ExceptionType.Error);
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("ERRORINFO"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
            }
        }