Пример #1
0
        public ContractorForm(int id)
        {
            InitializeComponent();
            dbContext = new DB.DBModel();

            this.currentID = id;

            if (currentID != 0)
            {
                currentContractor = dbContext.Contractors.First(x => x.ID == id);
                FillExistingContractor();
                Text = currentContractor.Name;
            }
            else
            {
                currentContractor = new DB.Contractors();
                Text = "Новый контрагент";
            }
            fillContorls();
        }
Пример #2
0
 public void RemoveContractor(int id)
 {
     DB.Contractors currContractor = dbContext.Contractors.First(x => x.ID == id);
     currContractor.IsRemoved = true;
     dbContext.SaveChanges();
 }