コード例 #1
0
ファイル: MarkUpViewModel.cs プロジェクト: Osama91/CCWFM
 public void DeleteMainRow()
 {
     if (SelectedMainRows != null)
     {
         var res = MessageBox.Show("Are You To Delete SelectedRecords From Database ?", "Delete",
                                   MessageBoxButton.OKCancel);
         if (res == MessageBoxResult.OK)
         {
             foreach (var row in SelectedMainRows)
             {
                 if (row.Iserial != 0)
                 {
                     if (AllowDelete != true)
                     {
                         MessageBox.Show(strings.AllowDeleteMsg);
                         return;
                     }
                     Glclient.DeleteTblMarkupAsync((TblMarkup) new TblMarkup().InjectFrom(row), MainRowList.IndexOf(row), LoggedUserInfo.DatabasEname);
                 }
                 else
                 {
                     MainRowList.Remove(row);
                     if (!MainRowList.Any())
                     {
                         AddNewMainRow(false);
                     }
                 }
             }
         }
     }
 }
コード例 #2
0
ファイル: FamilyViewModel.cs プロジェクト: Osama91/CCWFM
 public void DeleteMainRow()
 {
     if (SelectedMainRows != null)
     {
         var res = MessageBox.Show("Are You To Delete SelectedRecords From Database ?", "Delete",
                                   MessageBoxButton.OKCancel);
         if (res == MessageBoxResult.OK)
         {
             foreach (var row in SelectedMainRows)
             {
                 if (row.Iserial != 0)
                 {
                     if (AllowDelete != true)
                     {
                         MessageBox.Show(strings.AllowDeleteMsg);
                         return;
                     }
                     Loading = true;
                     lkpClient.DeleteTblFamilyAsync(
                         (LkpData.TblFamily) new LkpData.TblFamily().InjectFrom(row), MainRowList.IndexOf(row));
                 }
                 else
                 {
                     MainRowList.Remove(row);
                     if (!MainRowList.Any())
                     {
                         AddNewMainRow(false);
                     }
                 }
             }
         }
     }
 }
コード例 #3
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;
                }
            }
        }
コード例 #4
0
        public void SaveOldRow(TblJournalSettingViewModel oldRow)
        {
            if (oldRow != null)
            {
                var valiationCollection = new List <ValidationResult>();

                var isvalid = Validator.TryValidateObject(oldRow,
                                                          new ValidationContext(oldRow, null, null), valiationCollection, true);

                if (isvalid)
                {
                    var save = oldRow.Iserial == 0;
                    if (AllowUpdate != true && !save)
                    {
                        MessageBox.Show(strings.AllowUpdateMsg);
                        return;
                    }
                    var saveRow = new TblJournalSetting();
                    saveRow.InjectFrom(oldRow);
                    if (!Loading)
                    {
                        Loading = true;
                        Glclient.UpdateOrInsertTblJournalSettingsAsync(saveRow, save, MainRowList.IndexOf(oldRow),
                                                                       LoggedUserInfo.DatabasEname);
                    }
                }
            }
        }