wanghan 3 сар өмнө
parent
commit
b6ae617614

+ 18 - 15
LogForceTestApp.Modules.MainModule/ViewModels/MainPageViewModel.cs

@@ -245,11 +245,11 @@ namespace LogoForceTestApp.Modules.MainModule.ViewModels
             {
                 Products = new MulProductModel();
             }
-            Customer = _container.Resolve<CustomerInfor>();
-            if (Customer == null)
-            {
-                Customer = new CustomerInfor();
-            }
+            //Customer = _container.Resolve<CustomerInfor>();
+            //if (Customer == null)
+            //{
+            //    Customer = new CustomerInfor();
+            //}
 
             Connected = tcpNet.Connect();
 
@@ -1136,7 +1136,8 @@ namespace LogoForceTestApp.Modules.MainModule.ViewModels
                         if (mes.Split(":")[0] == "Fix")
                         {
                             string sp = mes.Split(":")[1];
-                            string wu = ResWord(mes.Split(":")[2]);
+                            string cl = mes.Split(":")[2];
+                            string wu = ResWord(mes.Split(":")[3]);
                             var res = repository.GetFirstDefault<Information>(c => c.ProCode == sp);
                             if (res != null)
                             {
@@ -1173,7 +1174,7 @@ namespace LogoForceTestApp.Modules.MainModule.ViewModels
                                 InforNew.Add(productNew);
                                 _repository.Add(product);
                             }));
-                                WriteCSV_Repair(Operator19,SelectedClientName, sp, wu);
+                                WriteCSV_Repair(Operator19,cl, sp, wu);
                                 client.Send("Rep:维修信息上传成功");
                                 WriteLog("维修1#维修信息上传成功");
                                 try
@@ -1211,8 +1212,9 @@ namespace LogoForceTestApp.Modules.MainModule.ViewModels
                         }
                         if (mes.Split(":")[0] == "Fix")
                         {
-                            string sp = mes.Split(":")[1];
-                            string wu = ResWord(mes.Split(":")[2]);
+                            string sp = mes.Split(":")[1]; 
+                            string cl = mes.Split(":")[2];
+                            string wu = ResWord(mes.Split(":")[3]);
                             var res = repository.GetFirstDefault<Information>(c => c.ProCode == sp);
                             if (res != null)
                             {
@@ -1249,7 +1251,7 @@ namespace LogoForceTestApp.Modules.MainModule.ViewModels
                                     InforNew.Add(productNew);
                                     _repository.Add(product);
                                 }));
-                                WriteCSV_Repair(Operator20, SelectedClientName, sp, wu);
+                                WriteCSV_Repair(Operator20, cl, sp, wu);
                                 client.Send("Rep:维修信息上传成功");
                                 WriteLog("维修2#维修信息上传成功");
                                 try
@@ -1287,8 +1289,9 @@ namespace LogoForceTestApp.Modules.MainModule.ViewModels
                         }
                         if (mes.Split(":")[0] == "Fix")
                         {
-                            string sp = mes.Split(":")[1];
-                            string wu = ResWord(mes.Split(":")[2]);
+                            string sp = mes.Split(":")[1]; 
+                            string cl = mes.Split(":")[2];
+                            string wu = ResWord(mes.Split(":")[3]);
                             var res = repository.GetFirstDefault<Information>(c => c.ProCode == sp);
                             if (res != null)
                             {
@@ -1325,7 +1328,7 @@ namespace LogoForceTestApp.Modules.MainModule.ViewModels
                                     InforNew.Add(productNew);
                                     _repository.Add(product);
                                 }));
-                                WriteCSV_Repair(Operator21, SelectedClientName, sp, wu);
+                                WriteCSV_Repair(Operator21, cl, sp, wu);
                                 client.Send("Rep:维修信息上传成功");
                                 WriteLog("维修3#维修信息上传成功");
                                 try
@@ -1628,8 +1631,8 @@ namespace LogoForceTestApp.Modules.MainModule.ViewModels
                         }
                     }
 
-                    Customer.ReadConfig();
-                    ClientNames = Customer.CustomerName;
+                    //Customer.ReadConfig();
+                    //ClientNames = Customer.CustomerName;
                 }
                 catch (Exception ex)
                 {

+ 2 - 3
LogForceTestApp.Modules.MainModule/Views/MainPage.xaml

@@ -280,7 +280,6 @@
                             </Grid.ColumnDefinitions>
                             <Grid.RowDefinitions>
                                 <RowDefinition />
-                                <RowDefinition />
                             </Grid.RowDefinitions>
                             <StackPanel Orientation="Horizontal"
                                         Grid.Column="0"
@@ -313,7 +312,7 @@
                                         Grid.Row="1"
                                         HorizontalAlignment="Center"
                                         VerticalAlignment="Center">
-                                <TextBlock Text="客户"
+                                <!--<TextBlock Text="客户"
                                            VerticalAlignment="Center" />
                                 <hc:ComboBox HorizontalAlignment="Center"
                                              VerticalAlignment="Center"
@@ -322,7 +321,7 @@
                                              Height="40"
                                              SelectedItem="{Binding SelectedClientName}"
                                              ItemsSource="{Binding ClientNames}"
-                                             FontSize="16" />
+                                             FontSize="16" />-->
                             </StackPanel>
                             <!--<Button Content="添加新客户"
                                     VerticalAlignment="Center"