示例#1
0
        public void SaveFromStyleHeader()
        {
            ViewModel.AddNewMainRow();
            ProductionService.ProductionServiceClient _client = new ProductionService.ProductionServiceClient();
            foreach (var row in ViewModel.MainRowList.Where(x => x.Iserial == 0))
            {
                var isvalid = Validator.TryValidateObject(row,
                                                          new ValidationContext(row, null, null), null, true);

                if (isvalid)
                {
                    var saveRow = new ProductionService.TblStyleTNAStatusDetail();

                    saveRow.InjectFrom(row);
                    int x = ViewModel.MainRowList.IndexOf(row); //Retail Approved
                    saveRow.TblStyleTnaStatus = 1;
                    _client.UpdateOrInsertTblStyleTNAStatusDetailAsync(saveRow, ViewModel.MainRowList.IndexOf(row));
                }


                //_client.GetTblStyleTNAStatusDetailAsync(ViewModel.TempStyleViewModel.SelectedTnaRow.Iserial);
                //_client.GetTblStyleTNAStatusDetailCompleted += (s, sv) =>
                //{
                //    //if (sv.Error != null)
                //    //{
                //    //    MessageBox.Show(sv.Error.Message);
                //    //}

                //    //foreach (var row in sv.Result)
                //    //{
                //    //    var newrow = new TblStyleTNAStatusDetailModel();
                //    //    newrow.InjectFrom(row);
                //    //    newrow.UserPerRow = row.TblAuthUser1;
                //    //    newrow.StyleTNAStatusPerRow = new GenericTable();
                //    //    if (row.TblStyleTNAStatu != null)
                //    //    {
                //    //        GenericTable newTempRow = new GenericTable().InjectFrom(row.TblStyleTNAStatu) as GenericTable;
                //    //        newrow.StyleTNAStatusPerRow = newTempRow;
                //    //    }
                //    //    ViewModel.MainRowList.Add(newrow);
                //    //}

                //    }
                //   // ViewModel.SaveMainRow();
                //};
            }
        }
示例#2
0
        public void SaveMainRow()
        {
            foreach (var row in MainRowList.Where(x => x.Iserial == 0))
            {
                var isvalid = Validator.TryValidateObject(row,
                                                          new ValidationContext(row, null, null), null, true);

                if (isvalid)
                {
                    var saveRow = new ProductionService.TblStyleTNAStatusDetail();

                    saveRow.InjectFrom(row);
                    int x = MainRowList.IndexOf(row);
                    ProductionClient.UpdateOrInsertTblStyleTNAStatusDetailAsync(saveRow, MainRowList.IndexOf(row));
                    TempStyleViewModel.Loading = true;
                    Loading = true;
                }
            }
        }