//CU -> Create/Update
 public CUBranch(DelegateForm delegateForm, Branch edit = null)
 {
     InitializeComponent();
     setInitialData(edit);
     this.delegateForm = delegateForm;
     this.edit         = edit != null ? edit : new Branch();
 }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Address,Share,Payout_address,Min_payout,Payout_interval,Fees_covered,Contact,Contact_type,Notesa")] DelegateForm delegateForm)
        {
            if (id != delegateForm.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(delegateForm);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DelegateFormExists(delegateForm.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(delegateForm));
        }
Exemple #3
0
 //CU -> Create/Update
 public CreateClientForm(DelegateForm delegateForm, Client edit = null)
 {
     InitializeComponent();
     setInitialData(edit);
     this.delegateForm = delegateForm;
     this.edit         = edit != null ? edit : new Client();
 }
 public CUCompanyForm(DelegateForm delegateForm, Company edit = null)
 {
     InitializeComponent();
     setInitialData(edit);
     setEntryBox(edit);
     this.delegateForm = delegateForm;
     this.edit         = edit != null ? edit : new Company();
 }
        // GET: DelegateForms/Create
        public IActionResult Create()
        {
            DelegateForm dl = new DelegateForm();

            dl.Payout_interval = 1;

            return(View(dl));
        }
        public async Task <IActionResult> Create([Bind("Id,Address,Share,Payout_address,Min_payout,Payout_interval,Fees_covered,Contact,Contact_type,Notes")] DelegateForm delegateForm)
        {
            if (ModelState.IsValid)
            {
                _context.Add(delegateForm);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(delegateForm));
        }
Exemple #7
0
 public void SetParent(DelegateForm p)
 {
     parent = p;
 }