|
|
|
|
using Mesnac.Action.ChemicalWeighing.LjMaterial;
|
|
|
|
|
using Mesnac.Action.ChemicalWeighing.LjMetageFormula;
|
|
|
|
|
using Mesnac.Action.ChemicalWeighing.LjMixFormula;
|
|
|
|
|
using Mesnac.Action.ChemicalWeighing.LjProdcutLine;
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
namespace Mesnac.Action.ChemicalWeighing.LjMixManager
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
public partial class FrmMixB : Form
|
|
|
|
|
{
|
|
|
|
|
public FrmMixB()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
|
|
|
|
private int _id = 0;
|
|
|
|
|
|
|
|
|
|
public FrmMixB(int id) : this()
|
|
|
|
|
{
|
|
|
|
|
_id = id;
|
|
|
|
|
FillController();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private LjMixManagerView _view;
|
|
|
|
|
|
|
|
|
|
private void FillController()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IEnumerable<MyNameValueStr> ien = MetageFormulaDb.GetMetageNmaValue();
|
|
|
|
|
var drpA = ien.ToList();
|
|
|
|
|
var drpB = ien.ToList();
|
|
|
|
|
var drpC = ien.ToList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FillComboBox(DrpMetageB1);
|
|
|
|
|
DrpMetageB1.DataSource = drpB;
|
|
|
|
|
FillComboBox(DrpMetageB2);
|
|
|
|
|
DrpMetageB2.DataSource = drpC;
|
|
|
|
|
var lsBMixList = MixDb.GetMyNameValueStrs(1);
|
|
|
|
|
DrpMixB.DataSource = lsBMixList;
|
|
|
|
|
FillComboBox(DrpMixB);
|
|
|
|
|
_view = LjMixManagerDb.GetById(_id);
|
|
|
|
|
Checked(DrpMetageB1, _view.MetageB1Id);
|
|
|
|
|
Checked(DrpMetageB2, _view.MetageB2Id);
|
|
|
|
|
Checked(DrpMixB, _view.MixBId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void btnCancel_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
this.Close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void FillComboBox(ComboBox combo)
|
|
|
|
|
{
|
|
|
|
|
combo.ValueMember = "Id";
|
|
|
|
|
combo.DisplayMember = "Name";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Checked(ComboBox alBox, string checkId)
|
|
|
|
|
{
|
|
|
|
|
foreach (MyNameValueStr combo in alBox.Items)
|
|
|
|
|
{
|
|
|
|
|
if (combo.Id == checkId)
|
|
|
|
|
{
|
|
|
|
|
alBox.SelectedItem = combo;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void btnOK_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
_view.Id = _id;
|
|
|
|
|
_view.MetageB1Id = DrpMetageB1.SelectedValue.ToString();
|
|
|
|
|
_view.MetageB1Name = DrpMetageB1.Text;
|
|
|
|
|
_view.MetageB2Id = DrpMetageB2.SelectedValue.ToString();
|
|
|
|
|
_view.MetageB2Name = DrpMetageB2.Text;
|
|
|
|
|
_view.MixBId = DrpMixB.SelectedValue.ToString();
|
|
|
|
|
_view.MixBName=DrpMixB.Text;
|
|
|
|
|
LjMixManagerDb.UpdateMixB(_view);
|
|
|
|
|
this.DialogResult = DialogResult.OK;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|