public PaymentDeadlineViewModel(PaymentDeadline paymentDeadline) { this.PaymentDeadlineID = paymentDeadline.PaymentDeadlineID; this.Description = paymentDeadline.Description; this.Days = paymentDeadline.Days; this.Months = paymentDeadline.Months; }
public async Task <ActionResult> Delete(int id) { PaymentDeadline paymentDeadline = await paymentDeadlineRepository.FindPaymentDeadlineByIDAsync(id); if (paymentDeadline == null) { return(HttpNotFound()); } return(View(paymentDeadline)); }
public async Task <ActionResult> Edit([Bind(Include = "PaymentDeadlineID,Description,Days")] PaymentDeadline paymentDeadline) { if (ModelState.IsValid) { await paymentDeadlineRepository.UpdateAsync(paymentDeadline); return(RedirectToAction("Index")); } return(View(paymentDeadline)); }
public static PaymentDeadlineViewModel FromPaymentDeadline(PaymentDeadline paymentDeadline) { return(new PaymentDeadlineViewModel(paymentDeadline)); }
public bool Get(long DocInvoice_ID) { string Err = null; Clear(); string sql = @"select di.IssueDate, di.TermsOfPayment_ID, di.MethodOfPayment_ID, di.PaymentDeadline, mop.Atom_BankAccount_ID, top.Description as TermsOfPayment_Description, mop.PaymentType, aba.TRR, ao.Name, ao.Tax_ID, ao.Registration_ID from DocInvoice di left join TermsOfPayment top on di.TermsOfPayment_ID = top.ID left join MethodOfPayment mop on di.MethodOfPayment_ID = mop.ID left join Atom_BankAccount aba on mop.Atom_BankAccount_ID = aba.ID left join Atom_Bank ab on aba.Atom_Bank_ID = ab.ID left join Atom_Organisation ao on ab.Atom_Organisation_ID = ao.ID where di.ID = " + DocInvoice_ID.ToString(); DataTable dt = new DataTable(); if (DBSync.DBSync.ReadDataTable(ref dt, sql, ref Err)) { if (dt.Rows.Count > 0) { m_IssueDate = DocInvoice_AddOn.IssueDate.Set(dt.Rows[0]["IssueDate"]); m_TermsOfPayment = DocInvoice_AddOn.TermsOfPayment.Set(dt.Rows[0]["TermsOfPayment_ID"], dt.Rows[0]["TermsOfPayment_Description"]); m_MethodOfPayment = DocInvoice_AddOn.MethodOfPayment.Set(dt.Rows[0]["MethodOfPayment_ID"], dt.Rows[0]["PaymentType"], dt.Rows[0]["Name"], dt.Rows[0]["Tax_ID"], dt.Rows[0]["Registration_ID"], dt.Rows[0]["TRR"], dt.Rows[0]["Atom_BankAccount_ID"]); m_PaymentDeadline = DocInvoice_AddOn.PaymentDeadline.Set(dt.Rows[0]["PaymentDeadline"]); } return true; } else { LogFile.Error.Show("ERROR:TangentaDB:DocInvoice_AddOn:Get:sql=" + sql + "\r\nErr=" + Err); return false; } }
internal static PaymentDeadline Set(object o) { if (o is DateTime) { PaymentDeadline xPaymentDeadline = new PaymentDeadline(); xPaymentDeadline.Date = (DateTime)o; return xPaymentDeadline; } else { return null; } }
private void Clear() { m_IssueDate = null; m_TermsOfPayment = null; m_MethodOfPayment = null; m_PaymentDeadline = null; }