------------------------ =====* ISBN 체크 프로그램 *===== ★작업완료★ a. 현재 마크팀 배포완료. - 추후 수정사항발생시 수정할 것. ------------------------ ===== 작업중 ===== 목록집계 폼 재 수정작업 완료 - 확인 및 수정 필요. 주문관리 폼 재 수정작업중 ===== 보류 ===== 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 완료
132 lines
5.1 KiB
C#
132 lines
5.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.Delivery;
|
|
|
|
namespace WindowsFormsApp1.Account
|
|
{
|
|
public partial class Purchase_Book : Form
|
|
{
|
|
Main main;
|
|
Purchase_Aggregation pa;
|
|
Helper_DB db = new Helper_DB();
|
|
public bool call = false;
|
|
public string compidx;
|
|
bool chk_ac = false;
|
|
public Purchase_Book(Main _main)
|
|
{
|
|
InitializeComponent();
|
|
main = _main;
|
|
compidx = main.com_idx;
|
|
}
|
|
public Purchase_Book(Purchase_Aggregation _pa)
|
|
{
|
|
InitializeComponent();
|
|
pa = _pa;
|
|
compidx = pa.compidx;
|
|
call = true;
|
|
}
|
|
private void Purchase_Book_Load(object sender, EventArgs e)
|
|
{
|
|
db.DBcon();
|
|
if (pa == null) {
|
|
start_Date.Value = new DateTime(int.Parse(DateTime.Now.ToString("yyyy")),
|
|
int.Parse(DateTime.Now.ToString("MM")), 1);
|
|
}
|
|
}
|
|
public void btn_Lookup_Click(object sender, EventArgs e)
|
|
{
|
|
if(call != false) { db.DBcon(); }
|
|
dataGridView1.Rows.Clear();
|
|
if (tb_purchase.Text == "") { return; }
|
|
string Select_Area = "`buy_date`, `book_name`, `count`, `persent`, `buy_money`, `payment`, `etc`";
|
|
string[] Search_col = { "compidx", "purchase" };
|
|
string[] Search_data = { compidx, tb_purchase.Text };
|
|
|
|
string db_tmp = db.More_DB_Search("Buy_ledger", Search_col, Search_data, Select_Area);
|
|
string[] db_data = db_tmp.Split('|');
|
|
input_Grid(db_data);
|
|
}
|
|
private void input_Grid(string[] db_data)
|
|
{
|
|
/* 매입일자 내용 수량 입고율 매입금액
|
|
* 결제금액 현잔액 비고 */
|
|
string[] grid = { "", "", "", "", "0",
|
|
"0", "0", "" };
|
|
|
|
for (int a = 0; a < db_data.Length - 1; a++)
|
|
{
|
|
if (a % 7 == 0) { grid[0] = db_data[a].Substring(0, 10); } // 매입일자
|
|
if (a % 7 == 1) { grid[1] = db_data[a]; } // 내용
|
|
if (a % 7 == 2) { grid[2] = db_data[a]; } // 수량
|
|
if (a % 7 == 3) { grid[3] = db_data[a]; } // 입고율
|
|
if (a % 7 == 4) { grid[4] = db_data[a]; } // 매입금액
|
|
if (a % 7 == 5) { grid[5] = db_data[a]; } // 결제금액
|
|
if (a % 7 == 6) { grid[7] = db_data[a]; Grid_Sub(grid); } // 비고
|
|
}
|
|
}
|
|
/* Grid 1행에 매입일자 쪽에 "이월미수금" 단어가 표출되며,
|
|
* 현 잔액에 이전에 있었던 거래 금액들이 계산되어 표출된다.
|
|
*/
|
|
private void Grid_Sub(string[] grid)
|
|
{
|
|
string str_start = start_Date.Value.ToString().Substring(0, 10);
|
|
string str_end = end_Date.Value.ToString().Substring(0, 10);
|
|
|
|
bool chk_grid = false;
|
|
|
|
if (DateTime.Parse(str_start) <= DateTime.Parse(grid[0]) &&
|
|
DateTime.Parse(str_end) >= DateTime.Parse(grid[0])) {
|
|
string[] account = {"이월미수금", "", "", "", "",
|
|
"", grid[6], ""};
|
|
if (dataGridView1.Rows.Count==0) {
|
|
account[6] = String.Format("{0:#,###}", Convert.ToInt32(account[6]));
|
|
dataGridView1.Rows.Add(account);
|
|
chk_ac = true;
|
|
}
|
|
chk_grid = true;
|
|
}
|
|
// 현잔액 = 매입금액 - 결제금액
|
|
int buy = Convert.ToInt32(grid[4]);
|
|
int pay = Convert.ToInt32(grid[5]);
|
|
int remain = Convert.ToInt32(grid[6].Replace(",", ""));
|
|
remain += buy - pay;
|
|
grid[6] = remain.ToString();
|
|
|
|
if (chk_grid == true) {
|
|
grid[2] = String.Format("{0:#,###}", Convert.ToInt32(grid[2]));
|
|
grid[4] = String.Format("{0:#,###}", Convert.ToInt32(grid[4]));
|
|
grid[5] = String.Format("{0:#,###}", Convert.ToInt32(grid[5]));
|
|
grid[6] = String.Format("{0:#,###}", Convert.ToInt32(grid[6]));
|
|
dataGridView1.Rows.Add(grid);
|
|
}
|
|
}
|
|
private void btn_Print_Click(object sender, EventArgs e)
|
|
{
|
|
|
|
}
|
|
private void tb_purchase_KeyDown(object sender, KeyEventArgs e)
|
|
{
|
|
if (e.KeyCode == Keys.Enter)
|
|
{
|
|
/* TODO: 완성시 주석 해제
|
|
Order_input_Search search = new Order_input_Search(this);
|
|
search.Where_Open = "Order";
|
|
search.TopMost = true;
|
|
search.Show(); */
|
|
btn_Lookup_Click(null, null);
|
|
}
|
|
}
|
|
private void btn_Close_Click(object sender, EventArgs e)
|
|
{
|
|
Close();
|
|
}
|
|
}
|
|
}
|