..
This commit is contained in:
@@ -4,11 +4,9 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Data.Entity.Infrastructure.MappingViews;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.ServiceModel;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
@@ -105,6 +103,7 @@ namespace Project.Dialog
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
if (cust == "ALL")
|
||||
{
|
||||
dvcModelName.Visible = true;
|
||||
@@ -137,7 +136,9 @@ namespace Project.Dialog
|
||||
|
||||
private void toolStripButton1_Click(object sender, EventArgs e)
|
||||
{
|
||||
RefreshList(PUB.Result.vModel.Title);
|
||||
var title = cmbModelList.Text;
|
||||
if (title.isEmpty()) title = PUB.Result.vModel.Title;
|
||||
RefreshList(title);
|
||||
}
|
||||
|
||||
private void bs_CurrentChanged(object sender, EventArgs e)
|
||||
@@ -232,6 +233,71 @@ namespace Project.Dialog
|
||||
RefreshList(title);
|
||||
}
|
||||
|
||||
private string ChoiceModelName()
|
||||
{
|
||||
var cmb = new ComboBox();
|
||||
cmb.Items.Clear();
|
||||
foreach (var dr in PUB.mdm.dataSet.OPModel.OrderBy(t => t.Title))
|
||||
cmb.Items.Add(dr.Title);
|
||||
|
||||
using (var f = new Form())
|
||||
{
|
||||
var lb = new Label()
|
||||
{
|
||||
Text = "Select Model",
|
||||
Dock = DockStyle.Top
|
||||
};
|
||||
var pan = new Panel()
|
||||
{
|
||||
Dock = DockStyle.Bottom,
|
||||
Height = 50,
|
||||
};
|
||||
var butok = new Button
|
||||
{
|
||||
Text = "OK",
|
||||
Width = 160,
|
||||
Dock = DockStyle.Fill,
|
||||
};
|
||||
var butng = new Button
|
||||
{
|
||||
Text = "Cancel",
|
||||
Width = 160,
|
||||
Dock = DockStyle.Right,
|
||||
};
|
||||
butok.Click += (s1, e1) => {
|
||||
f.DialogResult = DialogResult.OK;
|
||||
};
|
||||
butng.Click += (s1, e1) => {
|
||||
f.DialogResult = DialogResult.Cancel;
|
||||
};
|
||||
|
||||
pan.Controls.Add(butok);
|
||||
pan.Controls.Add(butng);
|
||||
|
||||
cmb.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
cmb.Dock = DockStyle.Top;
|
||||
f.StartPosition = FormStartPosition.CenterScreen;
|
||||
f.Width = 320;
|
||||
f.Height = 160;
|
||||
f.Text = "Select Model";
|
||||
f.MinimizeBox = false;
|
||||
f.MaximizeBox = false;
|
||||
f.Padding = new Padding(10);
|
||||
f.Controls.Add(pan);
|
||||
f.Controls.Add(cmb);
|
||||
f.Controls.Add(lb);
|
||||
|
||||
if (f.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
return cmb.Text;
|
||||
}
|
||||
else return string.Empty;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void btCopy_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
@@ -246,13 +312,13 @@ namespace Project.Dialog
|
||||
var sourceRow = drv.Row as DataSet1.K4EE_Component_Reel_RegExRuleRow;
|
||||
if (sourceRow == null) return;
|
||||
|
||||
var inputDialog = AR.UTIL.InputBox("Input ModelName", sourceRow.IsCustCodeNull() ? "" : sourceRow.CustCode);
|
||||
if (inputDialog.Item1 == false) return;
|
||||
var newModelName = inputDialog.Item2;
|
||||
var inputDialog = ChoiceModelName(); // AR.UTIL.InputBox("Input ModelName", sourceRow.IsCustCodeNull() ? "" : sourceRow.CustCode);
|
||||
if (inputDialog.isEmpty()) return;
|
||||
var newModelName = inputDialog;
|
||||
|
||||
var inputDialog2 = AR.UTIL.InputBox("Input Description", sourceRow.IsDescriptionNull() ? "" : sourceRow.Description);
|
||||
if (inputDialog2.Item1 == false) return;
|
||||
var newDescription = inputDialog2.Item2;
|
||||
//var inputDialog2 = AR.UTIL.InputBox("Input Description", sourceRow.IsDescriptionNull() ? "" : sourceRow.Description);
|
||||
//if (inputDialog2.Item1 == false) return;
|
||||
var newDescription = sourceRow.IsDescriptionNull() ? "" : sourceRow.Description;// inputDialog2.Item2;
|
||||
|
||||
var tacheck = new DataSet1TableAdapters.K4EE_Component_Reel_RegExRuleTableAdapter();
|
||||
if (tacheck.CheckExsist(newModelName, newDescription) > 0)
|
||||
|
||||
Reference in New Issue
Block a user