Esempio n. 1
0
        /// <summary>
        /// NewOperRole
        /// </summary>
        internal void NewOperRole()
        {
            EntityCodeOperator vo = GetOperOrig();

            if (vo == null)
            {
                DialogBox.Msg("请先保存职工主信息。");
                return;
            }
            frmNew frm = new frmNew(EntityTools.ConvertToDataTable <EntityCodeRole>(DataSourceRole), "roleCode", "roleCode", "roleName");

            if (frm.ShowDialog() == DialogResult.OK)
            {
                if (frm.lstNo.Count > 0)
                {
                    foreach (int index in frm.lstNo)
                    {
                        EntityDefOperatorRole vo1 = new EntityDefOperatorRole();
                        vo1.operCode = vo.operCode;
                        vo1.roleCode = DataSourceRole[index].roleCode;
                        using (ProxyDictionary proxy = new ProxyDictionary())
                        {
                            if (proxy.Service.SaveOperatorRole(vo1) < 0)
                            {
                                DialogBox.Msg("保存职工所属角色失败。");
                                return;
                            }
                        }
                    }
                    LoadOperRole(vo.operCode);
                }
            }
        }
        private void btnBungalow_Click(object sender, EventArgs e)
        {
            //frmBungalow myBungalow = new frmBungalow();
            // myBungalow.ShowDialog();

            frmNew newProject = new frmNew();

            newProject.ShowDialog();
        }
Esempio n. 3
0
        /// <summary>
        /// NewOperDept
        /// </summary>
        internal void NewOperDept()
        {
            EntityCodeOperator vo = GetOperOrig();

            if (vo == null)
            {
                DialogBox.Msg("请先保存职工主信息。");
                return;
            }
            frmNew frm = new frmNew(EntityTools.ConvertToDataTable <EntityCodeDepartment>(GlobalDic.DataSourceDepartment), "deptCode", "deptCode", "deptName");

            if (frm.ShowDialog() == DialogResult.OK)
            {
                if (frm.lstNo.Count > 0)
                {
                    bool isDefault = false;
                    foreach (int index in frm.lstNo)
                    {
                        EntityDefDeptemployee vo1 = new EntityDefDeptemployee();
                        vo1.operCode = vo.operCode;
                        vo1.deptCode = GlobalDic.DataSourceDepartment[index].deptCode;
                        if (Viewer.gvDept.RowCount == 0 && isDefault == false)
                        {
                            vo1.defaultFlag = 1;
                            isDefault       = true;
                        }
                        else
                        {
                            vo1.defaultFlag = 0;
                        }
                        using (ProxyDictionary proxy = new ProxyDictionary())
                        {
                            if (proxy.Service.SaveOperatorDept(vo1) < 0)
                            {
                                DialogBox.Msg("保存职工所属科室失败。");
                                return;
                            }
                        }
                    }
                    LoadOperDept(vo.operCode, string.Empty);
                }
            }
        }