public InvoiceInfo GetInvoiceInfo(string id)
 {
     using (InvoiceDBEntities invoiceDBEntities = new InvoiceDBEntities())
     {
         invoiceDBEntities.Configuration.ProxyCreationEnabled = false;
         return(invoiceDBEntities.InvoiceInfoes.Where(x => x.InvoiceID == id).SingleOrDefault());
     }
 }
 public IEnumerable <InvoiceInfo> GetCompanyInvoice(int id)
 {
     using (InvoiceDBEntities invoiceDBEntities = new InvoiceDBEntities())
     {
         invoiceDBEntities.Configuration.ProxyCreationEnabled = false;
         return(invoiceDBEntities.InvoiceInfoes.Where(x => x.CompanyID == id).ToList());
     }
 }
 public string CreateInvoice([FromBody] IInvoice invoice)
 {
     using (InvoiceDBEntities invoiceDBEntities = new InvoiceDBEntities())
     {
         ObjectParameter outParam = new ObjectParameter("newid", typeof(string));
         invoiceDBEntities.CreateInvoice(invoice.companyID, invoice.customerID, invoice.shippingAddress, outParam);
         return((string)outParam.Value);
     }
 }
 public int CreateCompany([FromBody] ICompany company)
 {
     using (InvoiceDBEntities invoiceDBEntities = new InvoiceDBEntities())
     {
         ObjectParameter outParam = new ObjectParameter("newid", typeof(int));
         invoiceDBEntities.CreateCompany(company.companyname, company.companyAddress, outParam);
         return((int)outParam.Value);
     }
 }
Ejemplo n.º 5
0
 public CustomerRepository()
 {
     objInvoiceDbEntities = new InvoiceDBEntities();
 }
Ejemplo n.º 6
0
 public HomeController()
 {
     objInvoiceDbEntities = new InvoiceDBEntities();
 }
Ejemplo n.º 7
0
 public PaymentTypeRepository()
 {
     objInvoiceDbEntities = new InvoiceDBEntities();
 }
Ejemplo n.º 8
0
 public ItemRepository()
 {
     objInvoiceDbEntities = new InvoiceDBEntities();
 }
Ejemplo n.º 9
0
 public OrderRepository()
 {
     objInvoiceDbEntities = new InvoiceDBEntities();
 }