스케쥴 추가 기능
This commit is contained in:
@@ -27,22 +27,22 @@ namespace FPJ0000
|
||||
this.FormClosed += FProjectSchedule_FormClosed;
|
||||
this.FormClosing += FProjectSchedule_FormClosing;
|
||||
this.dsPRJ.EETGW_ProjectsSchedule.TableNewRow += ProjectsSchedule_TableNewRow;
|
||||
//this.dsPRJ.EETGW_ProjectReson.TableNewRow += EETGW_ProjectReson_TableNewRow;
|
||||
//this.dsPRJ.EETGW_ProjectReson.TableNewRow += EETGW_ProjectReson_TableNewRow;
|
||||
|
||||
this.KeyDown += FProjectSchedule_KeyDown;
|
||||
this.KeyDown += FProjectSchedule_KeyDown;
|
||||
}
|
||||
|
||||
private void FProjectSchedule_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if(e.KeyCode == Keys.F11)
|
||||
{
|
||||
private void FProjectSchedule_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.KeyCode == Keys.F11)
|
||||
{
|
||||
var cur = this.panel2.Visible;
|
||||
panel4.Visible = !cur;
|
||||
panel2.Visible = !cur;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void FProjectSchedule_FormClosing(object sender, FormClosingEventArgs e)
|
||||
private void FProjectSchedule_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
this.Validate();
|
||||
this.bs.EndEdit();
|
||||
@@ -66,19 +66,19 @@ namespace FPJ0000
|
||||
}
|
||||
private void EETGW_ProjectReson_TableNewRow(object sender, DataTableNewRowEventArgs e)
|
||||
{
|
||||
e.Row["wuid"] = FCOMMON.info.Login.no;
|
||||
e.Row["wdate"] = DateTime.Now;
|
||||
e.Row["project"] = this.projectindex;
|
||||
e.Row["gcode"] = FCOMMON.info.Login.gcode;
|
||||
if (e.Row["wuid"] == null) e.Row["wuid"] = FCOMMON.info.Login.no;
|
||||
if (e.Row["wdate"] == null) e.Row["wdate"] = DateTime.Now;
|
||||
if (e.Row["project"] == null) e.Row["project"] = this.projectindex;
|
||||
if (e.Row["gcode"] == null) e.Row["gcode"] = FCOMMON.info.Login.gcode;
|
||||
}
|
||||
|
||||
void ProjectsSchedule_TableNewRow(object sender, DataTableNewRowEventArgs e)
|
||||
{
|
||||
e.Row["wuid"] = FCOMMON.info.Login.no;
|
||||
e.Row["wdate"] = DateTime.Now;
|
||||
e.Row["project"] = this.projectindex;
|
||||
e.Row["appoval"] = 0; //신규추가는 확정안되는 데이터이다
|
||||
e.Row["no"] = int.Parse(this.comboBox1.Text);
|
||||
if (e.Row["wuid"] == null) e.Row["wuid"] = FCOMMON.info.Login.no;
|
||||
if (e.Row["wdate"] == null) e.Row["wdate"] = DateTime.Now;
|
||||
if (e.Row["project"] == null) e.Row["project"] = this.projectindex;
|
||||
if (e.Row["appoval"] == null) e.Row["appoval"] = 0; //신규추가는 확정안되는 데이터이다
|
||||
if (e.Row["no"] == null) e.Row["no"] = int.Parse(this.comboBox1.Text);
|
||||
}
|
||||
|
||||
private void fProjectSchedule_Load(object sender, EventArgs e)
|
||||
@@ -96,11 +96,15 @@ namespace FPJ0000
|
||||
var db = new EEEntities();
|
||||
var nolist = db.EETGW_ProjectsSchedule.AsNoTracking().Where(t => t.gcode == FCOMMON.info.Login.gcode && t.project == this.projectindex).GroupBy(t => t.no).ToList();
|
||||
this.comboBox1.Items.Clear();
|
||||
foreach (var item in nolist)
|
||||
if (nolist.Any())
|
||||
{
|
||||
if (item.Key == null) this.comboBox1.Items.Add("1");
|
||||
else this.comboBox1.Items.Add(item.Key.ToString());
|
||||
foreach (var item in nolist)
|
||||
{
|
||||
if (item.Key == null) continue;
|
||||
this.comboBox1.Items.Add(item.Key.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
db.Dispose();
|
||||
|
||||
if (this.comboBox1.Items.Count == 0)
|
||||
@@ -110,11 +114,8 @@ namespace FPJ0000
|
||||
this.comboBox1.Items.Add("1");
|
||||
this.comboBox1.SelectedIndex = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.comboBox1.SelectedIndex = this.comboBox1.Items.Count - 1;
|
||||
}
|
||||
this.comboBox1.Items.Add("스케쥴 추가");
|
||||
|
||||
// this.comboBox1.Items.Add("스케쥴 추가");
|
||||
|
||||
|
||||
RefreshData();
|
||||
@@ -131,6 +132,13 @@ namespace FPJ0000
|
||||
cmd.Connection.Close();
|
||||
cmd.Dispose();
|
||||
bInit = true;
|
||||
|
||||
|
||||
if (this.comboBox1.Items.Count > 0)
|
||||
{
|
||||
this.comboBox1.SelectedIndex = this.comboBox1.Items.Count - 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int CWW = 0;
|
||||
@@ -147,14 +155,13 @@ namespace FPJ0000
|
||||
}
|
||||
void RefreshData()
|
||||
{
|
||||
var scno = int.Parse(comboBox1.Text);
|
||||
// var scno = int.Parse(comboBox1.Text);
|
||||
try
|
||||
{
|
||||
//list = db.EETGW_ProjectsSchedule.Where(t => t.gcode == FCOMMON.info.Login.gcode && t.project == this.projectindex).OrderBy(t => t.seq).ToList();
|
||||
|
||||
this.ta.Fill(this.dsPRJ.EETGW_ProjectsSchedule, FCOMMON.info.Login.gcode, this.projectindex, scno);
|
||||
this.ta.Fill(this.dsPRJ.EETGW_ProjectsSchedule, FCOMMON.info.Login.gcode, this.projectindex);
|
||||
this.taTodo.Fill(this.dsPRJ.EETGW_ProjectToDo, this.projectindex);
|
||||
this.taReason.Fill(this.dsPRJ.EETGW_ProjectReson, FCOMMON.info.Login.gcode, this.projectindex, int.Parse(comboBox1.Text));
|
||||
this.taReason.Fill(this.dsPRJ.EETGW_ProjectReson, FCOMMON.info.Login.gcode, this.projectindex);
|
||||
//this.bs.DataSource = list;//.ToList();// db.EETGW_ProjectsSchedule.Local;
|
||||
//this.fpSpread1_Sheet1.DataSource = this.bs;
|
||||
FPUtil.ColSizeLoad(ref this.fpSpread1, fn_fpcolsize1);
|
||||
@@ -166,41 +173,6 @@ namespace FPJ0000
|
||||
}
|
||||
Application.DoEvents();
|
||||
|
||||
//해당스케쥴의 승인상태를 확인
|
||||
var db = new EEEntities();
|
||||
var dr = db.EETGW_ProjectsSchedule.Where(t => t.project == this.projectindex && t.no == scno).FirstOrDefault();
|
||||
if (dr == null || dr.appoval == 0)
|
||||
{
|
||||
chkapp1.Checked = false;
|
||||
chkapp2.Checked = false;
|
||||
|
||||
|
||||
}
|
||||
else if (dr.appoval == 1)
|
||||
{
|
||||
chkapp1.Checked = true;
|
||||
chkapp2.Checked = false;
|
||||
|
||||
this.fpSpread1.Sheets[0].Columns[2].Locked = true;
|
||||
this.fpSpread1.Sheets[0].Columns[3].Locked = true;
|
||||
this.fpSpread1.Sheets[0].Columns[2].BackColor = Color.FromArgb(230, 230, 230);
|
||||
this.fpSpread1.Sheets[0].Columns[3].BackColor = Color.FromArgb(230, 230, 230);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
chkapp1.Checked = true;
|
||||
chkapp2.Checked = true;
|
||||
|
||||
this.fpSpread1.Sheets[0].Columns[2].Locked = true;
|
||||
this.fpSpread1.Sheets[0].Columns[3].Locked = true;
|
||||
this.fpSpread1.Sheets[0].Columns[2].BackColor = Color.FromArgb(230, 230, 230);
|
||||
this.fpSpread1.Sheets[0].Columns[3].BackColor = Color.FromArgb(230, 230, 230);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -264,6 +236,8 @@ namespace FPJ0000
|
||||
newdr.project = this.projectindex;
|
||||
newdr.seq = this.bs.Count + 1;
|
||||
newdr.gcode = FCOMMON.info.Login.gcode;
|
||||
newdr.no = int.Parse(comboBox1.Text);
|
||||
newdr.memo = string.Empty;
|
||||
dsPRJ.EETGW_ProjectsSchedule.AddEETGW_ProjectsScheduleRow(newdr);
|
||||
|
||||
this.bs.EndEdit();
|
||||
@@ -299,7 +273,13 @@ namespace FPJ0000
|
||||
bnTodo.Enabled = true;
|
||||
|
||||
this.bsTodo.Filter = "pseq=" + dr.idx; //해당데이터만 처리하게 한다
|
||||
this.bsReason.Filter = "pseq=" + dr.idx;
|
||||
|
||||
if (int.TryParse(comboBox1.Text, out int pno))
|
||||
{
|
||||
var filter_reason = $"no={pno} and pseq={ dr.idx}";
|
||||
this.bsReason.Filter = filter_reason;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -379,7 +359,9 @@ namespace FPJ0000
|
||||
|
||||
private void panel1_Paint(object sender, PaintEventArgs e)
|
||||
{
|
||||
var list = this.dsPRJ.EETGW_ProjectsSchedule.Where(t => t.RowState != DataRowState.Deleted).Where(t => t.RowState != DataRowState.Detached).OrderBy(t => t.seq).ToList();
|
||||
if (int.TryParse(comboBox1.Text, out int scno) == false) return;
|
||||
|
||||
var list = this.dsPRJ.EETGW_ProjectsSchedule.Where(t => t.RowState != DataRowState.Deleted).Where(t => t.RowState != DataRowState.Detached).Where(t=>t.no == scno).OrderBy(t => t.seq).ToList();
|
||||
e.Graphics.Clear(Color.DimGray);
|
||||
//e.Graphics.DrawString(list.Count.ToString(), this.Font, Brushes.White, 10, 10);
|
||||
var colsize = new int[] { 50 };
|
||||
@@ -389,7 +371,7 @@ namespace FPJ0000
|
||||
if (list == null || list.Count < 1) return;
|
||||
|
||||
|
||||
var totalProgress = list.Sum(t=>t.progress) / list.Count();
|
||||
var totalProgress = list.Sum(t => t.progress) / list.Count();
|
||||
|
||||
var vsw_s = list.Max(t => t.sw);
|
||||
var vew_s = list.Max(t => t.ew);
|
||||
@@ -459,7 +441,7 @@ namespace FPJ0000
|
||||
var curyw = $"{DateTime.Now.Year.ToString("0000").Substring(2)}y{this.CWW:00}w";
|
||||
var curww = int.Parse($"{DateTime.Now.Year.ToString("0000").Substring(2)}{this.CWW:00}");
|
||||
var ProjecComplete = totalProgress > 99;
|
||||
if(ProjecComplete == false)
|
||||
if (ProjecComplete == false)
|
||||
{
|
||||
maxw = Math.Max(curww, maxw);
|
||||
}
|
||||
@@ -482,7 +464,7 @@ namespace FPJ0000
|
||||
var ci = 0;
|
||||
var titlewi = 200f;
|
||||
var twidth = (rect_title.Width - titlewi) / (cols.Count - 1);
|
||||
|
||||
|
||||
foreach (var col in cols)
|
||||
{
|
||||
|
||||
@@ -500,7 +482,7 @@ namespace FPJ0000
|
||||
e.Graphics.DrawString(col, this.Font, Brushes.White, rect, new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center });
|
||||
}
|
||||
e.Graphics.DrawRectangle(Pens.Black, rect.Left, rect.Top, rect.Width, rect.Height);
|
||||
|
||||
|
||||
ci += 1;
|
||||
}
|
||||
|
||||
@@ -563,7 +545,7 @@ namespace FPJ0000
|
||||
ci = 0;
|
||||
foreach (var col in cols)
|
||||
{
|
||||
var ww = ci == 0 ? 0 : int.Parse(col.Substring(0, 2) + col.Substring(3,2));// minw + (ci - 1);
|
||||
var ww = ci == 0 ? 0 : int.Parse(col.Substring(0, 2) + col.Substring(3, 2));// minw + (ci - 1);
|
||||
var titleWidth = ci == 0 ? titlewi : twidth;
|
||||
var padX = ci > 0 ? ((ci - 1) * twidth + titlewi) : 0;
|
||||
|
||||
@@ -580,7 +562,7 @@ namespace FPJ0000
|
||||
if (ci == 0)
|
||||
{
|
||||
//각 담당자 이름과 항목 이름을 표시한다
|
||||
if(isBusy==false)
|
||||
if (isBusy == false)
|
||||
{
|
||||
e.Graphics.DrawString(str + "\n" + dr.uid,
|
||||
this.Font,
|
||||
@@ -591,7 +573,7 @@ namespace FPJ0000
|
||||
}
|
||||
else
|
||||
{
|
||||
if(dr.progress < 1)
|
||||
if (dr.progress < 1)
|
||||
{
|
||||
e.Graphics.DrawString(str + "\n" + dr.uid + $"\n\n[시작 안함]",
|
||||
this.Font,
|
||||
@@ -609,13 +591,13 @@ namespace FPJ0000
|
||||
new StringFormat { Alignment = StringAlignment.Near, LineAlignment = StringAlignment.Center }
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if(col == "22y02w" && ew == 2202)
|
||||
if (col == "22y02w" && ew == 2202)
|
||||
Console.WriteLine("sdf");
|
||||
|
||||
//plan
|
||||
@@ -796,11 +778,46 @@ namespace FPJ0000
|
||||
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (bInit == false) return;
|
||||
if (comboBox1.SelectedIndex == this.comboBox1.Items.Count - 1)
|
||||
|
||||
//해당 데이터만 표시한다.
|
||||
this.bs.Filter = "no = " + this.comboBox1.Text;
|
||||
this.bs.Sort = "seq";
|
||||
this.bsReason.Filter = "no = " + this.comboBox1.Text;
|
||||
|
||||
|
||||
//해당스케쥴의 승인상태를 확인
|
||||
var scno = int.Parse(comboBox1.Text);
|
||||
var db = new EEEntities();
|
||||
var dr = db.EETGW_ProjectsSchedule.Where(t => t.project == this.projectindex && t.no == scno).FirstOrDefault();
|
||||
if (dr == null || dr.appoval == 0)
|
||||
{
|
||||
util.MsgE("스케쥴 신규 추가 기능은 준비 중 입니다");
|
||||
this.comboBox1.SelectedIndex = this.comboBox1.Items.Count - 2;
|
||||
chkapp1.Checked = false;
|
||||
chkapp2.Checked = false;
|
||||
|
||||
|
||||
}
|
||||
else if (dr.appoval == 1)
|
||||
{
|
||||
chkapp1.Checked = true;
|
||||
chkapp2.Checked = false;
|
||||
|
||||
this.fpSpread1.Sheets[0].Columns[2].Locked = true;
|
||||
this.fpSpread1.Sheets[0].Columns[3].Locked = true;
|
||||
this.fpSpread1.Sheets[0].Columns[2].BackColor = Color.FromArgb(230, 230, 230);
|
||||
this.fpSpread1.Sheets[0].Columns[3].BackColor = Color.FromArgb(230, 230, 230);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
chkapp1.Checked = true;
|
||||
chkapp2.Checked = true;
|
||||
|
||||
this.fpSpread1.Sheets[0].Columns[2].Locked = true;
|
||||
this.fpSpread1.Sheets[0].Columns[3].Locked = true;
|
||||
this.fpSpread1.Sheets[0].Columns[2].BackColor = Color.FromArgb(230, 230, 230);
|
||||
this.fpSpread1.Sheets[0].Columns[3].BackColor = Color.FromArgb(230, 230, 230);
|
||||
}
|
||||
this.panel1.Refresh();
|
||||
}
|
||||
|
||||
private void toolStripButton15_Click(object sender, EventArgs e)
|
||||
@@ -844,5 +861,48 @@ namespace FPJ0000
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void toolStripButton19_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
var dlg = util.MsgQ("스케쥴을 추가 하시겠습니까? 스케쥴 추가는 각 관리자에 협의 후 하시기 바랍니다");
|
||||
if (dlg != DialogResult.Yes) return;
|
||||
|
||||
int maxno = 1;
|
||||
var maxdata = dsPRJ.EETGW_ProjectsSchedule.Where(t => t.gcode == FCOMMON.info.Login.gcode && t.project == this.projectindex);
|
||||
if (maxdata.Any() == false) maxno = maxdata.Max(t => t.no);
|
||||
|
||||
var newno = maxno + 1;
|
||||
this.comboBox1.Items.Add($"{newno}");
|
||||
|
||||
//기존목록을 복사함
|
||||
var seq = 1;
|
||||
foreach (dsPRJ.EETGW_ProjectsScheduleRow dr in this.dsPRJ.EETGW_ProjectsSchedule.Where(t => t.gcode == FCOMMON.info.Login.gcode && t.project == this.projectindex && t.no == maxno).OrderBy(t => t.seq))
|
||||
{
|
||||
var newdr = this.dsPRJ.EETGW_ProjectsSchedule.NewEETGW_ProjectsScheduleRow();
|
||||
newdr.no = newno;
|
||||
newdr.seq = seq++;
|
||||
newdr.wuid = FCOMMON.info.Login.no;
|
||||
newdr.wdate = DateTime.Now;
|
||||
newdr.gcode = dr.gcode;
|
||||
newdr.project = dr.project;
|
||||
newdr.title = dr.title;
|
||||
newdr.sw = dr.sw;
|
||||
newdr.ew = dr.ew;
|
||||
newdr.swa = dr.swa;
|
||||
newdr.ewa = dr.ewa;
|
||||
newdr.memo = dr.memo;
|
||||
newdr.progress = dr.progress;
|
||||
newdr.uid = dr.uid;
|
||||
newdr.appoval = 0;
|
||||
newdr.cate = dr.cate;
|
||||
if (newdr.IsmemoNull()) newdr.memo = string.Empty;
|
||||
dsPRJ.EETGW_ProjectsSchedule.AddEETGW_ProjectsScheduleRow(newdr);
|
||||
newdr.EndEdit();
|
||||
}
|
||||
|
||||
this.comboBox1.SelectedIndex = this.comboBox1.Items.Count - 1;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user