Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage
This commit is contained in:
commit
6327dd3e96
5 files changed
+153
-4
No files matched your search
@@ -0,0 +1,49 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace formula_manage
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 查询接口
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="T"></typeparam>
|
||||||
|
public interface IProvider<T> where T : class
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 查询所有记录
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
List<T> Select();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查询一条记录
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="t"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
List<T> Selectsql(T t);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 插入一条记录
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="t"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
int Insert(T t);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改一条记录
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="t"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
int Update(T t);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 删除一条记录
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="t"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
int Delete(T t);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace formula_manage.SQLModels
|
||||||
|
{
|
||||||
|
// internal class STUFF_Product
|
||||||
|
//{
|
||||||
|
// }
|
||||||
|
|
||||||
|
public partial class Product
|
||||||
|
{
|
||||||
|
public string ProductCode { get; set; }
|
||||||
|
public string ProductName { get; set; }
|
||||||
|
public Nullable<int> ProductType { get; set; }
|
||||||
|
public Nullable<int> ProductClass { get; set; }
|
||||||
|
public Nullable<int> Color { get; set; }
|
||||||
|
public string ProductLot { get; set; }
|
||||||
|
public Nullable<double> FullWeight { get; set; }
|
||||||
|
public Nullable<int> ProductUnit { get; set; }
|
||||||
|
public Nullable<double> SafetyStock { get; set; }
|
||||||
|
public Nullable<double> Price { get; set; }
|
||||||
|
public Nullable<double> CurrentStock { get; set; }
|
||||||
|
public Nullable<double> Deduct { get; set; }
|
||||||
|
public Nullable<System.DateTime> RplDate { get; set; }
|
||||||
|
public Nullable<System.DateTime> UsedDate { get; set; }
|
||||||
|
public string CuMonth { get; set; }
|
||||||
|
public Nullable<double> LaStock { get; set; }
|
||||||
|
public Nullable<double> ThStock { get; set; }
|
||||||
|
public Nullable<double> ThUsed { get; set; }
|
||||||
|
public Nullable<int> LampPosition { get; set; }
|
||||||
|
public string TablePosition { get; set; }
|
||||||
|
public string Area { get; set; }
|
||||||
|
public Nullable<double> Concentration { get; set; }
|
||||||
|
public string Batch_NO { get; set; }
|
||||||
|
public string SUPPLIER { get; set; }
|
||||||
|
public double GRAVITY { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
+10
-4
@@ -3,13 +3,18 @@
|
|||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:local="clr-namespace:formula_manage.Windows"
|
xmlns:local="clr-namespace:formula_manage.Windows"
|
||||||
|
xmlns:ConvertMoels="clr-namespace:formula_manage.ConvertMoels"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="Stuff" Height="720" Width="1100" BorderBrush="White" Background="#FFE0E0E0">
|
Title="Stuff" Height="720" Width="1100" BorderBrush="White" Background="#FFE0E0E0">
|
||||||
|
<Window.Resources>
|
||||||
|
<!--引入转换器-->
|
||||||
|
<ConvertMoels:ColorSQLConvert x:Key="ColorSQLConvert"/>
|
||||||
|
<ConvertMoels:ProductTypeSQLConvert x:Key="ProductTypeSQLConvert"/>
|
||||||
|
</Window.Resources>
|
||||||
<Grid>
|
<Grid>
|
||||||
<!--原料表-->
|
<!--原料表-->
|
||||||
<DataGrid x:Name="DataGridStuff" SelectionMode="Single" AlternationCount="2" IsReadOnly="True"
|
<DataGrid x:Name="DataGridStuff" MouseDoubleClick="DataGridStuff_MouseDoubleClick" SelectionMode="Single" AlternationCount="2" IsReadOnly="True"
|
||||||
HorizontalAlignment="Left" Margin="15,15,0,150" d:ItemsSource="{d:SampleData ItemCount=200}" AutoGenerateColumns="False" MinColumnWidth="30"
|
HorizontalAlignment="Left" Margin="15,15,0,150" d:ItemsSource="{d:SampleData ItemCount=200}" AutoGenerateColumns="False" MinColumnWidth="30"
|
||||||
HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" GridLinesVisibility="All" BorderBrush="#CCCCCC"
|
HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" GridLinesVisibility="All" BorderBrush="#CCCCCC"
|
||||||
BorderThickness="1,1,1,1" ColumnHeaderHeight="40" HorizontalContentAlignment="Right" Grid.ColumnSpan="2" CanUserReorderColumns="False">
|
BorderThickness="1,1,1,1" ColumnHeaderHeight="40" HorizontalContentAlignment="Right" Grid.ColumnSpan="2" CanUserReorderColumns="False">
|
||||||
@@ -57,7 +62,7 @@
|
|||||||
<!--事件名称:原料类型数字转文字显示,转换器ProductTypeSQLConvert-->
|
<!--事件名称:原料类型数字转文字显示,转换器ProductTypeSQLConvert-->
|
||||||
<DataGridTextColumn.ElementStyle>
|
<DataGridTextColumn.ElementStyle>
|
||||||
<Style TargetType="{x:Type TextBlock}">
|
<Style TargetType="{x:Type TextBlock}">
|
||||||
|
<Setter Property="Text" Value="{Binding ProductType, Converter={StaticResource ProductTypeSQLConvert}}"/>
|
||||||
</Style>
|
</Style>
|
||||||
</DataGridTextColumn.ElementStyle>
|
</DataGridTextColumn.ElementStyle>
|
||||||
</DataGridTextColumn>
|
</DataGridTextColumn>
|
||||||
@@ -65,6 +70,7 @@
|
|||||||
<!--事件名称:色彩数字转色彩显示,转换器ColorSQLConvert-->
|
<!--事件名称:色彩数字转色彩显示,转换器ColorSQLConvert-->
|
||||||
<DataGridTextColumn.ElementStyle>
|
<DataGridTextColumn.ElementStyle>
|
||||||
<Style TargetType="{x:Type TextBlock}">
|
<Style TargetType="{x:Type TextBlock}">
|
||||||
|
<Setter Property="Background" Value="{Binding Color, Converter={StaticResource ColorSQLConvert}}"/>
|
||||||
</Style>
|
</Style>
|
||||||
</DataGridTextColumn.ElementStyle>
|
</DataGridTextColumn.ElementStyle>
|
||||||
</DataGridTextColumn>
|
</DataGridTextColumn>
|
||||||
|
|||||||
@@ -24,9 +24,20 @@ namespace formula_manage.Windows
|
|||||||
public Stuff()
|
public Stuff()
|
||||||
{
|
{
|
||||||
WindowStartupLocation = WindowStartupLocation.CenterScreen;
|
WindowStartupLocation = WindowStartupLocation.CenterScreen;
|
||||||
|
|
||||||
|
this.DataGridStuff.LoadingRow += new EventHandler<DataGridRowEventArgs>(this.DataGridEquipment_LoadingRow);//生成序列号
|
||||||
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 生成序列号的方法
|
||||||
|
/// </summary>
|
||||||
|
private void DataGridEquipment_LoadingRow(object sender, DataGridRowEventArgs e)
|
||||||
|
{
|
||||||
|
e.Row.Header = e.Row.GetIndex() + 1;
|
||||||
|
}
|
||||||
|
|
||||||
private void Radiobutton(object sender, EventArgs e)
|
private void Radiobutton(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
/* System.Windows.Controls.RadioButton Radiobutton = (sender as System.Windows.Controls.RadioButton);
|
/* System.Windows.Controls.RadioButton Radiobutton = (sender as System.Windows.Controls.RadioButton);
|
||||||
@@ -144,6 +155,45 @@ namespace formula_manage.Windows
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void DataGridStuff_MouseDoubleClick(object sender, MouseButtonEventArgs e)//数据表双击事件
|
||||||
|
{
|
||||||
|
int rownum = DataGridStuff.SelectedIndex;//获取鼠标选中行并定义变量
|
||||||
|
if (rownum != -1)//判断鼠标定位是否有效
|
||||||
|
{
|
||||||
|
/*定位选中行及指定列单元格文本信息*/
|
||||||
|
string DataGridStuff_ProductCode = (DataGridStuff.Columns[1].GetCellContent(DataGridStuff.Items[rownum]) as TextBlock).Text;//定位第0列,原料代码
|
||||||
|
string DataGridStuff_ProductName = (DataGridStuff.Columns[2].GetCellContent(DataGridStuff.Items[rownum]) as TextBlock).Text;//定位第1列,原料名称
|
||||||
|
string DataGridStuff_Price = (DataGridStuff.Columns[3].GetCellContent(DataGridStuff.Items[rownum]) as TextBlock).Text;//定位第2列,价格
|
||||||
|
string DataGridstuff_SUPPLIER = (DataGridStuff.Columns[4].GetCellContent(DataGridStuff.Items[rownum]) as TextBlock).Text;//定位第3列,供应商
|
||||||
|
string DataGridStuff_ProductType = (DataGridStuff.Columns[5].GetCellContent(DataGridStuff.Items[rownum]) as TextBlock).Text;//定位第4列,类型
|
||||||
|
//string DataGridStuff_Color = (DataGridStuff.Columns[6].GetCellContent(DataGridStuff.Items[rownum])as TextBlock).Text;//定位第5列,色彩
|
||||||
|
string DataGridStuff_Concentration = (DataGridStuff.Columns[7].GetCellContent(DataGridStuff.Items[rownum]) as TextBlock).Text;//定位第6列选中行单元格文本信息并去除空白字符,浓度
|
||||||
|
string DataGridStuff_GRAVITY = (DataGridStuff.Columns[8].GetCellContent(DataGridStuff.Items[rownum]) as TextBlock).Text;//定位第7列,比重
|
||||||
|
/*stuff_Color.Background = (DataGridStuff.Columns[6].GetCellContent(DataGridStuff.Items[rownum]) as TextBlock).Background;//定位第5列,色彩,背景色传递至色彩框背景色*/
|
||||||
|
/*填写信息至指定文本框*/
|
||||||
|
//product_temp.ProductCode = DataGridStuff_ProductCode;//写入sql实体缓存
|
||||||
|
stuff_ProductCode.Text = DataGridStuff_ProductCode.Trim();//原料代码,去除空白字符
|
||||||
|
stuff_ProductName.Text = DataGridStuff_ProductName.Trim();//原料名称,去除空白字符
|
||||||
|
stuff_Price.Text = DataGridStuff_Price;//价格
|
||||||
|
stuff_ProductType.Text = DataGridStuff_ProductType;//类型
|
||||||
|
stuff_SUPPLIER.Text = DataGridstuff_SUPPLIER;//供应商
|
||||||
|
/*stuff_Color.Text = DataGridStuff_Color;//色彩数据*/
|
||||||
|
stuff_Concentration.Text = DataGridStuff_Concentration;//浓度
|
||||||
|
stuff_GRAVITY.Text = DataGridStuff_GRAVITY;//比重
|
||||||
|
/*if (DataGridStuff_ProductType.ToString() == "0") stuff_ProductType.Text = "染料";//判断类型1-染料。2-助剂。3-粉体助剂。
|
||||||
|
if (DataGridStuff_ProductType.ToString() == "1") stuff_ProductType.Text = "助剂";
|
||||||
|
if (DataGridStuff_ProductType.ToString() == "2") stuff_ProductType.Text = "粉体助剂";*/
|
||||||
|
if ((DataGridStuff.Columns[6].GetCellContent(DataGridStuff.Items[rownum]) as TextBlock).Background != null) //定位第5列选中行单元格,色彩,判断参数是否有效
|
||||||
|
{
|
||||||
|
stuff_Color.Background = (DataGridStuff.Columns[6].GetCellContent(DataGridStuff.Items[rownum]) as TextBlock).Background; //定位第5列选中行单元格,色彩,有效背景色传递至色彩框背景色
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
stuff_Color.Background = new SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 255, 255, 255));//白色传递至色彩框背景色
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void Stuff_Color_MouseDoubleClick(object sender, MouseButtonEventArgs e)//色彩框双击事件
|
private void Stuff_Color_MouseDoubleClick(object sender, MouseButtonEventArgs e)//色彩框双击事件
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@@ -106,9 +106,11 @@
|
|||||||
<Compile Include="ConvertMoels\ProductTypeSQLConvert.cs" />
|
<Compile Include="ConvertMoels\ProductTypeSQLConvert.cs" />
|
||||||
<Compile Include="ConvertMoels\StatenConvert.cs" />
|
<Compile Include="ConvertMoels\StatenConvert.cs" />
|
||||||
<Compile Include="ConvertMoels\StatenERRConvert.cs" />
|
<Compile Include="ConvertMoels\StatenERRConvert.cs" />
|
||||||
|
<Compile Include="IProvider.cs" />
|
||||||
<Compile Include="Login.xaml.cs">
|
<Compile Include="Login.xaml.cs">
|
||||||
<DependentUpon>Login.xaml</DependentUpon>
|
<DependentUpon>Login.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="SQLModels\STUFF_Product.cs" />
|
||||||
<Compile Include="UserClass\IniFile.cs" />
|
<Compile Include="UserClass\IniFile.cs" />
|
||||||
<Compile Include="UserClass\PressKey.cs" />
|
<Compile Include="UserClass\PressKey.cs" />
|
||||||
<Compile Include="View\Formula.xaml.cs">
|
<Compile Include="View\Formula.xaml.cs">
|
||||||
@@ -230,6 +232,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="UserControls\" />
|
<Folder Include="UserControls\" />
|
||||||
|
<Folder Include="ViewModel\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
</Project>
|
</Project>
|
||||||
Reference in new issue
Block a user