示例#1
0
        private void toolStripButton_location_modify_Click(object sender, EventArgs e)
        {
            string strError = "";
            if (this.listView_location_list.SelectedItems.Count == 0)
            {
                strError = "尚未选定要修改的馆藏地点事项";
                goto ERROR1;
            }
            ListViewItem item = this.listView_location_list.SelectedItems[0];

            LocationItemDialog dlg = new LocationItemDialog();

            dlg.LocationString = ListViewUtil.GetItemText(item, 0);
            dlg.CanBorrow = (ListViewUtil.GetItemText(item, 1) == "是") ? true : false;
            dlg.StartPosition = FormStartPosition.CenterScreen;
            dlg.ShowDialog(this);

            if (dlg.DialogResult != DialogResult.OK)
                return;

            ListViewUtil.ChangeItemText(item, 0, dlg.LocationString);
            ListViewUtil.ChangeItemText(item, 1, dlg.CanBorrow == true ? "是" : "否");

            ListViewUtil.SelectLine(item, true);
            return;
        ERROR1:
            MessageBox.Show(this, strError);
        }
示例#2
0
        private void toolStripButton_location_new_Click(object sender, EventArgs e)
        {
            LocationItemDialog dlg = new LocationItemDialog();

            dlg.CreateMode = true;
            dlg.StartPosition = FormStartPosition.CenterScreen;
            dlg.ShowDialog(this);

            if (dlg.DialogResult != DialogResult.OK)
                return;

            ListViewItem item = new ListViewItem(dlg.LocationString, 0);
            item.SubItems.Add(dlg.CanBorrow == true ? "是" : "否");

            this.listView_location_list.Items.Add(item);
            ListViewUtil.SelectLine(item, true);
        }
示例#3
0
        // 修改馆藏地点事项
        private void toolStripButton_location_modify_Click(object sender, EventArgs e)
        {
            string strError = "";
            if (this.listView_location_list.SelectedItems.Count == 0)
            {
                strError = "尚未选定要修改的馆藏地点事项";
                goto ERROR1;
            }
            ListViewItem item = this.listView_location_list.SelectedItems[0];

            LocationItemDialog dlg = new LocationItemDialog();
            MainForm.SetControlFont(dlg, this.Font, false);

            dlg.LibraryCodeList = this.GetLibraryCodeList();
            dlg.LibraryCode = ListViewUtil.GetItemText(item, LOCATION_COLUMN_LIBRARYCODE);
            dlg.LocationString = ListViewUtil.GetItemText(item, LOCATION_COLUMN_ROOM);
            dlg.CanBorrow = (ListViewUtil.GetItemText(item, LOCATION_COLUMN_CANBORROW) == "是") ? true : false;
            dlg.ItemBarcodeNullable = (ListViewUtil.GetItemText(item, LOCATION_COLUMN_ITEMBARCODENULLABLE) == "是") ? true : false;
            dlg.StartPosition = FormStartPosition.CenterScreen;

            REDO:
            dlg.ShowDialog(this);

            if (dlg.DialogResult != DialogResult.OK)
                return;

            // 查重
            ListViewItem dup = FindLocationItem(this.listView_location_list,
                dlg.LibraryCode,
                dlg.LocationString);
            if (dup != null && dup != item)
            {
                ListViewUtil.SelectLine(dup, true);
                dup.EnsureVisible();
                MessageBox.Show(this, "拟修改的馆藏地事项 '" + GetLocationItemName(dup) + "' 已经存在了,请修改后重新创建");
                goto REDO;
            }

            ListViewUtil.ChangeItemText(item, LOCATION_COLUMN_LIBRARYCODE, dlg.LibraryCode);
            ListViewUtil.ChangeItemText(item, LOCATION_COLUMN_ROOM, dlg.LocationString);
            ListViewUtil.ChangeItemText(item, LOCATION_COLUMN_CANBORROW, dlg.CanBorrow == true ? "是" : "否");
            ListViewUtil.ChangeItemText(item, LOCATION_COLUMN_ITEMBARCODENULLABLE, dlg.ItemBarcodeNullable == true ? "是" : "否");

            ListViewUtil.SelectLine(item, true);
            this.LocationTypesDefChanged = true;
            return;
        ERROR1:
            MessageBox.Show(this, strError);
        }
示例#4
0
        // 新创建馆藏地点事项
        private void toolStripButton_location_new_Click(object sender, EventArgs e)
        {
            LocationItemDialog dlg = new LocationItemDialog();
            MainForm.SetControlFont(dlg, this.Font, false);

            dlg.CreateMode = true;
            dlg.LibraryCodeList = this.GetLibraryCodeList();
            dlg.ItemBarcodeNullable = true;
            dlg.StartPosition = FormStartPosition.CenterScreen;

            REDO:
            dlg.ShowDialog(this);

            if (dlg.DialogResult != DialogResult.OK)
                return;

            // 查重
            ListViewItem dup = FindLocationItem(this.listView_location_list,
                dlg.LibraryCode,
                dlg.LocationString);
            if (dup != null)
            {
                ListViewUtil.SelectLine(dup, true);
                dup.EnsureVisible();
                MessageBox.Show(this, "拟新增的馆藏地事项 '"+GetLocationItemName(dup)+"' 已经存在了,请修改后重新创建");
                dlg.CreateMode = false; // 避免 _load 再次填充空白值
                goto REDO;
            }

            ListViewItem item = new ListViewItem();
            ListViewUtil.ChangeItemText(item, LOCATION_COLUMN_LIBRARYCODE, dlg.LibraryCode);
            ListViewUtil.ChangeItemText(item, LOCATION_COLUMN_ROOM, dlg.LocationString);
            ListViewUtil.ChangeItemText(item, LOCATION_COLUMN_CANBORROW, dlg.CanBorrow == true ? "是" : "否");
            ListViewUtil.ChangeItemText(item, LOCATION_COLUMN_ITEMBARCODENULLABLE, dlg.ItemBarcodeNullable == true ? "是" : "否");

            this.listView_location_list.Items.Add(item);
            ListViewUtil.SelectLine(item, true);
            item.EnsureVisible();

            this.LocationTypesDefChanged = true;
        }
示例#5
0
        // 修改馆藏地点事项
        private void toolStripButton_location_modify_Click(object sender, EventArgs e)
        {
            string strError = "";
            if (this.listView_location_list.SelectedItems.Count == 0)
            {
                strError = "尚未选定要修改的馆藏地点事项";
                goto ERROR1;
            }
            ListViewItem item = this.listView_location_list.SelectedItems[0];

            LocationItemDialog dlg = new LocationItemDialog();
            MainForm.SetControlFont(dlg, this.Font, false);

            dlg.LibraryCode = ListViewUtil.GetItemText(item, 0);
            dlg.LocationString = ListViewUtil.GetItemText(item, 1);
            dlg.CanBorrow = (ListViewUtil.GetItemText(item, 2) == "是") ? true : false;
            dlg.StartPosition = FormStartPosition.CenterScreen;
            dlg.ShowDialog(this);

            if (dlg.DialogResult != DialogResult.OK)
                return;

            ListViewUtil.ChangeItemText(item, 0, dlg.LibraryCode);
            ListViewUtil.ChangeItemText(item, 1, dlg.LocationString);
            ListViewUtil.ChangeItemText(item, 2, dlg.CanBorrow == true ? "是" : "否");

            ListViewUtil.SelectLine(item, true);
            this.LocationTypesDefChanged = true;
            return;
        ERROR1:
            MessageBox.Show(this, strError);
        }
示例#6
0
        // 新创建馆藏地点事项
        private void toolStripButton_location_new_Click(object sender, EventArgs e)
        {
            LocationItemDialog dlg = new LocationItemDialog();
            MainForm.SetControlFont(dlg, this.Font, false);

            dlg.StartPosition = FormStartPosition.CenterScreen;
            dlg.ShowDialog(this);

            if (dlg.DialogResult != DialogResult.OK)
                return;

            // TODO: 查重?

            ListViewItem item = new ListViewItem(dlg.LibraryCode, 0);
            item.SubItems.Add(dlg.LocationString);
            item.SubItems.Add(dlg.CanBorrow == true ? "是" : "否");

            this.listView_location_list.Items.Add(item);
            ListViewUtil.SelectLine(item, true);

            this.LocationTypesDefChanged = true;
        }
示例#7
0
        private void toolStripButton_location_new_Click(object sender, EventArgs e)
        {
            LocationItemDialog dlg = new LocationItemDialog();

            dlg.CreateMode = true;
            dlg.StartPosition = FormStartPosition.CenterScreen;
            dlg.ShowDialog(this);

            if (dlg.DialogResult != DialogResult.OK)
                return;

            ListViewItem item = new ListViewItem(dlg.LocationString, 0);
            item.SubItems.Add(dlg.CanBorrow == true ? "是" : "否");

            this.listView_location_list.Items.Add(item);
            ListViewUtil.SelectLine(item, true);
        }