liaoxujun@qq.com
2024-02-23 6e831c9dd9a46a1dbd727f5f06068c10aef99b46
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using cy_scdz.Model.Set;
using Microsoft.EntityFrameworkCore;
 
namespace cy_scdz.ViewModel.Setting.PriceSettingVMs
{
    public partial class PriceSettingVM : BaseCRUDVM<PriceSetting>
    {
 
        public PriceSettingVM()
        {
        }
 
        protected override async void InitVM()
        {
          Entity =  DC.Set<PriceSetting>().FirstOrDefault();
            if(Entity == null)
            {
                var  fist= new PriceSetting();
                DC.Set<PriceSetting>().Add(fist);
              await  DC.SaveChangesAsync();
                Entity = DC.Set<PriceSetting>().FirstOrDefault();
            }
        }
 
        public override void DoAdd()
        {           
            base.DoAdd();
        }
 
        public override void DoEdit(bool updateAllFields = false)
        {
            base.DoEdit(updateAllFields);
        }
 
        public override void DoDelete()
        {
            base.DoDelete();
        }
    }
}