Files
Groupware/SubProject/FCOMMON/fSFI.cs
2024-01-29 11:51:47 +09:00

123 lines
3.8 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace FCOMMON
{
public partial class fSFI : Form
{
public fSFI(string sfi_type, double time, double cnt, double shiftcount, int itemcnt)
{
InitializeComponent();
if (sfi_type == "M")
{
radM.Checked = true;
nudMsavetime.Value = (decimal)time;
}
else
{
radO.Checked = true;
nudOsavetime.Value = (decimal)time;
}
nudMSaveCnt.Value = (decimal)cnt;
nudShiftCnt.Value = (decimal)shiftcount;
this.nudCnt.Value = (decimal)itemcnt;
}
private void label1_Click(object sender, EventArgs e)
{
}
private void radioButton1_CheckedChanged(object sender, EventArgs e)
{
panel1.Enabled = radO.Checked;
panel2.Enabled = !panel1.Enabled;
}
private void numericUpDown1_ValueChanged(object sender, EventArgs e)
{
//mfg 절감시간 업데이트
var nud = sender as NumericUpDown;
if (this.radO.Checked)
{
UpdateOffice();
}
else
{
updateMFG();
}
}
private void numericUpDown6_ValueChanged(object sender, EventArgs e)
{
var nud = sender as NumericUpDown;
//mfg의 총 절감 시간이 변경되었다
var = (double)nud.Value;
var sfi = / (float)numericUpDown5.Value;
var csfi = sfi * (float)nudMultiMFG.Value;
nudSFIMFG.Value = (Decimal)sfi;
nudCSFIMFG.Value = (Decimal)csfi;
}
public double Value { get; set; } = 0;
void updateMFG()
{
var = (double)nudMsavetime.Value;
var SHIFT수 = (float)nudMSaveCnt.Value;
var shift총수 = (double)( * SHIFT수);
if (numericUpDown9.Value != (decimal)shift총수)
numericUpDown9.Value = (decimal)shift총수; //1쉬프트 개선절감횟수
var = (int)nudShiftCnt.Value;
var = (int)nudCnt.Value;
numericUpDown6.Value = (decimal)(shift총수 * * );
}
void UpdateOffice()
{
var savetime = (double)nudOsavetime.Value;
var min = (int)numericUpDown2.Value;
var cnt = (int)nudCnt.Value;
var sfi = (savetime * cnt) / min;
nudSFIOffice.Value = (decimal)(sfi);
}
private void button1_Click(object sender, EventArgs e)
{
this.Invalidate();
if (radO.Checked)
this.Value = (double)nudSFIOffice.Value;
else
this.Value = (double)nudCSFIMFG.Value;
DialogResult = DialogResult.OK;
}
private void fSFI_Load(object sender, EventArgs e)
{
nudMSaveCnt.DecimalPlaces = 1;
}
private void nudSIFOffice_ValueChanged(object sender, EventArgs e)
{
//offcie update
var sfi = (double)nudSFIOffice.Value;
//numericUpDown3.Value = (decimal)(sfi * 1.25);
}
private void numericUpDown4_ValueChanged(object sender, EventArgs e)
{
//mfg update
var sfi = (double)nudSFIMFG.Value;
//numericUpDown1.Value = (decimal)(sfi * 1.25);
}
}
}