Esempio n. 1
0
        private bool 纠正预防措施报告明细_PanelGetDataInfo(CE_FlowOperationType flowOperationType)
        {
            try
            {
                GetInfo();

                Flow_FlowInfo info =
                    _Service_Flow.GetNowFlowInfo(_Service_Flow.GetBusinessTypeID(CE_BillTypeEnum.纠正预防措施报告, null),
                                                 _Lnq_BillInfo.BillNo);

                if (flowOperationType == CE_FlowOperationType.提交)
                {
                    NotifyPersonnelInfo       personnelInfo = new NotifyPersonnelInfo();
                    List <PersonnelBasicInfo> lstInfo       = new List <PersonnelBasicInfo>();
                    PersonnelBasicInfo        infoTemp      = new PersonnelBasicInfo();

                    switch (info.FlowID)
                    {
                    case 1109:
                        if (GeneralFunction.IsNullOrEmpty(_Lnq_BillInfo.D1_DutyDepartment))
                        {
                            throw new Exception("请选择【调查改善担当部门】");
                        }
                        break;

                    case 1110:
                    case 1112:
                        IBillMessagePromulgatorServer serviceBillMessage =
                            BasicServerFactory.GetServerModule <IBillMessagePromulgatorServer>();

                        List <string> lstRoleName = serviceBillMessage.GetSuperior(CE_RoleStyleType.负责人,
                                                                                   UniversalFunction.GetDeptCode(_Lnq_BillInfo.D1_DutyDepartment));

                        personnelInfo.UserType = BillFlowMessage_ReceivedUserType.角色.ToString();
                        foreach (string item in lstRoleName)
                        {
                            infoTemp    = new PersonnelBasicInfo();
                            infoTemp.角色 = item;
                            lstInfo.Add(infoTemp);
                        }

                        personnelInfo.PersonnelBasicInfoList = lstInfo;
                        this.FlowInfo_NotifyInfo             = personnelInfo;
                        break;

                    case 1111:

                        if (GeneralFunction.IsNullOrEmpty(_Lnq_BillInfo.D2_DutyPersonnel))
                        {
                            throw new Exception("请指定【改善小组组长】");
                        }

                        personnelInfo.UserType = BillFlowMessage_ReceivedUserType.用户.ToString();
                        infoTemp    = new PersonnelBasicInfo();
                        infoTemp.工号 = _Lnq_BillInfo.D2_DutyPersonnel;
                        lstInfo.Add(infoTemp);

                        personnelInfo.PersonnelBasicInfoList = lstInfo;
                        this.FlowInfo_NotifyInfo             = personnelInfo;
                        break;

                    default:
                        break;
                    }
                }

                this.FlowInfo_BillNo = txtBillNo.Text;
                this.ResultInfo      = _Lnq_BillInfo;

                this.ResultList = new List <object>();
                this.ResultList.Add(flowOperationType);

                return(true);
            }
            catch (Exception ex)
            {
                MessageDialog.ShowPromptMessage(ex.Message);
                return(false);
            }
        }
Esempio n. 2
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            if ((DataTable)dataGridView1.DataSource == null || ((DataTable)dataGridView1.DataSource).Rows.Count == 0)
            {
                MessageDialog.ShowPromptMessage("请选择人员");
                return;
            }

            if (dataGridView1.Rows.Count > 1 && !_IsMultiSelect)
            {
                MessageDialog.ShowPromptMessage("无法选择多条记录");
                return;
            }

            m_receivedUserType =
                GlobalObject.GeneralFunction.StringConvertToEnum <BillFlowMessage_ReceivedUserType>(tabControl1.SelectedTab.Name);

            DataTable tempTable = new DataTable();

            switch (m_receivedUserType)
            {
            case BillFlowMessage_ReceivedUserType.用户:

                DataTable tempPersonnel = (DataTable)dataGridView1.DataSource;

                m_listSelectedPersonnels = new List <PersonnelBasicInfo>();

                foreach (DataRow dr in tempPersonnel.Rows)
                {
                    PersonnelBasicInfo entityInfo = new PersonnelBasicInfo();

                    entityInfo.工号 = dr["员工编号"].ToString();
                    entityInfo.姓名 = dr["员工姓名"].ToString();

                    m_listSelectedPersonnels.Add(entityInfo);
                }
                break;

            case BillFlowMessage_ReceivedUserType.角色:

                DataTable tempRole = (DataTable)dataGridView1.DataSource;

                m_listSelectedPersonnels = new List <PersonnelBasicInfo>();

                foreach (DataRow dr in tempRole.Rows)
                {
                    PersonnelBasicInfo entityInfo = new PersonnelBasicInfo();

                    entityInfo.角色 = dr["角色名称"].ToString();

                    m_listSelectedPersonnels.Add(entityInfo);
                }
                break;

            default:
                break;
            }

            m_notifyPersonnelInfo.UserType = m_receivedUserType.ToString();
            m_notifyPersonnelInfo.PersonnelBasicInfoList = m_listSelectedPersonnels;

            #region 2013-11-18 如果选择人员有问题则返回
            if (OnCheckSelectedPersonnel != null)
            {
                if (!OnCheckSelectedPersonnel(m_listSelectedPersonnels))
                {
                    return;
                }
            }
            #endregion

            this.DialogResult = DialogResult.OK;
            this.Close();
        }
Esempio n. 3
0
        void OperationBusiness()
        {
            string type = GetMode(panel2);
            string mode = GetMode(panel3);

            if (type.Trim().Length == 0 || mode.Trim().Length == 0)
            {
                MessageDialog.ShowPromptMessage("请选择【单据类型】、【操作类型】");
                return;
            }
            CE_HR_AttendanceExceptionType billType =
                GlobalObject.GeneralFunction.StringConvertToEnum <CE_HR_AttendanceExceptionType>(type);
            CE_OperatorMode operationMode =
                GlobalObject.GeneralFunction.StringConvertToEnum <CE_OperatorMode>(mode);

            if (!CheckData())
            {
                return;
            }

            List <object>             lstInfo      = new List <object>();
            List <PersonnelBasicInfo> lstPersonnel = new List <PersonnelBasicInfo>();

            lstInfo.Add(ServerTime.ConvertToDateTime(dtp_BeginTime.Value));
            lstInfo.Add(ServerTime.ConvertToDateTime(dtp_EndTime.Value));
            lstInfo.Add(cmb_BusinessType.Text);
            lstInfo.Add(txtContent.Text.Trim());
            lstInfo.Add(num_Hours.Value);

            if (operationMode == CE_OperatorMode.添加)
            {
                lstInfo.Add(null);

                MessageDialog.ShowPromptMessage(string.Format("请设置需要【{0}】的人员", billType.ToString()));
                FormSelectPersonnel2 frm = new FormSelectPersonnel2();

                if (frm.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
                else
                {
                    if (frm.SelectedNotifyPersonnelInfo.UserType != BillFlowMessage_ReceivedUserType.用户.ToString())
                    {
                        MessageDialog.ShowPromptMessage("请选择【用户】");
                        return;
                    }
                    else
                    {
                        lstPersonnel = frm.SelectedNotifyPersonnelInfo.PersonnelBasicInfoList;
                    }
                }

                _serviceAnalysis.Operation_Exception(billType, operationMode, lstInfo, lstPersonnel);
            }
            else if (operationMode == CE_OperatorMode.修改)
            {
                lstInfo.Add((int)customDataGridView1.CurrentRow.Cells["单据号"].Value);

                if (MessageDialog.ShowEnquiryMessage("你确定要【" + operationMode.ToString() + "】?") == DialogResult.No)
                {
                    return;
                }

                _serviceAnalysis.Operation_Exception(billType, operationMode, lstInfo, lstPersonnel);
            }
            else if (operationMode == CE_OperatorMode.除)
            {
                if (MessageDialog.ShowEnquiryMessage("你确定要【" + operationMode.ToString() + "】?") == DialogResult.No)
                {
                    return;
                }

                if (customDataGridView1.SelectedRows.Count == 0)
                {
                    MessageDialog.ShowPromptMessage("请选择需要【删除】的记录");
                    return;
                }

                foreach (DataGridViewRow dgvr in customDataGridView1.SelectedRows)
                {
                    lstInfo.Add((int)dgvr.Cells["单据号"].Value);
                    lstPersonnel = new List <PersonnelBasicInfo>();
                    PersonnelBasicInfo personnel = new PersonnelBasicInfo();

                    personnel.工号 = dgvr.Cells["执行人"].Value.ToString();
                    lstPersonnel.Add(personnel);

                    _serviceAnalysis.Operation_Exception(billType, operationMode, lstInfo, lstPersonnel);
                }
            }

            MessageDialog.ShowPromptMessage(string.Format("【{0}单{1}成功】", billType.ToString(), operationMode.ToString()));
            RefreshDataGridView();
        }