간트차트 변경
This commit is contained in:
@@ -13,7 +13,7 @@ namespace FPJ0000
|
||||
{
|
||||
string fn_fpcolsize1 = "";
|
||||
string fn_fpcolsize2 = "";
|
||||
int projectindex = 0;
|
||||
int projectindex = 0;
|
||||
EEEntities db;
|
||||
Boolean bInit = false;
|
||||
|
||||
@@ -30,8 +30,6 @@ namespace FPJ0000
|
||||
//this.dsPRJ.EETGW_ProjectReson.TableNewRow += EETGW_ProjectReson_TableNewRow;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void FProjectSchedule_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
this.Validate();
|
||||
@@ -378,6 +376,9 @@ namespace FPJ0000
|
||||
|
||||
if (list == null || list.Count < 1) return;
|
||||
|
||||
|
||||
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);
|
||||
var vswa_s = list.Max(t => t.swa);
|
||||
@@ -443,14 +444,20 @@ namespace FPJ0000
|
||||
if (mvewa > 0) minw = Math.Min(minw, mvewa);
|
||||
if (minw == 9999) return; //값이 없다.
|
||||
|
||||
|
||||
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)
|
||||
{
|
||||
maxw = Math.Max(curww, maxw);
|
||||
}
|
||||
var wwcnt = maxw - minw + 1;
|
||||
for (int i = 1; i <= wwcnt; i++)
|
||||
{
|
||||
var yy = (int)((minw + (i-1)) / 100);
|
||||
var ww = (minw + (i-1) - yy * 100);
|
||||
var yy = (int)((minw + (i - 1)) / 100);
|
||||
var ww = (minw + (i - 1) - yy * 100);
|
||||
if (ww > 52 || ww < 1) continue;
|
||||
cols.Add($"{yy}y{ww}w");// "ww" + (minw + i - 1).ToString());//
|
||||
cols.Add($"{yy}y{ww:00}w");// "ww" + (minw + i - 1).ToString());//
|
||||
}
|
||||
|
||||
|
||||
@@ -463,13 +470,23 @@ namespace FPJ0000
|
||||
var ci = 0;
|
||||
var titlewi = 200f;
|
||||
var twidth = (rect_title.Width - titlewi) / (cols.Count - 1);
|
||||
|
||||
foreach (var col in cols)
|
||||
{
|
||||
|
||||
var titleWidth = ci == 0 ? titlewi : twidth;
|
||||
var padX = ci > 0 ? ((ci - 1) * twidth + titlewi) : 0;
|
||||
var rect = new RectangleF(rect_title.Left + padX, rect_title.Top, titleWidth, rect_title.Height);
|
||||
if (col == curyw)
|
||||
{
|
||||
e.Graphics.FillRectangle(Brushes.DeepSkyBlue, rect);
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Graphics.FillRectangle(Brushes.DimGray, rect);
|
||||
}
|
||||
e.Graphics.DrawRectangle(Pens.Black, rect.Left, rect.Top, rect.Width, rect.Height);
|
||||
e.Graphics.DrawString(col, this.Font, Brushes.Gold, rect, new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center });
|
||||
e.Graphics.DrawString(col, this.Font, Brushes.Black, rect, new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center });
|
||||
ci += 1;
|
||||
}
|
||||
|
||||
@@ -479,9 +496,9 @@ namespace FPJ0000
|
||||
var rect = new RectangleF(rect_body.Left, rect_body.Top + i * lineheight + ((i + 1) * 2), linewidth, lineheight);
|
||||
|
||||
if (i % 2 == 0)
|
||||
e.Graphics.FillRectangle(Brushes.Gray, rect.Left, rect.Top, rect.Width, rect.Height);
|
||||
e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(25, 25, 25)), rect.Left, rect.Top, rect.Width, rect.Height);
|
||||
else
|
||||
e.Graphics.FillRectangle(Brushes.DimGray, rect.Left, rect.Top, rect.Width, rect.Height);
|
||||
e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(35, 35, 35)), rect.Left, rect.Top, rect.Width, rect.Height);
|
||||
|
||||
Color PBg = Color.SkyBlue;
|
||||
Color ABg = Color.Gold;
|
||||
@@ -515,8 +532,8 @@ namespace FPJ0000
|
||||
ewa = int.Parse(dr.ewa.Replace("-", ""));//.Split('-')[1]);
|
||||
}
|
||||
catch { }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (sw == 0) { sw = minw; PBg = Color.Transparent; }
|
||||
@@ -525,14 +542,14 @@ namespace FPJ0000
|
||||
var isEmpty = swa == 0;
|
||||
if (swa == 0) { swa = minw; ABg = Color.Transparent; };
|
||||
var isBusy = ewa == 0; //아직 완료되지 않았다
|
||||
if (ewa == 0) ewa = swa;
|
||||
if (ewa == 0) ewa = int.Parse(DateTime.Now.Year.ToString().Substring(2) + this.CWW.ToString("00")); // swa;
|
||||
if (isBusy && ABg != Color.Transparent) ABg = Color.Pink;
|
||||
|
||||
|
||||
ci = 0;
|
||||
foreach (var col in cols)
|
||||
{
|
||||
var ww = 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;
|
||||
|
||||
@@ -541,23 +558,52 @@ namespace FPJ0000
|
||||
var rect2L = new RectangleF(rect2T.Left, rect2T.Bottom, rect2T.Width, rect2T.Height);
|
||||
|
||||
|
||||
var spacing = 3f;
|
||||
var spacing = 1f;
|
||||
var rect2TP = new RectangleF(rect2T.Left + spacing, rect2T.Top + spacing, rect2T.Width - spacing * 2, rect2T.Height - spacing * 2);
|
||||
var rect2BP = new RectangleF(rect2L.Left + spacing, rect2L.Top + spacing, rect2L.Width - spacing * 2, rect2L.Height - spacing * 2);
|
||||
|
||||
var str = ci == 0 ? dr.title : ww.ToString();
|
||||
if (ci == 0)
|
||||
{
|
||||
//e.Graphics.DrawRectangle(Pens.Black, rect2.Left, rect2.Top, rect2.Width, rect2.Height);
|
||||
e.Graphics.DrawString(str + "\n" + dr.uid,
|
||||
//각 담당자 이름과 항목 이름을 표시한다
|
||||
if(isBusy==false)
|
||||
{
|
||||
e.Graphics.DrawString(str + "\n" + dr.uid,
|
||||
this.Font,
|
||||
Brushes.Gold,
|
||||
(isBusy ? Brushes.WhiteSmoke : Brushes.Lime),
|
||||
rect2,
|
||||
new StringFormat { Alignment = StringAlignment.Near, LineAlignment = StringAlignment.Center }
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(dr.progress < 1)
|
||||
{
|
||||
e.Graphics.DrawString(str + "\n" + dr.uid + $"\n\n[시작 안함]",
|
||||
this.Font,
|
||||
(isBusy ? (dr.progress < 1 ? Brushes.Tomato : Brushes.WhiteSmoke) : Brushes.Lime),
|
||||
rect2,
|
||||
new StringFormat { Alignment = StringAlignment.Near, LineAlignment = StringAlignment.Center }
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Graphics.DrawString(str + "\n" + dr.uid + $"\n\n[{dr.progress:N1}% 진행 중]",
|
||||
this.Font,
|
||||
(isBusy ? (dr.progress < 1 ? Brushes.Tomato : Brushes.WhiteSmoke) : Brushes.Lime),
|
||||
rect2,
|
||||
new StringFormat { Alignment = StringAlignment.Near, LineAlignment = StringAlignment.Center }
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if(col == "22y02w" && ew == 2202)
|
||||
Console.WriteLine("sdf");
|
||||
|
||||
//plan
|
||||
if (ww >= sw && ww <= ew)
|
||||
e.Graphics.FillRectangle(new SolidBrush(PBg), rect2TP.Left, rect2TP.Top, rect2TP.Width, rect2TP.Height);
|
||||
|
||||
Reference in New Issue
Block a user