Yes24 - 바뀐 예스 양식에 따라 수정 =====* unimarc *===== - 목록등록 - 머리글에 맞춰 숫자 입력기능 추가 - 목록집계 - 거래처명 엔터시 검색 추가 추가정보 표출창에 거래처 정보가 출력됨 - 송금내역 - 엑셀 반출작업 완료 - 입고작업 - gird3 isbn찍으면 책검색이 되어 자동으로 해당 isbn 책이 출력됨
111 lines
4.1 KiB
C#
111 lines
4.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
using WindowsFormsApp1;
|
|
using WindowsFormsApp1.Mac;
|
|
|
|
namespace UniMarc.마크
|
|
{
|
|
public partial class All_Book_manage_Add : Form
|
|
{
|
|
Helper_DB db = new Helper_DB();
|
|
All_Book_manage manage;
|
|
public All_Book_manage_Add(All_Book_manage _manage)
|
|
{
|
|
InitializeComponent();
|
|
manage = _manage;
|
|
}
|
|
|
|
private void All_Book_manage_Add_Load(object sender, EventArgs e)
|
|
{
|
|
db.DBcon();
|
|
}
|
|
|
|
private void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
|
|
{
|
|
Skill_Grid sg = new Skill_Grid();
|
|
sg.Print_Grid_Num(sender, e);
|
|
}
|
|
|
|
private void btn_Save_Click(object sender, EventArgs e)
|
|
{
|
|
bool grid_chk = true;
|
|
|
|
for(int a = 0; a < dataGridView1.Rows.Count; a++)
|
|
{
|
|
if (dataGridView1.Rows[a].Cells["book_name"].Value == null ||
|
|
dataGridView1.Rows[a].Cells["author"].Value == null ||
|
|
dataGridView1.Rows[a].Cells["book_comp"].Value == null ||
|
|
dataGridView1.Rows[a].Cells["price"].Value == null) {
|
|
|
|
grid_chk = false;
|
|
break;
|
|
}
|
|
else if (dataGridView1.Rows[a].Cells["book_name"].Value.ToString() == "" ||
|
|
dataGridView1.Rows[a].Cells["author"].Value.ToString() == "" ||
|
|
dataGridView1.Rows[a].Cells["book_comp"].Value.ToString() == "" ||
|
|
dataGridView1.Rows[a].Cells["price"].Value.ToString() == "") {
|
|
grid_chk = false;
|
|
break;
|
|
}
|
|
else if (tb_setName.Text == "") {
|
|
grid_chk = false;
|
|
break;
|
|
}
|
|
if (dataGridView1.Rows[a].Cells["ISBN"].Value == null)
|
|
{
|
|
dataGridView1.Rows[a].Cells["ISBN"].Value = "";
|
|
}
|
|
}
|
|
if (!grid_chk) {
|
|
MessageBox.Show("필수 입력사항이 비어있습니다!\n맨 앞에 \"*\"이 붙은 곳을 확인해주세요.");
|
|
return;
|
|
}
|
|
|
|
// DB 저장
|
|
for(int a= 0; a < dataGridView1.Rows.Count; a++)
|
|
{
|
|
string[] insert_tbl = { "compidx",
|
|
"set_name", "set_count", "set_isbn", "set_price", "set_pubyear",
|
|
"book_name", "author", "book_comp", "isbn", "price", "charge" };
|
|
string[] insert_col = { manage.compidx,
|
|
tb_setName.Text, tb_setCount.Text, tb_setISBN.Text, tb_setPrice.Text, tb_setYear.Text,
|
|
dataGridView1.Rows[a].Cells["book_name"].Value.ToString(),
|
|
dataGridView1.Rows[a].Cells["author"].Value.ToString(),
|
|
dataGridView1.Rows[a].Cells["book_comp"].Value.ToString(),
|
|
dataGridView1.Rows[a].Cells["ISBN"].Value.ToString(),
|
|
dataGridView1.Rows[a].Cells["price"].Value.ToString(), manage.charge };
|
|
|
|
db.DB_INSERT("Set_Book", insert_tbl, insert_col);
|
|
}
|
|
|
|
MessageBox.Show("저장완료");
|
|
|
|
// 부모폼 조회버튼 클릭
|
|
manage.btn_Search_Click(null, null);
|
|
this.Close();
|
|
}
|
|
|
|
private void btn_Close_Click(object sender, EventArgs e)
|
|
{
|
|
this.Close();
|
|
}
|
|
|
|
private void dataGridView1_KeyDown(object sender, KeyEventArgs e)
|
|
{
|
|
Skill_Grid sg = new Skill_Grid();
|
|
if ((e.Shift && e.KeyCode == Keys.Insert) || (e.Control && e.KeyCode == Keys.V))
|
|
{
|
|
sg.Excel_to_DataGridView(sender, e);
|
|
tb_setCount.Text = dataGridView1.Rows.Count.ToString();
|
|
}
|
|
}
|
|
}
|
|
}
|