===== 작업중 ===== 주문관리 폼 재 수정작업중 - 팩스 및 이메일 기록 폼 제작해야함. - 제작완료 (현재 목록등록 -> 수정버튼 작업중) ㄴ> 작업 완료후 검토하고, 회계로 넘어갈 것. - 회계전환 ㄴ> 회계전환. 매출상세(Sales_Detail.cs) 폼 작업중. (버튼 이벤트 작업진행중) ===== 보류 ===== b. 마크목록 폼 작성중 1. 엑셀반출 기능 추가중 사용 작업대기중 c. 마크 반입 폼 수정중 1. 불러오기는 되나 저장 기능이 필요함. ===== 완료 ===== 1. 주문관리 팩스연동 완료 2. 전송된 팩스 확인 작업개시, 이메일 전송모듈 수정완료. 3. 주문관리에서 주문처와 목록 검색하는 폼 검색 모듈도 재수정 완료함. 4. 데이터베이스 내 이미지URL을 가져오는작업 완료 목록집계 폼 재 수정작업 완료 - 확인 및 수정 필요. ISBN 체크 프로그램 => 본프로그램에 이식중. ㄴ> 코드는 다 옮겼으나 기존 사용하던 방식과 조금 달라서 버그발생 가능성 있음. ㄴ> 버그 체크 계속 해볼것. 21-04-15 ㄴ> 21_04_20 버그 없음. 2. 마크편집 폼 수정 중 (마크 반출 test프로젝트 진행완료, 본 프로젝트에 적용중. / 저장기능활성화 작업완료) 2-1. 기존의 칸채우기에서 예상되지 못한 버그가 발생하여 칸채우기 숨김. 2-2. 008태크 재배치 => TextBox에 적용완료. 변경사항 메모장으로 넘기는 작업 완료. 2-3. 저장기능 완료. (04.14 체크해볼것 - 완료) 주문관리 작업중 (DataGridView 주문처 엔터키 입력시 검색되게끔 하는 코드작성중) - 21.04.27 완료
597 lines
26 KiB
C#
597 lines
26 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Drawing.Printing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Text.RegularExpressions;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
using WindowsFormsApp1.Mac;
|
|
|
|
namespace WindowsFormsApp1.Delivery
|
|
{
|
|
public partial class List_aggregation : Form
|
|
{
|
|
Helper_DB db = new Helper_DB();
|
|
string db_tmp;
|
|
public int EditNumber;
|
|
public string compidx;
|
|
int row = 0;
|
|
Main main;
|
|
public List_aggregation(Main _main)
|
|
{
|
|
InitializeComponent();
|
|
main = _main;
|
|
compidx = main.com_idx;
|
|
}
|
|
/////// TODO:
|
|
// 새로운 폼 작업 필요.
|
|
// "목록집계등록"
|
|
private void List_aggregation_Load(object sender, EventArgs e)
|
|
{
|
|
db.DBcon();
|
|
// 작업명 - 배송방법까진 수정이 가능하여야함. 3,4,5,6 + 체크 추가
|
|
for (int a = 0; a < 16; a++)
|
|
{
|
|
if(a==2 || a == 4 || a == 5 || a == 6 || a == 15) {
|
|
dataGridView1.Columns[a].ReadOnly = false;
|
|
}
|
|
else { dataGridView1.Columns[a].ReadOnly = true; }
|
|
}
|
|
string[] state = { "진행", "완료", "전체" };
|
|
combo_state.Items.AddRange(state);
|
|
combo_state.SelectedIndex = 0;
|
|
|
|
string[] years = {"2009", "2010", "2011", "2012", "2013",
|
|
"2014", "2015", "2016", "2017", "2018",
|
|
"2019", "2020"};
|
|
combo_year.Items.AddRange(years);
|
|
combo_year.SelectedIndex = 11;
|
|
combo_year.Visible = false;
|
|
|
|
combo_user.Items.Add("전체");
|
|
string[] user_tmp = main.DB_User_Data.Split('|');
|
|
string cmd = db.self_Made_Cmd("SELECT `name` FROM `User_Data` WHERE `affil` = '" + user_tmp[5] + "';");
|
|
string[] user_name = cmd.Split('|');
|
|
for(int a = 0; a < user_name.Length; a++)
|
|
{
|
|
if (a == user_name.Length - 1) { break; }
|
|
combo_user.Items.Add(user_name[a]);
|
|
}
|
|
combo_user.SelectedIndex = 0;
|
|
/*
|
|
string searchdb = "`list_name`, `date`, `date_res`, `charge`, `work_name`, " +
|
|
"`work_way`, `send_way`, `total`, `stock_money`, `vol`, " +
|
|
"`stock`, `unstock`, `list_num`, `chk_marc`";
|
|
string[] searchdb1 = { "comp_num", "state" };
|
|
string[] searchdb2 = { compidx, "진행" };
|
|
db_tmp = db.More_DB_Search("Obj_List", searchdb1, searchdb2, searchdb);
|
|
Made_Grid(db_tmp);
|
|
dataGridView1.Focus();
|
|
infor_Update(0);*/
|
|
}
|
|
/// <summary>
|
|
/// 표에 값을 채우는 함수.
|
|
/// </summary>
|
|
/// <param name="tmp">분할을 하지않은 데이터베이스 값</param>
|
|
private void Made_Grid(string tmp)
|
|
{
|
|
dataGridView1.Rows.Clear();
|
|
string[] db_data = tmp.Split('|');
|
|
string[] grid = {"", "", "", "", "",
|
|
"", "", "", "", "",
|
|
"", "", "", "", "", "" };
|
|
for (int a = 0; a < db_data.Length; a++)
|
|
{
|
|
if (a % 14 == 0) { grid[0] = db_data[a]; }
|
|
if (a % 14 == 1) {
|
|
if (db_data[a].Length < 3) {
|
|
grid[1] = db_data[a];
|
|
}
|
|
else { grid[1] = db_data[a].Substring(0, 10); }
|
|
grid[1] = db_data[a]; }
|
|
if (a % 14 == 2) {
|
|
if (db_data[a].Length < 3) {
|
|
grid[2] = db_data[a];
|
|
}
|
|
else { grid[2] = db_data[a].Substring(0, 10); }
|
|
}
|
|
if (a % 14 == 3) { grid[3] = db_data[a]; }
|
|
if (a % 14 == 4) { grid[4] = db_data[a]; }
|
|
if (a % 14 == 5) { grid[5] = db_data[a]; }
|
|
if (a % 14 == 6) { grid[6] = db_data[a]; }
|
|
if (a % 14 == 7) { grid[7] = db_data[a]; }
|
|
if (a % 14 == 8) { grid[8] = db_data[a]; }
|
|
if (a % 14 == 9) { grid[9] = db_data[a]; }
|
|
if (a % 14 == 10) { grid[10] = db_data[a]; }
|
|
if (a % 14 == 11) { grid[11] = db_data[a]; }
|
|
if (a % 14 == 12) { grid[14] = db_data[a]; }
|
|
if (a % 14 == 13) {
|
|
grid[15] = db_data[a];
|
|
if (Grid_filter(grid)) {
|
|
dataGridView1.Rows.Add(grid);
|
|
}
|
|
}
|
|
}
|
|
GridColorChange();
|
|
}
|
|
private bool Grid_filter(string[] arr)
|
|
{
|
|
String_Text st = new String_Text();
|
|
string db_clt = st.GetMiddelString(arr[0], "[", "]");
|
|
string cb_year = combo_year.SelectedItem.ToString();
|
|
string db_year = arr[1].Substring(0, 4);
|
|
if (combo_state.SelectedIndex == 1) {
|
|
if (cb_year != db_year) {
|
|
MessageBox.Show("연도 컷");
|
|
return false;
|
|
}
|
|
}
|
|
if (combo_user.SelectedIndex != 0) {
|
|
if (combo_user.SelectedItem.ToString() != arr[3]) {
|
|
MessageBox.Show("사용자 컷");
|
|
return false;
|
|
}
|
|
}
|
|
if (tb_clt.Text != "") {
|
|
if(tb_clt.Text == db_clt) {
|
|
return true;
|
|
}
|
|
MessageBox.Show("거래처 컷");
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
private void btn_lookup_Click(object sender, EventArgs e) // 조회
|
|
{
|
|
/// 목록명 / 목록일자 / 완료일자 / 담당자 / 작업명
|
|
/// 작업방법 / 배송방법 / 합계금액 / 입고금액 / 수량
|
|
/// 입고 / 미입고 / 목록번호 / 마크여부
|
|
string searchdb = "`list_name`, `date`, `date_res`, `charge`, `work_name`, " +
|
|
"`work_way`, `send_way`, `total`, `stock_money`, `vol`, " +
|
|
"`stock`, `unstock`, `list_num`, `chk_marc`";
|
|
List<string> search_L_tbl = new List<string>();
|
|
List<string> search_L_col = new List<string>();
|
|
|
|
search_L_tbl.Add("comp_num");
|
|
search_L_col.Add(compidx);
|
|
|
|
if (combo_state.SelectedItem.ToString() != "전체") {
|
|
search_L_tbl.Add("state");
|
|
search_L_col.Add(combo_state.SelectedItem.ToString());
|
|
}
|
|
|
|
string[] searchdb1 = search_L_tbl.ToArray();
|
|
string[] searchdb2 = search_L_col.ToArray();
|
|
|
|
db_tmp = db.More_DB_Search("Obj_List", searchdb1, searchdb2, searchdb);
|
|
Made_Grid(db_tmp);
|
|
dataGridView1.Focus();
|
|
}
|
|
private void btn_save_Click(object sender, EventArgs e) // 저장
|
|
{
|
|
string table = "Obj_List";
|
|
string[] Edit_col = { "work_name", "work_way", "send_way" };
|
|
string[] Search_col = { "list_name", "total" };
|
|
string edit1, edit2, edit3;
|
|
for (int a = 0; a < dataGridView1.Rows.Count; a++)
|
|
{
|
|
if(dataGridView1.Rows[a].Cells["work_name"].Value.ToString() == null) { edit1 = ""; }
|
|
else { edit1 = dataGridView1.Rows[a].Cells["work_name"].Value.ToString(); }
|
|
|
|
if(dataGridView1.Rows[a].Cells["work_way"].Value.ToString() == null) { edit2 = ""; }
|
|
else { edit2 = dataGridView1.Rows[a].Cells["work_way"].Value.ToString(); }
|
|
|
|
if(dataGridView1.Rows[a].Cells["send_way"].Value.ToString() == null) { edit3 = ""; }
|
|
else { edit3 = dataGridView1.Rows[a].Cells["send_way"].Value.ToString(); }
|
|
|
|
string[] Edit_Data = { edit1, edit2, edit3 };
|
|
string[] Search_Data = {dataGridView1.Rows[a].Cells["list_name"].Value.ToString(),
|
|
dataGridView1.Rows[a].Cells["total"].Value.ToString()};
|
|
db.More_Update(table, Edit_col, Edit_Data, Search_col, Search_Data);
|
|
}
|
|
}
|
|
private void btn_process_Click(object sender, EventArgs e) // 완료처리
|
|
{
|
|
Skill_Search_Text sst = new Skill_Search_Text();
|
|
string value = "";
|
|
if (sst.InputBox("출고율을 입력해주세요!", "출고율 입력", ref value) != DialogResult.OK) return;
|
|
|
|
value = Regex.Replace(value, @"[^0-9]", "");
|
|
|
|
if(value == "") return;
|
|
|
|
string[] Edit_col = { "state" };
|
|
string[] Edit_data = { "완료" };
|
|
string[] Search_col = { "compidx", "list_name", "date" };
|
|
string[] Search_data = { compidx, tb_list_name.Text, tb_date.Text };
|
|
|
|
string Area = "`isbn`, `isbn_import`, `book_name`, `author`, `book_comp`, `price`, `input_count`, `persent`";
|
|
string book_list = db.More_DB_Search("Obj_List_Book", Search_col, Search_data, Area);
|
|
Sales(book_list, value);
|
|
|
|
db.More_Update("Obj_List_Marc", Edit_col, Edit_data, Search_col, Search_data);
|
|
Search_col[0] = "comp_num";
|
|
db.More_Update("Obj_List", Edit_col, Edit_data, Search_col, Search_data);
|
|
|
|
MessageBox.Show("정상적으로 완료처리 되었습니다.");
|
|
}
|
|
/// <summary>
|
|
/// 목록도서DB 내용을 들고와서 SalesDB에 출고율을 추가하여 집어넣는다.
|
|
/// </summary>
|
|
private void Sales(string book_list, string out_per)
|
|
{
|
|
string[] tmp = book_list.Split('|');
|
|
List<string> l_book = new List<string>();
|
|
string[] book = { "", "", "", "", "", "", "" };
|
|
for(int a= 0; a < tmp.Length; a++)
|
|
{
|
|
if (a % 8 == 0) { l_book.Add(tmp[a]); } // isbn
|
|
if (a % 8 == 1) { l_book.Add(tmp[a]); } // isbn_import
|
|
if (a % 8 == 2) { l_book.Add(tmp[a]); } // book_name
|
|
if (a % 8 == 3) { l_book.Add(tmp[a]); } // author
|
|
if (a % 8 == 4) { l_book.Add(tmp[a]); } // book_comp
|
|
if (a % 8 == 5) { l_book.Add(tmp[a]); } // price
|
|
if (a % 8 == 6) { l_book.Add(tmp[a]); } // input_count
|
|
if (a % 8 == 7) { l_book.Add(tmp[a]); // persent
|
|
book = db_data_filter(l_book, book);
|
|
input_sales(book, out_per);
|
|
}
|
|
}
|
|
}
|
|
private void input_sales(string[] book, string out_per)
|
|
{
|
|
String_Text st = new String_Text();
|
|
DateTime date_tmp = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
|
|
string date = date_tmp.ToString().Substring(0, 10);
|
|
string clt = st.GetMiddelString(tb_list_name.Text, "[", "]");
|
|
string dly = tb_list_name.Text.Substring(tb_list_name.Text.IndexOf(']') + 1);
|
|
// 목록일자 + " " + 납품처
|
|
string etc = tb_date.Text + " " + dly;
|
|
|
|
string[] total = Cal_out_price(book[4], book[5], out_per, book[6]);
|
|
|
|
string[] col_name = { "compidx", "date", "list_date", "list_name", "client",
|
|
"isbn", "book_name", "author", "book_comp", "price",
|
|
"count", "out_per", "total", "in_price", "out_price", "in_per", "etc" };
|
|
string[] insert_data = { compidx, date, tb_date.Text, tb_list_name.Text, clt,
|
|
book[0], book[1], book[2], book[3], book[4],
|
|
book[5], out_per, total[0], total[1], total[2], book[6], etc };
|
|
|
|
db.DB_INSERT("Sales", col_name, insert_data);
|
|
}
|
|
private string[] Cal_out_price(string price_st, string count_st, string out_per_st, string in_per_st)
|
|
{
|
|
int price = Convert.ToInt32(price_st);
|
|
int count = Convert.ToInt32(count_st);
|
|
int in_per = Convert.ToInt32(in_per_st);
|
|
int out_per = Convert.ToInt32(out_per_st);
|
|
|
|
int total = price * count;
|
|
double in_price_db = total * in_per / 100;
|
|
int in_price = Convert.ToInt32(in_price_db);
|
|
double out_price_db = total * out_per / 100;
|
|
int out_price = Convert.ToInt32(out_price_db);
|
|
|
|
string[] result = { total.ToString(), in_price.ToString(), out_price.ToString() };
|
|
return result;
|
|
}
|
|
private string[] db_data_filter(List<string> l_book, string[] book)
|
|
{
|
|
if (l_book[0] == "") {
|
|
l_book.RemoveAt(0);
|
|
}
|
|
else if(l_book[0] != l_book[1]){
|
|
l_book.RemoveAt(1);
|
|
}
|
|
book = l_book.ToArray();
|
|
return book;
|
|
}
|
|
int cnt = 0; int pageNo = 1;
|
|
private void btn_print_Click(object sender, EventArgs e) // 인쇄
|
|
{
|
|
// TODO: 별도의 인쇄폼이 만들어져야함. (미리보기 구현 수정해야함)
|
|
// 08.18 TODO: 인쇄 보류.
|
|
//MessageBox.Show("보류");
|
|
//return;
|
|
|
|
printPreviewDialog1.Document = printDocument1;
|
|
printDocument1.DefaultPageSettings.Landscape = false;
|
|
if (printPreviewDialog1.ShowDialog() == DialogResult.Cancel)
|
|
{
|
|
cnt = 0;
|
|
pageNo = 1;
|
|
}
|
|
}
|
|
private void printDocument1_PrintPage(object sender, PrintPageEventArgs e)
|
|
{
|
|
int dialogWidth = 528; // 페이지 전체넓이 printPreviewDialog.Width
|
|
|
|
StringFormat sf = new StringFormat(); // 컬럼 안에 있는 값들 가운데 정렬
|
|
sf.Alignment = StringAlignment.Center;
|
|
int width, width1; // 시작점위치, datagrid 1개의 컬럼 가로길이
|
|
int startWidth = 10; // 시작 x좌표
|
|
int startHeight = 140; // 시작 y좌표
|
|
int avgHeight = dataGridView1.Rows[0].Height; // gridview 컬럼 하나의 높이
|
|
int temp = 0;
|
|
|
|
e.Graphics.DrawString("제목", new Font("Arial", 20, FontStyle.Bold), Brushes.Black, dialogWidth / 2, 40);
|
|
e.Graphics.DrawString("인쇄일 : " + DateTime.Now.ToString("yyyy/MM/dd"), new Font("Arial",13), Brushes.Black, dialogWidth-20,80);
|
|
e.Graphics.DrawString("페이지번호 : " + pageNo, new Font("Arial",13), Brushes.Black,dialogWidth-20, 100);
|
|
|
|
for (int i = 0; i < dataGridView1.ColumnCount; i++)
|
|
{
|
|
if (i == 0)
|
|
{
|
|
width = 0;
|
|
width1 = this.dataGridView1.Columns[i].Width + 15;
|
|
}
|
|
else if (i >= 1 && i < dataGridView1.ColumnCount - 2)
|
|
{
|
|
width = this.dataGridView1.Columns[i - 1].Width + 15;
|
|
width1 = this.dataGridView1.Columns[i].Width + 15;
|
|
}
|
|
else
|
|
{
|
|
width = this.dataGridView1.Columns[i - 1].Width + 15;
|
|
width1 = this.dataGridView1.Columns[i].Width + 40;
|
|
}
|
|
RectangleF drawRect = new RectangleF((float)(startWidth + width), (float)startHeight, (float)width1, avgHeight);
|
|
e.Graphics.DrawRectangle(Pens.Black, (float)(startWidth + width), (float)startHeight, (float)width1, avgHeight);
|
|
e.Graphics.DrawString(dataGridView1.Columns[i].HeaderText, new Font("Arial", 12, FontStyle.Bold), Brushes.Black, drawRect, sf);
|
|
|
|
startWidth += width;
|
|
}
|
|
startHeight += avgHeight;
|
|
|
|
for (int i = cnt; i < dataGridView1.RowCount - 1; i++) {
|
|
startWidth = 10;
|
|
for(int j = 0; j < dataGridView1.ColumnCount; j++) {
|
|
if (j == 0) {
|
|
width = 0;
|
|
width1 = this.dataGridView1.Columns[j].Width + 15;
|
|
}
|
|
else if (j >= 1 && j <= dataGridView1.ColumnCount - 2)
|
|
{
|
|
width = this.dataGridView1.Columns[j - 1].Width + 15;
|
|
width1 = this.dataGridView1.Columns[j].Width + 15;
|
|
}
|
|
else
|
|
{
|
|
width = this.dataGridView1.Columns[j - 1].Width + 15;
|
|
width1 = this.dataGridView1.Columns[j].Width + 40;
|
|
}
|
|
RectangleF drawRect = new RectangleF((float)(startWidth + width), (float)startHeight, (float)width1, avgHeight);
|
|
e.Graphics.DrawRectangle(Pens.Black, (float)(startWidth + width), (float)startHeight, (float)width1, avgHeight);
|
|
e.Graphics.DrawString(dataGridView1.Rows[i].Cells[j].FormattedValue.ToString(), new Font("Arial", 9), Brushes.Black, drawRect, sf);
|
|
startWidth += width;
|
|
}
|
|
startHeight += avgHeight;
|
|
temp++;
|
|
cnt++;
|
|
|
|
if (temp % 40 == 0)
|
|
{
|
|
MessageBox.Show("40으로 나눠졌다.");
|
|
e.HasMorePages = true;
|
|
pageNo++;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
private void btn_apply_Click(object sender, EventArgs e)
|
|
{
|
|
dataGridView1.Rows[row].Cells["list_name"].Value = tb_list_name.Text;
|
|
dataGridView1.Rows[row].Cells["list_date"].Value = tb_date.Text;
|
|
dataGridView1.Rows[row].Cells["date_res"].Value = tb_date_res.Text;
|
|
dataGridView1.Rows[row].Cells["charge"].Value = tb_charge.Text;
|
|
dataGridView1.Rows[row].Cells["work_name"].Value = tb_work_name.Text;
|
|
dataGridView1.Rows[row].Cells["work_way"].Value = tb_work_way.Text;
|
|
dataGridView1.Rows[row].Cells["send_way"].Value = tb_send_way.Text;
|
|
dataGridView1.Rows[row].Cells["total"].Value = tb_total.Text;
|
|
dataGridView1.Rows[row].Cells["stock_money"].Value = tb_stock.Text;
|
|
dataGridView1.Rows[row].Cells["count"].Value = tb_count.Text;
|
|
dataGridView1.Rows[row].Cells["Column13"].Value = tb_stock_per.Text;
|
|
dataGridView1.Rows[row].Cells["Column11"].Value = lbl_stock_count.Text;
|
|
dataGridView1.Rows[row].Cells["Column12"].Value = lbl_unstock_count.Text;
|
|
dataGridView1.Rows[row].Cells["Column20"].Value = tb_list_num.Text;
|
|
}
|
|
private void btn_checkup_Click(object sender, EventArgs e) // 검수작업 (내부 작업필요)
|
|
{
|
|
List_Chk_Work chk_work = new List_Chk_Work(this);
|
|
chk_work.TopMost = true;
|
|
chk_work.data[0] = tb_list_name.Text;
|
|
chk_work.data[1] = compidx;
|
|
chk_work.Show();
|
|
}
|
|
private void btn_ISBN_Click(object sender, EventArgs e) // ISBN조회
|
|
{
|
|
Check_ISBN isbn = new Check_ISBN(this);
|
|
isbn.list_name = tb_list_name.Text;
|
|
isbn.Show();
|
|
}
|
|
private void btn_date_Click(object sender, EventArgs e) // 일정
|
|
{
|
|
// TODO: 별도의 일정폼이 만들어져야함.
|
|
}
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
private void tb_clt_KeyDown(object sender, KeyEventArgs e)
|
|
{
|
|
if (e.KeyCode == Keys.Enter)
|
|
{
|
|
Commodity_Search sea = new Commodity_Search(this);
|
|
sea.Clinet_name = tb_clt.Text;
|
|
sea.Show();
|
|
}
|
|
}
|
|
private void combo_state_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
if(combo_state.Text == "진행")
|
|
{
|
|
combo_year.Visible = false;
|
|
}
|
|
else if(combo_state.Text == "완료")
|
|
{
|
|
combo_year.Visible = true;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 데이터그리드뷰 색상변경
|
|
/// </summary>
|
|
public void GridColorChange()
|
|
{
|
|
for (int a = 0; a < dataGridView1.Rows.Count; a++)
|
|
{
|
|
dataGridView1.Rows[a].DefaultCellStyle.BackColor = Color.Empty;
|
|
}
|
|
for (int a = 0; a < dataGridView1.Rows.Count; a++)
|
|
{
|
|
if (dataGridView1.Rows[a].Cells["chk_label"].Value.ToString() == "라벨")
|
|
{
|
|
dataGridView1.Rows[a].DefaultCellStyle.BackColor = Color.Yellow;
|
|
}
|
|
}
|
|
}
|
|
private void btn_close_Click(object sender, EventArgs e)
|
|
{
|
|
this.Close();
|
|
}
|
|
private void dataGridView1_KeyDown(object sender, KeyEventArgs e)
|
|
{
|
|
Skill_Grid skill = new Skill_Grid();
|
|
if(e.KeyCode == Keys.Delete)
|
|
{
|
|
skill.DataGrid_to_Delete(sender, e);
|
|
}
|
|
|
|
// gird 선택시 우측란에 해당 정보로 초기화 및 최신화
|
|
if(e.KeyCode == Keys.Up)
|
|
{
|
|
if (row > 0) { row -= 1; }
|
|
infor_Update(row);
|
|
}
|
|
if (e.KeyCode == Keys.Down)
|
|
{
|
|
if (row < dataGridView1.Rows.Count-1) { row += 1; }
|
|
infor_Update(row);
|
|
}
|
|
}
|
|
private void infor_reset()
|
|
{
|
|
tb_list_name.Text = "";
|
|
tb_date.Text = "";
|
|
tb_date_res.Text = "";
|
|
tb_charge.Text = "";
|
|
tb_work_name.Text = "";
|
|
tb_work_way.Text = "";
|
|
tb_send_way.Text = "";
|
|
tb_total.Text = "";
|
|
tb_stock.Text = "";
|
|
tb_count.Text = "";
|
|
tb_stock_per.Text = "";
|
|
lbl_stock_count.Text = "";
|
|
lbl_unstock_count.Text = "";
|
|
tb_list_num.Text = "";
|
|
}
|
|
private void infor_Update(int rowidx)
|
|
{
|
|
if (rowidx < 0) { return; }
|
|
row = rowidx;
|
|
infor_reset();
|
|
// 목록명
|
|
tb_list_name.Text = dataGridView1.Rows[rowidx].Cells["list_name"].Value.ToString();
|
|
// 목록일자
|
|
tb_date.Text = dataGridView1.Rows[rowidx].Cells["list_date"].Value.ToString().Substring(0,10);
|
|
// 완료일자
|
|
if (dataGridView1.Rows[rowidx].Cells["date_res"].Value.ToString().Length < 3) {
|
|
tb_date_res.Text = "";
|
|
}
|
|
else {
|
|
tb_date_res.Text = dataGridView1.Rows[rowidx].Cells["date_res"].Value.ToString().Substring(0, 10);
|
|
}
|
|
// 담당자
|
|
tb_charge.Text = dataGridView1.Rows[rowidx].Cells["charge"].Value.ToString();
|
|
// 작업명
|
|
tb_work_name.Text = dataGridView1.Rows[rowidx].Cells["work_name"].Value.ToString();
|
|
// 작업방법
|
|
tb_work_way.Text = dataGridView1.Rows[rowidx].Cells["work_way"].Value.ToString();
|
|
// 배송방법
|
|
tb_send_way.Text = dataGridView1.Rows[rowidx].Cells["send_way"].Value.ToString();
|
|
// 합계금액
|
|
tb_total.Text = dataGridView1.Rows[rowidx].Cells["total"].Value.ToString();
|
|
// 입고금액
|
|
tb_stock.Text = dataGridView1.Rows[rowidx].Cells["stock_money"].Value.ToString();
|
|
// 수량
|
|
tb_count.Text = dataGridView1.Rows[rowidx].Cells["count"].Value.ToString();
|
|
// 입고 / 미입고
|
|
lbl_stock_count.Text = dataGridView1.Rows[rowidx].Cells["Column11"].Value.ToString();
|
|
lbl_unstock_count.Text = dataGridView1.Rows[rowidx].Cells["Column12"].Value.ToString();
|
|
// 입고율
|
|
tb_stock_per.Text = dataGridView1.Rows[rowidx].Cells["Column13"].Value.ToString();
|
|
// 목록번호
|
|
tb_list_num.Text = dataGridView1.Rows[rowidx].Cells["Column20"].Value.ToString();
|
|
// 택배여부
|
|
if(dataGridView1.Rows[rowidx].Cells["Column18"].Value.ToString() == "") {
|
|
lbl_send_n.Font = new Font(this.Font, FontStyle.Bold);
|
|
lbl_send_y.Font = new Font(this.Font, FontStyle.Regular);
|
|
}
|
|
else { lbl_send_y.Font = new Font(this.Font, FontStyle.Bold);
|
|
lbl_send_n.Font = new Font(this.Font, FontStyle.Regular);
|
|
}
|
|
// 라벨여부
|
|
if (dataGridView1.Rows[rowidx].Cells["chk_label"].Value.ToString() == "라벨") {
|
|
lbl_l_y.Font = new Font(this.Font, FontStyle.Bold);
|
|
lbl_l_n.Font = new Font(this.Font, FontStyle.Regular);
|
|
}
|
|
else { lbl_l_n.Font = new Font(this.Font, FontStyle.Bold);
|
|
lbl_l_y.Font = new Font(this.Font, FontStyle.Regular);
|
|
}
|
|
}
|
|
private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
|
|
{
|
|
if (e.ColumnIndex != 2 || e.ColumnIndex != 4 || e.ColumnIndex != 5 ||
|
|
e.ColumnIndex != 6 || e.ColumnIndex != 15)
|
|
{
|
|
List_Lookup list_l = new List_Lookup(this);
|
|
list_l.call_base = dataGridView1.Rows[e.RowIndex].Cells["list_name"].Value.ToString();
|
|
list_l.MdiParent = main;
|
|
list_l.WindowState = FormWindowState.Maximized;
|
|
list_l.Show();
|
|
}
|
|
}
|
|
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
|
|
{
|
|
row = e.RowIndex;
|
|
infor_Update(e.RowIndex);
|
|
}
|
|
|
|
private void lbl_l_y_Click(object sender, EventArgs e)
|
|
{
|
|
if(((Label)sender).Name == "lbl_l_y") {
|
|
lbl_l_y.Font = new Font(this.Font, FontStyle.Bold);
|
|
lbl_l_n.Font = new Font(this.Font, FontStyle.Regular);
|
|
}
|
|
if(((Label)sender).Name == "lbl_l_n") {
|
|
lbl_l_y.Font = new Font(this.Font, FontStyle.Regular);
|
|
lbl_l_n.Font = new Font(this.Font, FontStyle.Bold);
|
|
}
|
|
if(((Label)sender).Name == "lbl_send_y")
|
|
{
|
|
lbl_send_y.Font = new Font(this.Font, FontStyle.Bold);
|
|
lbl_send_n.Font = new Font(this.Font, FontStyle.Regular);
|
|
}
|
|
if (((Label)sender).Name == "lbl_send_n")
|
|
{
|
|
lbl_send_y.Font = new Font(this.Font, FontStyle.Regular);
|
|
lbl_send_n.Font = new Font(this.Font, FontStyle.Bold);
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|