This commit is contained in:
sc committed 2022-03-09 00:06:37 +08:00
commit f9a9bb1723
10 files changed
+97 -25

No files matched your search

+1 -1
View File
@@ -99,7 +99,7 @@
</Style>
</DatePicker.Resources>
</DatePicker>
<DatePicker x:Name="query_date_end" HorizontalAlignment="Left" Height="30" Margin="715,0,0,100" VerticalAlignment="Bottom" Width="225" FontSize="15" Padding="1,1,0,1">
<DatePicker x:Name="query_date_end" HorizontalAlignment="Left" Height="30" Margin="715,0,0,100" VerticalAlignment="Bottom" Width="225" FontSize="15" Padding="1,1,0,1" DisplayDate="2022-03-08">
<DatePicker.Resources>
<Style TargetType="DatePickerTextBox">
<Setter Property="IsReadOnly" Value="True"/>
+24 -15
View File
@@ -29,6 +29,10 @@ namespace Audit.View
InitializeComponent();
}
//public static string Dyelots_Button = null;
public static int sqlButton_Click=0;
public static Dyelots Dyelots_Button = new Dyelots();
public static DyelotsBulkedRecipe DyelotsBulkedRecipe_Button = new DyelotsBulkedRecipe();
private void Button_Click(object sender, RoutedEventArgs e)//确认按钮事件
{
string DataGridDyelots_Button = this.Dyelots_Dyelot.Text;//传递工单输入框
@@ -37,12 +41,13 @@ namespace Audit.View
string query_end = this.query_date_end.Text;//传递结束时间
if (string.IsNullOrWhiteSpace(DataGridDyelots_Button))//工单为空进入下一步判断
{
if (string.IsNullOrWhiteSpace(query_start) || string.IsNullOrWhiteSpace(query_end))//判断查询时间是否存在
if (string.IsNullOrWhiteSpace(query_start) && string.IsNullOrWhiteSpace(query_end))//判断查询时间是否存在
{
MessageBox.Show("SC:无效查询信息", "错误");//返回无效信息弹窗
sqlButton_Click = 0;
}
else
{
query_end = DateTime.Now.AddDays(1).ToString("yyyy-MM-dd");
int query_TimeCompare = DateTime.Compare(Convert.ToDateTime(query_start), Convert.ToDateTime(query_end)); //比较开始结束时间,小于-1 等于0 大于1
if (query_TimeCompare == 1)//判断查询时间是否有效,等于1无效
{
@@ -50,25 +55,32 @@ namespace Audit.View
}
else
{
if (string.IsNullOrWhiteSpace(DataGridMachine_Button))//查询时间及机台
if (string.IsNullOrWhiteSpace(DataGridMachine_Button))//查询机台
{
MessageBox.Show("SC:查询时间");
Dyelots_Button.StartTime = Convert.ToDateTime(query_start);
Dyelots_Button.EndTime = Convert.ToDateTime(query_end);
sqlButton_Click = 3;//传递按钮信息以时间查询
}
else
{
MessageBox.Show("SC:查询机台");
Dyelots_Button.StartTime = Convert.ToDateTime(query_start);
Dyelots_Button.EndTime = Convert.ToDateTime(query_end);
Dyelots_Button.Machine = DataGridMachine_Button;
sqlButton_Click = 4;//传递按钮信息以时间机台查询
}
}
}
}
else
{
MessageBox.Show("SC:查询工单");//有单号查询
DyelotsBulkedRecipe_Button.Dyelot = DataGridDyelots_Button;//传递单号
Dyelots_Button.Dyelot = DataGridDyelots_Button;
sqlButton_Click = 1;//发生按钮状态单号查询
}
}
private void DataGridDyelot_MouseDoubleClick(object sender, MouseButtonEventArgs e)// DataGridDyelot表格双击事件
{
{
int rownum = this.DataGridDyelots.SelectedIndex;//获取鼠标选中行并定义变量
if (rownum != -1)
{
@@ -76,16 +88,13 @@ namespace Audit.View
string DataGridReDye_value = (DataGridDyelots.Columns[1].GetCellContent(DataGridDyelots.Items[rownum]) as TextBlock).Text;//定位第1列选中行单元格,重染
string DataGridMachine_value = (DataGridDyelots.Columns[2].GetCellContent(DataGridDyelots.Items[rownum]) as TextBlock).Text;//定位第2列选中行单元格,机台
string DataGridCreationTime_value = (DataGridDyelots.Columns[3].GetCellContent(DataGridDyelots.Items[rownum]) as TextBlock).Text;//定位第3列选中行单元格,开单时间
Dyelots_Dyelot.Text = DataGridDyelots_value.ToString();//获取工单单元格字符串填入工单输入框
//Dyelots_Dyelot.Text = DataGridDyelots_value.ToString();//获取工单单元格字符串填入工单输入框
Dyelots_ReDye.Text = DataGridReDye_value.ToString(); //获取重染单元格字符串填入重染框
Dyelots_Machine.Text = DataGridMachine_value.ToString();//获取机台单元格字符串填入机台输入框
Dyelots_CreationTime.Text = DataGridCreationTime_value.ToString();//获取开单时间单元格字符串填入开单时间框
if (string.IsNullOrWhiteSpace(DataGridDyelots_value)) //工单为空进入下一步判断
{ }
else
{
//Dyelots_Machine.Text = DataGridMachine_value.ToString();//获取机台单元格字符串填入机台输入框
Dyelots_CreationTime.Text = DataGridCreationTime_value.ToString();//获取开单时间单元格字符串填入开单时间框
DyelotsBulkedRecipe_Button.Dyelot = DataGridDyelots_value;//传递工单信息至sql实例
sqlButton_Click = 2;//传递按钮信息以查询
}
}
}
+1 -1
View File
@@ -120,7 +120,7 @@ namespace Audit.View
private void Button_Delete(object sender, RoutedEventArgs e)//删除按钮事件
{
product.ProductCode = this.stuff_ProductCode.Text;//原料代码
string ShowProductName = "是否删除" + this.stuff_ProductCode.Text + "" + this.stuff_ProductName.Text;//获取原料信息并拼接提示字符串
string ShowProductName = "是否删除原料【" + this.stuff_ProductName.Text + "】" + this.stuff_ProductCode.Text;//获取原料信息并拼接提示字符串
MessageBoxResult showProductName = System.Windows.MessageBox.Show(ShowProductName, "提示", MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.Yes);//弹窗提示是否删除目标原料
if (showProductName == MessageBoxResult.Yes)//判断是否删除原料
{