Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage
This commit is contained in:
commit
c6a3e931d9
3 files changed
+25
-45
No files matched your search
+7
-6
@@ -4,12 +4,13 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:formula_manage"
|
||||
xmlns:ViewModel="clr-namespace:formula_manage.ViewModel"
|
||||
mc:Ignorable="d" Loaded="Window_MIN"
|
||||
Title="SUNLIGHT" Height="720" Width="1280" MinHeight="720" MinWidth="1280"
|
||||
DataContext="{Binding Source={StaticResource Locator}, Path=Main}"
|
||||
BorderBrush="White" Background="#FFE0E0E0">
|
||||
<Window.Resources>
|
||||
|
||||
<ViewModel:MainWindowViewModel x:Key="mvm"/>
|
||||
</Window.Resources>
|
||||
<Grid>
|
||||
<Menu IsTabStop="False">
|
||||
@@ -152,6 +153,7 @@
|
||||
<Setter Property="Background" Value="#FFFFFFFF"/>
|
||||
<Setter Property="BorderBrush" Value="#FFFFFFFF"/>
|
||||
<Setter Property="Foreground" Value="#000000"/>
|
||||
<Setter Property="DataContext" Value="{Binding Source={StaticResource Locator}, Path=Main}"/>
|
||||
</Style>
|
||||
</DataGrid.Resources>
|
||||
<DataGrid.Columns>
|
||||
@@ -162,15 +164,14 @@
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<ComboBox x:Name="CP_PRODUCT_CODE" BorderThickness="0,0,0,0"
|
||||
ItemsSource="{Binding DataContext._product , RelativeSource={RelativeSource AncestorType={x:Type Window}}}"
|
||||
|
||||
ItemsSource="{Binding DataContext.STUFFdataTable , RelativeSource={RelativeSource AncestorType={x:Type Window}}}"
|
||||
|
||||
|
||||
DisplayMemberPath="ProductCode"
|
||||
|
||||
|
||||
|
||||
Text="{Binding PRODUCT_CODE}"
|
||||
|
||||
|
||||
BorderBrush="{x:Null}" Background="{x:Null}" IsEditable="True" KeyDown="CP_PRODUCT_CODE_KeyUp"
|
||||
>
|
||||
</ComboBox>
|
||||
@@ -198,7 +199,7 @@
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<ComboBox x:Name="CP_PRODUCT_NAME" BorderThickness="0,0,0,0"
|
||||
ItemsSource="{Binding DataContext._product , RelativeSource={RelativeSource AncestorType={x:Type Window}}}"
|
||||
ItemsSource="{Binding STUFFdataTable }"
|
||||
DisplayMemberPath="ProductName"
|
||||
Text="{Binding PRODUCT_NAME}" BorderBrush="{x:Null}" Background="{x:Null}" IsEditable="True" IsReadOnly="True" Focusable="True" IsTabStop="False"/>
|
||||
</DataTemplate>
|
||||
|
||||
+6
-33
@@ -25,6 +25,7 @@ using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using System.Windows.Threading;
|
||||
using formula_manage.ViewModel;
|
||||
using Xceed.Wpf.Toolkit.PropertyGrid.Attributes;
|
||||
using static System.Net.Mime.MediaTypeNames;
|
||||
//using static System.Windows.Forms.VisualStyles.VisualStyleElement;
|
||||
@@ -56,8 +57,7 @@ namespace formula_manage
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
// DataContext =new MainWindow();
|
||||
|
||||
DataContext =new MainWindowViewModel();
|
||||
int ID_N = 1;
|
||||
|
||||
WindowStartupLocation = WindowStartupLocation.CenterScreen;
|
||||
@@ -123,6 +123,10 @@ namespace formula_manage
|
||||
|
||||
Grid_RRODUCT.ItemsSource = RRODUCTdataTable.DefaultView;
|
||||
|
||||
//this.DataContext = Grid_RRODUCT;
|
||||
// this.DataContext = STUFFdataTable.DefaultView;
|
||||
|
||||
Grid_RRODUCT.DataContext = this;
|
||||
}
|
||||
|
||||
private async void sql_()
|
||||
@@ -261,8 +265,6 @@ namespace formula_manage
|
||||
public void DisTimer_Tick(object sender, EventArgs e)//循环事件
|
||||
{
|
||||
USERTIME.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void CountDown()
|
||||
@@ -524,35 +526,6 @@ namespace formula_manage
|
||||
|
||||
private void CP_PRODUCT_CODE_KeyUp(object sender, System.Windows.Input.KeyEventArgs e)
|
||||
{
|
||||
|
||||
//string dsa= CP_PRODUCT_CODE //Grid_RRODUCT.SelectedItems[0].ToString();
|
||||
|
||||
// int index = Grid_RRODUCT.CurrentCell;
|
||||
// DataGridTemplateColumn templeColumn = Grid_RRODUCT.Columns[1] as DataGridTemplateColumn;
|
||||
|
||||
/* for (int k = 0; k < this.Grid_RRODUCT.Items.Count; k++)
|
||||
{
|
||||
//首先获取DataGridTemplateColumn所在列
|
||||
DataGridTemplateColumn tempColumn = this.Grid_RRODUCT.Columns[9] as DataGridTemplateColumn;
|
||||
|
||||
|
||||
//然后获取DataGridTemplateColumn单元格元素
|
||||
FrameworkElement element = this.Grid_RRODUCT.Columns[9].GetCellContent(this.Grid_RRODUCT.Items[k]);
|
||||
|
||||
|
||||
if (element != null)
|
||||
{
|
||||
//把单元格元素转换为相应的控件,再从该控件中取值
|
||||
System.Windows.Controls.CheckBox ck = Grid_RRODUCT.SelectedItems[1].CellTemplate.FindName("CP_PRODUCT_CODE", element) as System.Windows.Controls.CheckBox;
|
||||
|
||||
|
||||
if (ck.IsChecked.Value)
|
||||
{
|
||||
//do something here
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
if (e.Key == Key.Enter)
|
||||
{
|
||||
UserClass.PressKey.PressKeys(Keys.Right, false);
|
||||
|
||||
@@ -17,15 +17,14 @@ using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Threading;
|
||||
|
||||
|
||||
namespace formula_manage.ViewModel
|
||||
{
|
||||
///<Summary>
|
||||
/// RRODUCTiewModel
|
||||
///</Summary>
|
||||
///
|
||||
public class MainWindowViewModel : ViewModelBase
|
||||
{
|
||||
|
||||
DataTable DissolvedataTable = new DataTable(); //建立Dissolve缓存
|
||||
DataTable STUFFdataTable = new DataTable(); //建立STUFF缓存
|
||||
DataTable MACHINEdataTable = new DataTable(); //建立Machine缓存
|
||||
@@ -75,6 +74,9 @@ public class MainWindowViewModel : ViewModelBase
|
||||
Dissolve_data.Fill(DissolvedataTable); //machine查询结果存入缓存
|
||||
|
||||
conn_SC.Close(); //关闭连接
|
||||
|
||||
|
||||
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
@@ -93,6 +95,10 @@ public class MainWindowViewModel : ViewModelBase
|
||||
{
|
||||
sql_();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// public ObservableCollection (System.Collections.Generic.List<T> list);
|
||||
// BarCollection = (ObservableCollection<BarModel>)STUFFdataTable.AsDataView();
|
||||
// var qwe = STUFFdataTable.DefaultView;
|
||||
@@ -129,10 +135,10 @@ public class MainWindowViewModel : ViewModelBase
|
||||
|
||||
} */
|
||||
|
||||
_product = new ObservableCollection<Product>
|
||||
{
|
||||
new Product{ ProductCode= "132",ProductName= "123", ProductType= 12,Concentration= 12}
|
||||
};
|
||||
// _product = new ObservableCollection<Product>((IEnumerable<Product>));
|
||||
// {
|
||||
// new Product{ ProductCode= STUFFdataTable.Rows,ProductName= "123", ProductType= 12,Concentration= 12}
|
||||
// };
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user