프로젝트편집에 일 업무현황 등록과 todo 항목 추가

This commit is contained in:
chi
2021-01-12 21:42:36 +09:00
parent dbe1a6cb87
commit 445bbe3514
42 changed files with 11628 additions and 1244 deletions

View File

@@ -1,10 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace FPJ0000
@@ -38,7 +35,7 @@ namespace FPJ0000
this.cmbProcess.DataSource = dt_eetproc;
//분류 - 190903
var dt_cate = FCOMMON.DBM.getCodeTable("20");
var dt_cate = FCOMMON.DBM.getCodeTable("20", "code");
this.cmbCate.DisplayMember = "Value";
this.cmbCate.ValueMember = "Value";
this.cmbCate.DataSource = dt_cate;
@@ -64,6 +61,10 @@ namespace FPJ0000
//주간일지내역을 업데이트
refresh_History();
//일업무현황 업데이트
this.taHistD.Fill(this.dsPRJ.EETGW_ProjecthistoryD, this.dr.idx);
//todo 업데이트
refreshTodo();
try
{
if (dr.idx >= 0)
@@ -121,9 +122,12 @@ namespace FPJ0000
this.Validate();
this.bs.EndEdit();
this.bsWeek.EndEdit();
this.bsHistWeek.EndEdit();
this.bsHistDay.EndEdit();
this.bsTodo.EndEdit();
this.taToDo.Update(this.dsPRJ.EETGW_ProjectToDo);
this.taHist.Update(this.dsPRJ.ProjectsHistory);
this.taHistD.Update(this.dsPRJ.EETGW_ProjecthistoryD);
this.DialogResult = System.Windows.Forms.DialogResult.OK;
//this.tableAdapterManager.UpdateAll(this.dsPRJ);
}
@@ -169,12 +173,12 @@ namespace FPJ0000
private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e)
{
var drv = this.bsWeek.Current as DataRowView;
var drv = this.bsHistWeek.Current as DataRowView;
if (drv == null) return;
var dlg = FCOMMON.Util.MsgQ("선택된 업무현황을 삭제하시겠습니까?" +
"\n\n메일이 발송 완료된 경우 발송된 메일은 삭제되지 않습니다.");
if (dlg == System.Windows.Forms.DialogResult.Yes)
this.bsWeek.RemoveCurrent();
this.bsHistWeek.RemoveCurrent();
}
private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e)
@@ -183,7 +187,7 @@ namespace FPJ0000
var f = new fHistAdd(newdr);
if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
bsWeek.EndEdit();
bsHistWeek.EndEdit();
this.dsPRJ.ProjectsHistory.AddProjectsHistoryRow(newdr);
}
else newdr.Delete();
@@ -213,7 +217,7 @@ namespace FPJ0000
private void btwEdit_Click(object sender, EventArgs e)
{
var drv = this.bsWeek.Current as DataRowView;
var drv = this.bsHistWeek.Current as DataRowView;
if (drv == null) return;
var newdr = drv.Row as dsPRJ.ProjectsHistoryRow;
@@ -317,7 +321,7 @@ namespace FPJ0000
private void rtBack_Click(object sender, EventArgs e)
{
}
private void rtBack_DoubleClick(object sender, EventArgs e)
@@ -327,5 +331,141 @@ namespace FPJ0000
if (f.ShowDialog() == DialogResult.OK)
rt.Rtf = f.richTextBoxEx1.Rtf;
}
private void toolStripButton5_Click(object sender, EventArgs e)
{
//일업무현황 추가
var newdr = this.dsPRJ.EETGW_ProjecthistoryD.NewEETGW_ProjecthistoryDRow();
newdr.wuid = FCOMMON.info.Login.no;
newdr.wdate = DateTime.Now;
newdr.pidx = this.dr.idx;
newdr.pdate = DateTime.Now.ToShortDateString();
var f = new fHistAddDay(newdr);
if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
this.bsHistDay.EndEdit();
this.dsPRJ.EETGW_ProjecthistoryD.AddEETGW_ProjecthistoryDRow(newdr);
}
else newdr.Delete();
}
private void toolStripButton6_Click(object sender, EventArgs e)
{
var drv = this.bsHistDay.Current as DataRowView;
if (drv == null) return;
var newdr = drv.Row as dsPRJ.EETGW_ProjecthistoryDRow;
var f = new fHistAddDay(newdr);
if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
newdr.EndEdit();
}
}
private void toolStripButton7_Click(object sender, EventArgs e)
{
var drv = this.bsHistDay.Current as DataRowView;
if (drv == null) return;
var dlg = FCOMMON.Util.MsgQ("선택된 일 업무 현황을 삭제하시겠습니까?");
if (dlg == System.Windows.Forms.DialogResult.Yes)
this.bsHistDay.RemoveCurrent();
}
private void toolStripButton15_Click(object sender, EventArgs e)
{
refreshTodo();
}
void refreshTodo()
{
taToDo.Fill(this.dsPRJ.EETGW_ProjectToDo, this.dr.idx);
this.dataGridView3.AutoResizeColumns();
updatetimetable();
formmatingdata();
}
private void toolStripButton12_Click(object sender, EventArgs e)
{
//add
var newdr = this.dsPRJ.EETGW_ProjectToDo.NewEETGW_ProjectToDoRow();
newdr.pidx = this.dr.idx;
newdr.wuid = FCOMMON.info.Login.no;
newdr.wdate = DateTime.Now;
this.dsPRJ.EETGW_ProjectToDo.AddEETGW_ProjectToDoRow(newdr);
}
private void toolStripButton13_Click(object sender, EventArgs e)
{
//edit
}
private void toolStripButton14_Click(object sender, EventArgs e)
{
//delete
this.bsTodo.RemoveCurrent();
}
private void toolStripButton16_Click(object sender, EventArgs e)
{
}
void updatetimetable()
{
this.panel9.Invalidate();
}
void formmatingdata()
{
//색상을 변경해준다. (그룹은 자료가 있으나, 항목에 자료가 없다면 타이틀이다)
foreach (DataGridViewRow dr in this.dataGridView3.Rows)
{
var o_grp = dr.Cells[1].Value;
var o_item = dr.Cells[4].Value;
var v_grp = string.Empty;
var v_item = string.Empty;
if (o_grp != null) v_grp = o_grp.ToString();
if (o_item != null) v_item = o_item.ToString();
if (v_grp.Equals("") == false && v_item.Equals(""))
dr.DefaultCellStyle.BackColor = System.Drawing.Color.White;
else
dr.DefaultCellStyle.BackColor = System.Drawing.Color.FromArgb(220, 220, 220);
}
}
private void toolStripButton13_Click_1(object sender, EventArgs e)
{
//save
try
{
this.Validate();
this.bsTodo.EndEdit();
var cnt = taToDo.Update(this.dsPRJ.EETGW_ProjectToDo);
this.dataGridView3.AutoResizeColumns();
updatetimetable();
}
catch (Exception ex)
{
FCOMMON.Util.MsgE(ex.Message);
}
}
private void panel9_Paint(object sender, PaintEventArgs e)
{
//타임테이블을 그린다.
e.Graphics.Clear(System.Drawing.Color.Black);
e.Graphics.DrawString("time table", this.Font, System.Drawing.Brushes.White, 10, 10);
var lst = this.dsPRJ.EETGW_ProjectToDo.Where(t => t.title == null).OrderBy(t => t.sort).ToList();
if (lst.Count < 1) return;
var strh = panel9.Height / lst.Count;
for (int i = 0; i < lst.Count; i++)
{
var y = strh * i;
e.Graphics.DrawLine(System.Drawing.Pens.Yellow, 0, y, panel9.Width, y);
}
foreach (dsPRJ.EETGW_ProjectToDoRow dr in lst)
{
e.Graphics.DrawString(dr.title, this.Font, System.Drawing.Brushes.Black, 10, 10);
}
}
}
}