コード例 #1
0
        private void AddBtn_Click(object sender, EventArgs e)
        {
            errorLabel.Text = "";
            if (name.Text == "" || code.Text == "")
            {
                MessageBox.Show("有效信息不能为空", Framework.Environment.PROGRAM_NAME, MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                return;
            }
            BlackListLib t_BlackListLib = new BlackListLib();

            t_BlackListLib.Name      = name.Text;
            t_BlackListLib.Code      = code.Text;
            t_BlackListLib.OtherInfo = otherInfo.Text;
            // 添加成功
            if (BlackListViewModel.Instance.AddBlackListLib(t_BlackListLib))
            {
                if (AddFinished != null)
                {
                    AddFinished((object)t_BlackListLib, null);
                }
                this.Close();
            }
            // 添加失败
            else
            {
                errorLabel.Text = "添加失败";
            }
        }
コード例 #2
0
        private void AddFinsh(object blackListLib, EventArgs e)
        {
            BlackListLib t_BlackListLib = (BlackListLib)blackListLib;

            userDataList.Rows.Add("", t_BlackListLib.Name, t_BlackListLib.picList.Count, t_BlackListLib.OtherInfo);
            userDataList.Rows[userDataList.Rows.Count - 1].Tag = blackListLib;
        }
コード例 #3
0
        public bool AddBlackListLib(BlackListLib newListLib)
        {
            bool ret = true;

            try {
                ret = Framework.Container.Instance.CommService.ADD_BLACK_LIST(newListLib);
            }
            catch (Exception ex) {
                MyLog4Net.Container.Instance.Log.Debug("Error BlackListViewModel AddBlackListLib:" + ex.ToString());
                ret = false;
            }
            return(ret);
        }
コード例 #4
0
        private void delBtn_Click(object sender, EventArgs e)
        {
            BlackListLib t_BlackListLib = (BlackListLib)userDataList.SelectedRows[0].Tag;

            if (userDataList.Rows.Count <= 0)
            {
                return;
            }
            if (MessageBox.Show(string.Format("确认删除该黑名单库 {0} ?", t_BlackListLib.Name), Framework.Environment.PROGRAM_NAME, MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk) != System.Windows.Forms.DialogResult.Yes)
            {
                return;
            }
            string retStr;

            if (BlackListViewModel.Instance.DelBlackListLib(t_BlackListLib.Handel, out retStr))
            {
                userDataList.Rows.RemoveAt(userDataList.CurrentRow.Index);
            }
        }