Ejemplo n.º 1
0
    protected override void SaveFormData()
    {
        try
        {
            var info = BizContext.OA_ITSupport_Form.FirstOrDefault(x => x.FormID == FormId);
            if (info == null)
            {
                info = new OA_ITSupport_Form()
                {
                    FormID      = FormId,
                    CompanyName = tbCompany.Text,
                    Email       = tbEmail.Text,
                    DateTime    = DateTime.Now,
                    DeptCode    = _BPMContext.CurrentPWordUser.DepartCode,
                    DeptName    = _BPMContext.CurrentPWordUser.DepartName,
                    Mobile      = tbPhone.Text,
                    UserName    = _BPMContext.CurrentPWordUser.EmployeeName
                };
                BizContext.OA_ITSupport_Form.InsertOnSubmit(info);
            }

            info.STypeId    = int.Parse(ddlTypes.SelectedValue);
            info.QuestionId = int.Parse(ddlQuestions.SelectedValue);
            info.ContentTxt = tbContent.Text;
            info.Title      = GetFormTitle();


            BizContext.SubmitChanges();
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Ejemplo n.º 2
0
    /// <summary>
    /// 使用linq保存表单数据【根据formid判断来存储】
    /// </summary>
    protected override void SaveFormData()
    {
        var info = BizContext.ERP_ContractFinalAccount.FirstOrDefault(x => x.FormID == FormId);

        if (info == null)
        {
            info = new ERP_ContractFinalAccount()
            {
                FormID           = FormId,
                CreateTime       = DateTime.Now.ToString(),
                StartDeptId      = ddlDepartName.SelectedItem.Value,
                ErpFormId        = Request["erpFormId"],
                RelationContract = Request["erpPoId"],
                ErpFormType      = "POJS",
                ApproveResult    = "",
                ERPFormTitle     = Request["FormTitle"],
                ERPApproveLev    = int.Parse(Request["erpApproveLev"])
            };
            BizContext.ERP_ContractFinalAccount.InsertOnSubmit(info);
        }
        else
        {
            info.StartDeptId = ddlDepartName.SelectedItem.Value;
        }
        BizContext.SubmitChanges();
    }
Ejemplo n.º 3
0
    /// <summary>
    /// 保存数据
    /// </summary>
    protected override void SaveFormData()
    {
        var info = BizContext.OA_InstructionOfWY.FirstOrDefault(x => x.FormID == FormId);

        if (info == null)
        {
            info = new OA_InstructionOfWY()
            {
                FormID          = FormId,
                DeptCode        = ddlDepartName.SelectedItem.Value.ToString(),
                DeptName        = ddlDepartName.SelectedItem.Text,
                UserName        = tbMobile.Text,
                DateTime        = tbDateTime.Text,
                Mobile          = tbMobile.Text,
                IsReportToWY    = cblIsReportToWY.SelectedIndex.ToString(),
                IsReportToGroup = cblIsReportToGroup.SelectedIndex.ToString(),
                Title           = tbTitle.Text,
                Content         = tbContent.Text,
                SecurityLevel   = cblSecurityLevel.SelectedIndex.ToString(),
                UrgenLevel      = cblUrgenLevel.SelectedIndex.ToString(),
                RelatedFormID   = string.Empty,

                LeadersSelected = SaveLeadersSelected(),
            };
            BizContext.OA_InstructionOfWY.InsertOnSubmit(info);
        }
        BizContext.SubmitChanges();
    }
Ejemplo n.º 4
0
    protected void SaveFormData()
    {
        if (K2_TaskItem.ActivityInstanceDestination.Name == "员工意见")
        {
            var info = BizContext.HR_EmployeeRegular.FirstOrDefault(x => x.FormID == FormId);

            if (info != null)
            {
                info.Post        = tbPost.Text;
                info.Achievement = tbAchievement.Text;
                info.Sign        = tbSign.Text;
                info.SignDate    = tbSignDate.Value;
            }
            BizContext.SubmitChanges();
        }

        if (K2_TaskItem.ActivityInstanceDestination.Name == "用人部门意见")
        {
            var info = BizContext.HR_EmployeeRegular.FirstOrDefault(x => x.FormID == FormId);

            if (info != null)
            {
                info.WorkCompletion   = ddlWorkCompletion.SelectedValue;
                info.Advantage        = tbAdvantage.Text;
                info.Disadvantage     = tbDisadvantage.Text;
                info.Suggest          = tbSuggest.Text;
                info.QualityScore     = tbQualityScore.Text;
                info.AchievementScore = tbAchievementScore.Text;
                info.TatolScore       = SumScore();
                info.IsAgreeRegular   = ddlIsAgreeRegular.SelectedValue;
            }
            BizContext.SubmitChanges();
        }
    }
Ejemplo n.º 5
0
    /// <summary>
    /// 流程成功启动后操作
    /// </summary>
    protected override bool AfterWorkflowStart(int wfInstanceId)
    {
        string stepId = Guid.NewGuid().ToString();

        BizContext.OA_ITSupport_Step.InsertOnSubmit(new OA_ITSupport_Step()
        {
            Id             = stepId,
            FormID         = FormId,
            InstanceId     = _BPMContext.ProcID,
            StartTime      = DateTime.Now,
            StartType      = (int)ITSupportStatus.待领取,
            OrderId        = 1,
            ProcessGroupId = BizContext.V_ITSupport_Catalog.FirstOrDefault(x => x.Id.ToString() == ddlTypes.SelectedValue).GroupId.Value.ToString()
        });
        foreach (var item in ITSupportCommon.GetUserListByType(ddlTypes.SelectedValue))
        {
            BizContext.OA_ITSupport_Step_Users.InsertOnSubmit(new OA_ITSupport_Step_Users()
            {
                StepId    = stepId,
                UserCode  = item.EmployeeCode,
                LoginName = item.LoginName
            });
            NotifyToUser(item.LoginName);
        }
        var formInfo = BizContext.OA_ITSupport_Form.FirstOrDefault(x => x.FormID == FormId);

        if (formInfo != null)
        {
            formInfo.CurrentStepId  = stepId;
            formInfo.ProcessGroupId = BizContext.V_ITSupport_Catalog.FirstOrDefault(x => x.Id.ToString() == ddlTypes.SelectedValue).GroupId.Value.ToString();
        }

        BizContext.SubmitChanges();
        return(true);
    }
Ejemplo n.º 6
0
    private void SaveData()
    {
        var info = BizContext.HR_EmployeeLeft.FirstOrDefault(x => x.FormID == FormId);

        info.Handover  = tbHandover.Text;
        info.Recipient = tbRecipient.Text;

        BizContext.SubmitChanges();
    }
Ejemplo n.º 7
0
    protected void SaveFormData()
    {
        var info = BizContext.HR_EmployeeTransfer.FirstOrDefault(x => x.FormID == FormId);

        if (info != null)
        {
            info.TransferReason = cblTransferReason.SelectedValue;
        }
        BizContext.SubmitChanges();
    }
Ejemplo n.º 8
0
    protected override bool AfterWorkflowApproval(string action, string option, bool isSuccess)
    {
        if (isSuccess)
        {
            ///对于加签
            if (action == "提交")
            {
                return(true);
            }

            ///更新当前步骤审批人处理记录
            var currentStep = SysContext.WF_Custom_InstanceItems.FirstOrDefault(x => x.StepID == CurrentStep);
            List <CustomWorkflowUserInfo> userinfos = currentStep.PartUsers.ToUserList();
            var currentParter = userinfos.FirstOrDefault(x => x.UserInfo.LoginName == _BPMContext.CurrentUser.LoginId);
            if (currentParter != null)
            {
                currentParter.IsApproval = true;
                currentStep.PartUsers    = userinfos.ToXml();
                SysContext.SubmitChanges();
            }

            if (userinfos.Count(x => !x.IsApproval) == 0)
            {
                //本步骤所有人已经执行审批

                ///更新当前自定义实例步骤
                if (action == "同意")
                {
                    var list       = CustomWorkflowDataProcess.GetWorkItemsData(_BPMContext.ProcID, FormId);
                    var nextInfo   = list.Where(x => x.StepID > CurrentStep && !string.IsNullOrEmpty(x.PartUsers)).OrderBy(x => x.OrderId).FirstOrDefault();
                    var updateInfo = BizContext.OA_CustomWorkFlowInstance.FirstOrDefault(x => x.FormID == FormId);
                    if (nextInfo != null)
                    {
                        updateInfo.CurrentStepId = nextInfo.StepID;
                    }
                    else
                    {
                        updateInfo.CurrentStepId = -1;//没有后续节点,流程结束
                    }
                    BizContext.SubmitChanges();
                }
                else
                {
                    var updateInfo = BizContext.OA_CustomWorkFlowInstance.FirstOrDefault(x => x.FormID == FormId);

                    updateInfo.CurrentStepId = -1;//不同意,流程结束

                    BizContext.SubmitChanges();
                }
            }
        }


        return(true);
    }
Ejemplo n.º 9
0
    /// <summary>
    /// 使用linq保存表单数据【根据formid判断来存储】
    /// </summary>
    protected override void SaveFormData()
    {
        var info = BizContext.OA_ContractOfWY.FirstOrDefault(x => x.FormID == FormId);

        if (info == null)
        {
            info = new OA_ContractOfWY()
            {
                FormID        = FormId,
                SecurityLevel = cblSecurityLevel.SelectedIndex.ToString(),
                UrgenLevel    = cblUrgenLevel.SelectedIndex.ToString(),

                DeptCode = ddlDepartName.SelectedItem.Value.ToString(),
                DeptName = ddlDepartName.SelectedItem.Text,
                DateTime = DateTime.Now.ToString(),
                UserName = tbUserName.Text,
                Mobile   = tbMobile.Text,

                IsReportToWY    = cblIsReportToWY.SelectedIndex.ToString(),
                IsReportToGroup = cblIsReportToGroup.SelectedIndex.ToString(),
                //新添加的存储数据
                //合同类型
                ContractType1 = ddlContractType1.SelectedItem.Value,
                ContractType2 = ddlContractType2.SelectedItem != null ? ddlContractType2.SelectedItem.Value : "",
                ContractType3 = ddlContractType3.SelectedItem != null ? ddlContractType3.SelectedItem.Value : "",

                ContractTypeName1 = ddlContractType1.SelectedItem.Text,
                ContractTypeName2 = ddlContractType2.SelectedItem != null ? ddlContractType2.SelectedItem.Text : "",
                ContractTypeName3 = ddlContractType3.SelectedItem != null ? ddlContractType3.SelectedItem.Text : "",

                ContractSum = tbContractSum.Text,

                IsSupplementProtocol     = cblIsSupplementProtocol.SelectedValue.ToString(),
                IsSupplementProtocolText = tbSupplementProtocol.Text,
                IsFormatContract         = cblIsFormatContract.SelectedValue.ToString(),
                IsNormText = cblIsNormText.SelectedValue.ToString(),
                IsBidding  = cblIsBidding.SelectedValue.ToString(),
                //合同主体
                ContractSubject      = ddlContractSubject.SelectedItem.Value,
                ContractSubjectName  = ddlContractSubject.SelectedItem.Text,
                ContractSubjectName2 = tbContractSubject1.Text,
                ContractSubjectName3 = tbContractSubject2.Text,
                ContractSubjectName4 = tbContractSubject3.Text,

                ContractTitle   = tbContractTitle.Text,
                ContractContent = tbContractContent.Text,
                LeadersSelected = SaveLeadersSelected(),
                RelatedFormID   = string.Empty,
            };
            BizContext.OA_ContractOfWY.InsertOnSubmit(info);
        }
        BizContext.SubmitChanges();
    }
Ejemplo n.º 10
0
    protected override void SaveFormData()
    {
        var info = BizContext.HR_EmployeeNeed.FirstOrDefault(x => x.FormID == FormId);

        if (info == null)
        {
            info = new HR_EmployeeNeed()
            {
                FormID              = FormId,
                DateTime            = UpdatedTextBox.Value,
                DeptName            = ddlDeptName.SelectedItem.Text,
                DeptCode            = ddlDeptName.SelectedItem.Value.ToString(),
                Position            = tbPosition.Text,
                Number              = tbNumber.Text,
                Reason              = ddlReason.SelectedItem.Text,
                MajorDuty           = tbMajorDuty.Text,
                Sex                 = ddlSex.SelectedItem.Text,
                Age                 = ddlAge.SelectedItem.Text,
                Education           = ddlEducation.SelectedItem.Text,
                Specialty           = ddlSpecialty.SelectedItem.Text,
                Title               = ddlTitle.SelectedItem.Text,
                WorkingLifetime     = ddlWorkingLifetime.SelectedItem.Text,
                WorkTime            = tbWorkTime.Value,
                ProfessionalAbility = tbProfessionalAbility.Text,
                IsGroup             = hfIsGroup.Value
            };
            BizContext.HR_EmployeeNeed.InsertOnSubmit(info);
        }
        else
        {
            info.DateTime            = UpdatedTextBox.Value;
            info.DeptName            = ddlDeptName.SelectedItem.Text;
            info.DeptCode            = ddlDeptName.SelectedItem.Value.ToString();
            info.Position            = tbPosition.Text;
            info.Number              = tbNumber.Text;
            info.Reason              = ddlReason.SelectedItem.Text;
            info.MajorDuty           = tbMajorDuty.Text;
            info.Sex                 = ddlSex.SelectedItem.Text;
            info.Age                 = ddlAge.SelectedItem.Text;
            info.Education           = ddlEducation.SelectedItem.Text;
            info.Specialty           = ddlSpecialty.SelectedItem.Text;
            info.Title               = ddlTitle.SelectedItem.Text;
            info.WorkingLifetime     = ddlWorkingLifetime.SelectedItem.Text;
            info.WorkTime            = tbWorkTime.Value;
            info.ProfessionalAbility = tbProfessionalAbility.Text;
        }
        BizContext.SubmitChanges();
    }
Ejemplo n.º 11
0
    protected override void SaveFormData()
    {
        var info = BizContext.HR_SalaryAdjust.FirstOrDefault(x => x.FormID == FormId);

        if (info == null)
        {
            info = new HR_SalaryAdjust()
            {
                FormID          = FormId,
                AnnualSalary    = tbAnnualSalary.Text,
                DeptName        = tbDeptName.Text,
                EffectiveDate   = tbEffectiveDate.Value,
                Post            = tbPost.Text,
                Ratio           = tbRatio.Text,
                Reason          = tbReason.Text,
                Salary          = tbSalary.Text,
                ToAnnualSalary  = tbToAnnualSalary.Text,
                ToDeptName      = tbToDeptName.Text,
                ToPost          = tbToPost.Text,
                ToRatio         = tbToRatio.Text,
                ToSalary        = tbToSalary.Text,
                UserName        = tbUserName.Text,
                WorkPlace       = tbWorkPlace.Text,
                LeadersSelected = SaveApproveList(),
                IsGroup         = hfIsGroup.Value
            };
            BizContext.HR_SalaryAdjust.InsertOnSubmit(info);
        }
        else
        {
            info.AnnualSalary    = tbAnnualSalary.Text;
            info.DeptName        = tbDeptName.Text;
            info.EffectiveDate   = tbEffectiveDate.Value;
            info.Post            = tbPost.Text;
            info.Ratio           = tbRatio.Text;
            info.Reason          = tbReason.Text;
            info.Salary          = tbSalary.Text;
            info.ToAnnualSalary  = tbToAnnualSalary.Text;
            info.ToDeptName      = tbToDeptName.Text;
            info.ToPost          = tbToPost.Text;
            info.ToRatio         = tbToRatio.Text;
            info.ToSalary        = tbToSalary.Text;
            info.UserName        = tbUserName.Text;
            info.WorkPlace       = tbWorkPlace.Text;
            info.LeadersSelected = SaveApproveList();
        }
        BizContext.SubmitChanges();
    }
Ejemplo n.º 12
0
    protected override void SaveFormData()
    {
        var info = BizContext.HR_Employment.FirstOrDefault(x => x.FormID == FormId);

        if (info == null)
        {
            info = new HR_Employment()
            {
                FormID               = FormId,
                UserName             = tbUserName.Text,
                DeptName             = tbDeptName.Text,
                DeptCode             = tbDeptCode.Value,
                GoalPost             = tbGoalPost.Text,
                PostLevel            = tbPostLevel.Text,
                Salary               = tbSalary.Text,
                Ratio                = tbRatio.Text,
                AnnualSalary         = tbAnnualSalary.Text,
                IsLabourContract     = cblIsLabourContract.SelectedValue,
                LabourContractStart  = tbLabourContractStart.Value,
                LabourContractEnd    = tbLabourContractEnd.Value,
                IsProbationPeriod    = cblIsProbationPeriod.SelectedValue,
                ProbationPeriodStart = tbProbationPeriodStart.Value,
                ProbationPeriodEnd   = tbProbationPeriodEnd.Value,
                Remark               = tbRemark.Text,
                IsGroup              = hfIsGroup.Value
            };
            BizContext.HR_Employment.InsertOnSubmit(info);
        }
        else
        {
            info.DeptName             = tbDeptName.Text;
            info.GoalPost             = tbGoalPost.Text;
            info.PostLevel            = tbPostLevel.Text;
            info.Salary               = tbSalary.Text;
            info.Ratio                = tbRatio.Text;
            info.AnnualSalary         = tbAnnualSalary.Text;
            info.IsLabourContract     = cblIsLabourContract.SelectedValue;
            info.LabourContractStart  = tbLabourContractStart.Value;
            info.LabourContractEnd    = tbLabourContractEnd.Value;
            info.IsProbationPeriod    = cblIsProbationPeriod.SelectedValue;
            info.ProbationPeriodStart = tbProbationPeriodStart.Value;
            info.ProbationPeriodEnd   = tbProbationPeriodEnd.Value;
            info.Remark               = tbRemark.Text;
            info.IsGroup              = hfIsGroup.Value;
        }
        BizContext.SubmitChanges();
    }
Ejemplo n.º 13
0
    protected override void SaveFormData()
    {
        FormTitle = tbTheme.Text;
        try
        {
            var    info      = BizContext.OA_CustomWorkFlowInstance.FirstOrDefault(x => x.FormID == FormId);
            string TempTitle = "";
            if (!string.IsNullOrEmpty(lbFormTitle.Text))
            {
                TempTitle = lbFormTitle.Text;
            }
            else
            {
                TempTitle = tbTheme.Text;
            }
            if (info == null)
            {
                info = new OA_CustomWorkFlowInstance()
                {
                    FormID        = FormId,
                    Title         = tbTheme.Text,
                    ContentTxt    = tbContent.Text,
                    CurrentStepId = 1,
                    DateTime      = DateTime.Now,
                    DeptCode      = ddlDepartName.SelectedItem.Value,
                    DeptName      = ddlDepartName.SelectedItem.Text,
                    Mobile        = _BPMContext.CurrentPWordUser.MobilePhone,
                    UserName      = _BPMContext.CurrentPWordUser.EmployeeName,
                    SecurityLevel = TempTitle
                };
                BizContext.OA_CustomWorkFlowInstance.InsertOnSubmit(info);
            }
            else
            {
                info.ContentTxt = tbContent.Text;
                info.Title      = tbTheme.Text;
            }

            BizContext.SubmitChanges();
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Ejemplo n.º 14
0
    /// <summary>
    /// 保存数据
    /// </summary>
    private void SaveData()
    {
        var info = BizContext.OA_InstructionOfWY.FirstOrDefault(x => x.FormID == FormId);

        //info.LeadersSelected = lblApprovers.Text;
        info.IsReportToGroup = cblIsReportToGroup.SelectedValue;
        info.IsReportToWY    = cblIsReportToWY.SelectedValue;
        info.LeadersSelected = SaveLeadersSelected();

        WorkFlowInstance workFlowInstance = wf_WorkFlowInstance.GetWorkFlowInstanceByFormId(info.FormID);

        Countersign1.ProcId = workFlowInstance.InstanceId;
        Countersign1.SaveData(true);
        Countersign_Group1.ProcId = workFlowInstance.InstanceId;
        Countersign_Group1.SaveData(true);

        BizContext.SubmitChanges();
    }
Ejemplo n.º 15
0
    protected override void AfterSaveInstance()
    {
        bool isSaveSuccess = SaveWorkItemsData(_BPMContext.ProcID);

        if (!isSaveSuccess)
        {
            Alert("没有步骤数据,请先设置步骤再保存!");
            return;
        }
        List <Pkurg.PWorldBPM.Business.Sys.WF_Custom_InstanceItems> itemInfos = CustomWorkflowDataProcess.GetWorkItemsData(FormId);

        var info = BizContext.OA_CustomWorkFlowInstance.FirstOrDefault(x => x.FormID == FormId);

        if (info != null)
        {
            var firstDept = itemInfos.Where(x => !string.IsNullOrEmpty(x.PartUsers)).OrderBy(x => x.OrderId).FirstOrDefault();
            info.CurrentStepId = firstDept == null ? -1 : firstDept.StepID;
        }
        BizContext.SubmitChanges();
    }
Ejemplo n.º 16
0
    //部门筛选
    //public string DeptFliter = "S363-S973,S363-S969";

    /// <summary>
    /// 使用linq保存表单数据[根据formid来判断存储]
    /// </summary>
    protected override void SaveFormData()
    {
        var info = BizContext.HR_InternEmploy.FirstOrDefault(x => x.FormID == FormId);

        if (info == null)
        {
            info = new HR_InternEmploy()
            {
                FormID         = FormId,
                EmployeeName   = tbEmployeeName.Text,
                Position       = tbPosition.Text,
                InternDeptName = tbDept.Text,
                InternDeptCode = tbDeptCode.Value,
                InternReward   = tbInternReward.Text,
                InternDeadline = tbInternDeadline.Text,
                FormTitle      = "实习生录用审批"
            };
            BizContext.HR_InternEmploy.InsertOnSubmit(info);
        }
        BizContext.SubmitChanges();
    }
Ejemplo n.º 17
0
    protected override void SaveFormData()
    {
        var info = BizContext.OA_SealOfWY.FirstOrDefault(x => x.FormID == FormId);

        if (info == null)
        {
            info = new OA_SealOfWY()
            {
                FormID          = FormId,
                SecurityLevel   = cblSecurityLevel.SelectedValue,
                UrgenLevel      = cblUrgenLevel.SelectedValue,
                UserName        = tbUserName.Text,
                DeptName        = ddlDeptName.SelectedItem.Text,
                DeptCode        = ddlDeptName.SelectedItem.Value.ToString(),
                DateTime        = UpdatedTextBox.Value,
                Title           = tbTitle.Text,
                Remark          = cblRemark.SelectedValue,
                Content         = tbContent.Text,
                LeadersSelected = SaveLeadersSelected(),
            };
            BizContext.OA_SealOfWY.InsertOnSubmit(info);
        }
        else
        {
            info.SecurityLevel   = cblSecurityLevel.SelectedValue;
            info.UrgenLevel      = cblUrgenLevel.SelectedValue;
            info.UserName        = tbUserName.Text;
            info.DeptName        = ddlDeptName.SelectedItem.Text;
            info.DeptCode        = ddlDeptName.SelectedItem.Value.ToString();
            info.DateTime        = UpdatedTextBox.Value;
            info.Title           = tbTitle.Text;
            info.Remark          = cblRemark.SelectedValue;
            info.Content         = tbContent.Text;
            info.LeadersSelected = SaveLeadersSelected();
        }
        BizContext.SubmitChanges();
    }
Ejemplo n.º 18
0
    protected void btnQuery_Click(object sender, EventArgs e)
    {
        NameValueCollection kvs = new NameValueCollection();

        kvs.Add("GroupUsers", ITSupportCommon.GetK2DataFieldByGroupId(int.Parse(ddlGroups.SelectedItem.Value)));
        WorkflowHelper.UpdateDataFields(_BPMContext.Sn, kvs);
        string Opinion = Request["optionTxt"];
        var    appInfo = AppflowFactory.GetAppflow(_BPMContext.ProcID);

        appInfo.IsFromPC = true;
        string groupId = BizContext.V_ITSupport_Catalog.FirstOrDefault(x => x.Id.ToString() == ddlGroups.SelectedValue).GroupId.Value.ToString();

        appInfo.AssistObject = groupId;
        bool isSuccess = appInfo.StartApproval(_BPMContext.Sn, _BPMContext.ProcID, Opinion, "转出");

        if (isSuccess)
        {
            var formInfo = BizContext.OA_ITSupport_Form.FirstOrDefault(x => x.FormID == _BPMContext.ProcInst.FormId);
            formInfo.ProcessGroupId = groupId;

            BizContext.SubmitChanges();
        }
        DisplayMessage.ExecuteJs(string.Format("window.returnValue = {0};window.close();", isSuccess ? "1" : "0"));
    }
Ejemplo n.º 19
0
    /// <summary>
    /// 使用linq保存表单数据[根据formid来判断存储]
    /// </summary>
    protected override void SaveFormData()
    {
        var info = BizContext.HR_EmployeeLeft.FirstOrDefault(x => x.FormID == FormId);

        if (info == null)
        {
            info = new HR_EmployeeLeft()
            {
                FormID           = FormId,
                EmployeeName     = tbEmployeeName.Text,
                LoginName        = tbEmployeeLoginName.Value,
                DeptID           = tbDeptID.Value,
                DeptName         = tbDeptName.Text,
                Position         = tbPosition.Text,
                LeftType         = tbLeftType.SelectedValue,
                IsInitiativeLeft = cbIsActiveLeft.Checked.ToString(),
                IsEmployee       = cbEmployee.Checked.ToString(),
                IsStaffingDept   = cbDeptManager.Checked.ToString(),
                FormTitle        = "员工离职\\调动转单",
            };
            BizContext.HR_EmployeeLeft.InsertOnSubmit(info);
        }
        BizContext.SubmitChanges();
    }
Ejemplo n.º 20
0
    protected override void SaveFormData()
    {
        var info = BizContext.HR_EmployeeTransfer.FirstOrDefault(x => x.FormID == FormId);

        if (info == null)
        {
            info = new HR_EmployeeTransfer()
            {
                FormID                = FormId,
                UserName              = tbUserName.Text,
                LoginID               = tbLoginID.Value,
                Sex                   = tbSex.Text,
                EntryTime             = tbEntryTime.Value,
                Graduation            = tbGraduation.Text,
                Education             = tbEducation.Text,
                FounderTime           = tbFounderTime.Value,
                DeptName              = tbDeptName.Text,
                DeptCode              = tbDeptCode.Value,
                Post                  = tbPost.Text,
                PostLevel             = tbPostLevel.Text,
                ToDeptName            = tbToDeptName.Text,
                ToDeptCode            = tbToDeptCode.Value,
                ToPost                = tbToPost.Text,
                ToPostLevel           = tbToPostLevel.Text,
                LabourContractStart   = tbLabourContractStart.Value,
                LabourContractEnd     = tbLabourContractEnd.Value,
                ToLabourContractStart = tbToLabourContractStart.Value,
                ToLabourContractEnd   = tbToLabourContractEnd.Value,
                Salary                = tbSalary.Text,
                Ratio                 = tbRatio.Text,
                AnnualSalary          = tbAnnualSalary.Text,
                ToSalary              = tbToSalary.Text,
                ToRatio               = tbToRatio.Text,
                ToAnnualSalary        = tbToAnnualSalary.Text,
                TransferReason        = cblTransferReason.SelectedValue,
                Remark                = tbRemark.Text,
                IsGroup               = hfIsGroup.Value
            };
            BizContext.HR_EmployeeTransfer.InsertOnSubmit(info);
        }
        else
        {
            info.UserName              = tbUserName.Text;
            info.LoginID               = tbLoginID.Value;
            info.Sex                   = tbSex.Text;
            info.EntryTime             = tbEntryTime.Value;
            info.Graduation            = tbGraduation.Text;
            info.Education             = tbEducation.Text;
            info.FounderTime           = tbFounderTime.Value;
            info.DeptName              = tbDeptName.Text;
            info.DeptCode              = tbDeptCode.Value;
            info.Post                  = tbPost.Text;
            info.PostLevel             = tbPostLevel.Text;
            info.ToDeptName            = tbToDeptName.Text;
            info.ToDeptCode            = tbToDeptCode.Value;
            info.ToPost                = tbToPost.Text;
            info.ToPostLevel           = tbToPostLevel.Text;
            info.LabourContractStart   = tbLabourContractStart.Value;
            info.LabourContractEnd     = tbLabourContractEnd.Value;
            info.ToLabourContractStart = tbToLabourContractStart.Value;
            info.ToLabourContractEnd   = tbToLabourContractEnd.Value;
            info.Salary                = tbSalary.Text;
            info.Ratio                 = tbRatio.Text;
            info.AnnualSalary          = tbAnnualSalary.Text;
            info.ToSalary              = tbToSalary.Text;
            info.ToRatio               = tbToRatio.Text;
            info.ToAnnualSalary        = tbToAnnualSalary.Text;
            info.TransferReason        = cblTransferReason.SelectedValue;
            info.Remark                = tbRemark.Text;
            info.IsGroup               = hfIsGroup.Value;
        }
        BizContext.SubmitChanges();
    }
Ejemplo n.º 21
0
    protected override bool AfterWorkflowApproval(string action, string option, bool isSuccess)
    {
        if (isSuccess)
        {
            ///对于加签和转签
            ///对于一步转签造成的流程结束在流程结束时关闭步骤
            //if (action == "提交" && string.IsNullOrEmpty(NextUser))
            //{
            //    return true;
            //}

            ///更新当前步骤审批人处理记录
            ///

            var formInfo    = BizContext.OA_ITSupport_Form.FirstOrDefault(x => x.FormID == FormId);
            var currentStep = BizContext.OA_ITSupport_Step.FirstOrDefault(x => x.Id == formInfo.CurrentStepId);
            currentStep.FinishTime = DateTime.Now;

            if (action == "领取")
            {
                string stepId = Guid.NewGuid().ToString();
                BizContext.OA_ITSupport_Step.InsertOnSubmit(new Pkurg.PWorldBPM.Business.BIZ.OA_ITSupport_Step()
                {
                    Id             = stepId,
                    FormID         = FormId,
                    InstanceId     = _BPMContext.ProcID,
                    StartTime      = DateTime.Now,
                    OrderId        = currentStep.OrderId.Value + 1,
                    StartType      = (int)ITSupportStatus.处理,
                    ProcessGroupId = currentStep.ProcessGroupId
                });

                BizContext.OA_ITSupport_Step_Users.InsertOnSubmit(new OA_ITSupport_Step_Users()
                {
                    StepId   = stepId,
                    UserCode = _BPMContext.CurrentPWordUser.EmployeeCode
                    ,
                    LoginName = _BPMContext.CurrentUser.LoginId
                });

                formInfo.CurrentStepId = stepId;
            }
            else if (action == "提交" && !string.IsNullOrEmpty(NextUser))
            {
                string stepId = Guid.NewGuid().ToString();
                BizContext.OA_ITSupport_Step.InsertOnSubmit(new Pkurg.PWorldBPM.Business.BIZ.OA_ITSupport_Step()
                {
                    Id             = stepId,
                    FormID         = FormId,
                    InstanceId     = _BPMContext.ProcID,
                    StartTime      = DateTime.Now,
                    OrderId        = currentStep.OrderId.Value + 1,
                    StartType      = (int)ITSupportStatus.处理,
                    ProcessGroupId = currentStep.ProcessGroupId
                });
                var stepUser = SysContext.V_Pworld_UserInfo.FirstOrDefault(x => x.LoginName == NextUser);

                BizContext.OA_ITSupport_Step_Users.InsertOnSubmit(new OA_ITSupport_Step_Users()
                {
                    StepId    = stepId,
                    UserCode  = stepUser.EmployeeCode,
                    LoginName = stepUser.LoginName
                });

                formInfo.CurrentStepId = stepId;
            }
            else//处理或驳回
            {
                formInfo.CurrentStepId = "-1";
                if (action == "处理")
                {
                    formInfo.ProcessResult = 1;
                }
                if (action == "驳回")
                {
                    formInfo.ProcessResult = 2;
                }
            }

            BizContext.SubmitChanges();
        }
        return(true);
    }
Ejemplo n.º 22
0
    protected override void SaveFormData()
    {
        var info = BizContext.HR_EmployeeRegular.FirstOrDefault(x => x.FormID == FormId);

        if (info == null)
        {
            info = new HR_EmployeeRegular()
            {
                FormID               = FormId,
                UserName             = tbUserName.Text,
                LoginID              = tbLoginID.Value,
                DeptName             = tbDeptName.Text,
                DeptCode             = tbDeptCode.Value,
                EntryTime            = tbEntryTime.Value,
                ProbationPeriod      = tbProbationPeriod.Text,
                ProbationPeriodStart = tbProbationPeriodStart.Value,
                ProbationPeriodEnd   = tbProbationPeriodEnd.Value,
                PostLevel            = tbPostLevel.Text,
                QualityScore1        = tbQualityScore1.Text,
                QualityScore2        = tbQualityScore2.Text,
                QualityScore3        = tbQualityScore3.Text,
                QualityScore4        = tbQualityScore4.Text,
                QualityScore5        = tbQualityScore5.Text,
                QualityScore6        = tbQualityScore6.Text,
                QualityScore7        = tbQualityScore7.Text,
                QualityScore8        = tbQualityScore8.Text,
                QualityScore9        = tbQualityScore9.Text,
                QualityScore10       = tbQualityScore10.Text,
                QualityScore         = tbQualityScore.Text,
                AchievementScore     = tbAchievementScore.Text,
                TatolScore           = tbTatolScore.Text,
                IsGroup              = hfIsGroup.Value
            };
            BizContext.HR_EmployeeRegular.InsertOnSubmit(info);
        }
        else
        {
            info.UserName             = tbUserName.Text;
            info.LoginID              = tbLoginID.Value;
            info.DeptName             = tbDeptName.Text;
            info.DeptCode             = tbDeptCode.Value;
            info.EntryTime            = tbEntryTime.Value;
            info.ProbationPeriod      = tbProbationPeriod.Text;
            info.ProbationPeriodStart = tbProbationPeriodStart.Value;
            info.ProbationPeriodEnd   = tbProbationPeriodEnd.Value;
            info.PostLevel            = tbPostLevel.Text;
            info.QualityScore1        = tbQualityScore1.Text;
            info.QualityScore2        = tbQualityScore2.Text;
            info.QualityScore3        = tbQualityScore3.Text;
            info.QualityScore4        = tbQualityScore4.Text;
            info.QualityScore5        = tbQualityScore5.Text;
            info.QualityScore6        = tbQualityScore6.Text;
            info.QualityScore7        = tbQualityScore7.Text;
            info.QualityScore8        = tbQualityScore8.Text;
            info.QualityScore9        = tbQualityScore9.Text;
            info.QualityScore10       = tbQualityScore10.Text;
            info.QualityScore         = tbQualityScore.Text;
            info.AchievementScore     = tbAchievementScore.Text;
            info.TatolScore           = tbTatolScore.Text;
        }
        BizContext.SubmitChanges();
    }