private void button1_Click(object sender, EventArgs e) { string rename = name.Substring(3); Coffee a = new Coffee(null, (int)numericUpDown1.Value); Study b = new Study(null, (int)numericUpDown3.Value); Exercise c = new Exercise(null, (int)numericUpDown4.Value); Meditation d = new Meditation(null, (int)numericUpDown2.Value); Stress f = new Stress((int)numericUpDown5.Value); day = new DayRecord(int.Parse(rename), a,c,b,d,f); if(day.Coffee.Count > 4) MessageBox.Show("Too Much Coffee>0< \n 위에 구멍나 ㅠㅠ!"); if(day.Exercise.Count > 4) MessageBox.Show(" 썬크림은 발랐니..."); if (day.meditation.Count > 3) MessageBox.Show("그만 좀 나가 놀아보렴~~"); if (day.study.Count > 6 ) MessageBox.Show("공부 잘~~~했어!Gooooood!"); this.DialogResult = DialogResult.OK; this.Close(); }
public void DrawOnCalendar(DayRecord day, Label label) { Image bmp = new Bitmap(112, 96); Graphics g = Graphics.FromImage(bmp); if (day.study.Count != 0 && day.study.Count < 3) { int rn1 = RandomNum1(); int rn2 = RandomNum1(); int n3 = day.study.Count; label.Image = bmp; Rectangle tem3 = new Rectangle(rn1, rn2, 20 * n3, 20 * n3); g.DrawImage(images[3], tem3); } else if (day.study.Count >= 3 && day.study.Count <= 6) { int rn1 = RandomNum1(); int rn2 = RandomNum1(); int n3 = day.study.Count; label.Image = bmp; Rectangle tem3 = new Rectangle(rn1, rn2, 15 * n3, 15 * n3); g.DrawImage(images[3], tem3); } else if (day.study.Count > 6) { label.Image = bmp; Rectangle tem3 = new Rectangle(5, 5, 90, 90); g.DrawImage(images[3], tem3); } if (day.Coffee.Count != 0 && day.Coffee.Count < 4) { int rn1 = RandomNum(); int rn2 = RandomNum(); int n = day.Coffee.Count; label.Image = bmp; Rectangle tem = new Rectangle(rn1, rn2, n * 18, n * 15); g.DrawImage(images[0], tem); } else if (day.Coffee.Count >= 4) { label.Image = bmp; Rectangle tem = new Rectangle(5, 12, 84, 70); g.DrawImage(images[0], tem); } if (day.Exercise.Count != 0 && day.Exercise.Count < 3) { int rn1 = RandomNum(); int rn2 = RandomNum(); int n1 = day.Exercise.Count; label.Image = bmp; Rectangle tem1 = new Rectangle(rn1, rn2, 25 * n1, 25 * n1); g.DrawImage(images[4], tem1); } else if (day.Exercise.Count >= 3) { int n2 = day.Exercise.Count; label.Image = bmp; Rectangle tem1 = new Rectangle(35, 10, 80, 80); g.DrawImage(images[4], tem1); } if (day.meditation.Count != 0 && day.meditation.Count < 3) { int rn1 = RandomNum(); int rn2 = RandomNum(); int n2 = day.meditation.Count; label.Image = bmp; Rectangle tem2 = new Rectangle(rn1, rn2, 15 * n2, 15 * n2); g.DrawImage(images[1], tem2); } else if (day.meditation.Count >= 3) { label.Image = bmp; Rectangle tem2 = new Rectangle(20, 30, 80, 80); g.DrawImage(images[1], tem2); } if (day.stress.Percent != 0) { int n4 = day.stress.Percent; label.Image = bmp; Pen redPen = new Pen(Color.Transparent, 0); Color c2 = Color.FromArgb(n4, Color.Red); SolidBrush fillRed = new SolidBrush(c2); Rectangle stressbar = new Rectangle(0, 90, 112, 10); g.DrawRectangle(redPen, stressbar); g.FillRectangle(fillRed, stressbar); } }
public void Add(DayRecord temp) { monthly.Add(temp); }