Example #1
0
        private void btnRelease_Click(object sender, EventArgs e)
        {
            bool success = false;

            if (lvwReciveList.Items.Count == 0)
            {
                MessageBox.Show("没有指定通知消息的接收对象!", "", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            //add by wangzhi 2010-10-19
            if (ALLOW_RELEASE_ALLSERVER == false)
            {
                if (FrmMdiMain.Jgbm != Convert.ToInt32(cmbJgbm.SelectedValue))
                {
                    MessageBox.Show("你没有向所有服务器发布消息的权限,请重新选择服务器", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
            }
            //end add

            if (operatorType == 0)
            {
                //Modify By Tany 2010-08-23 根据机构编码循环保存或更新
                string    sql = "select * from jc_jgbm where jgbm=" + cmbJgbm.SelectedValue.ToString() + " or " + cmbJgbm.SelectedValue.ToString().Trim() + "=-1";
                DataTable tb  = dataBase.GetDataTable(sql);
                for (int i = 0; i < tb.Rows.Count; i++)
                {
                    dataBase = WorkStaticFun.GetJgbmDb(Convert.ToInt32(tb.Rows[i]["jgbm"]));

                    success = SaveMessage();

                    TrasenClasses.GeneralClasses.FrameEnvironment fEvt = (TrasenClasses.GeneralClasses.FrameEnvironment) this.Tag;

                    dataBase = fEvt.Database;
                }
            }
            else
            {
                success = UpdateMessage();
            }

            if (success)
            {
                step             = 1;
                plBrower.Visible = true;
                plEdit.Visible   = false;

                txtMsgTitle.Text = "";
                txtMsgEdit.Text  = "";

                plRecvieObject.Visible = false;
                lvwReciveList.Items.Clear();

                btnProvious.Enabled = false;
                btnNext.Enabled     = false;
                btnRelease.Enabled  = false;
                LoadMessageTitle();
            }
        }
Example #2
0
        private void cmbJgbm_SelectedValueChanged(object sender, EventArgs e)
        {
            if (cmbJgbm.SelectedValue != null && Convert.ToInt32(cmbJgbm.SelectedValue) != -1)
            {
                dataBase = WorkStaticFun.GetJgbmDb(Convert.ToInt32(cmbJgbm.SelectedValue));

                LoadMessageTitle();
            }
        }
Example #3
0
        /// <summary>
        /// 输入用户名类
        /// </summary>
        /// <param name="employeeId"></param>
        public FrmAddUser(int employeeId)
        {
            //
            // Windows 窗体设计器支持所必需的
            //
            InitializeComponent();

            //
            // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
            //
            //Modify By Tany 2010-01-27 使用本窗体自己的数据连接
            //如果设置了中心机构编码并且中心机构编码不等于当前连接的机构编码,则重新实例化本地连接为中心数据库连接
            if (FrmMdiMain.ZxJgbm != -1 && FrmMdiMain.ZxJgbm != FrmMdiMain.Jgbm)
            {
                db   = WorkStaticFun.GetJgbmDb(FrmMdiMain.ZxJgbm);
                jgbm = FrmMdiMain.ZxJgbm;
            }
            else
            {
                db   = FrmMdiMain.Database;
                jgbm = FrmMdiMain.Jgbm;
            }
            this.Text += "【" + jgbm + "】";
            employee   = new TrasenFrame.Classes.Employee(employeeId, db);

            this.btnChangeCode.Visible = false;
            this.txtName.Text          = employee.Name;
            this.txtName.Tag           = employee;
            this.DialogResult          = DialogResult.Cancel;
            LoadAllGroup();
            if (UserExists())
            {
                ShowUserInfo();
                this.btnChangeCode.Visible = true;
            }
            else
            {
                cmbCode.DropDownStyle = ComboBoxStyle.Simple;
                cmbCode.Text          = GetDefaultCode();
            }
        }