1
Answer

help with linking forms in VB.NET

Joshua Bell

Joshua Bell

19y
1.7k
1
Ok, here is the problem. I'm creating a program to mess around with while i'm still learning VB. I've created several forms and need to link them together. Well, I finally figured out how to put a link on the main form but I don't know how to tell the program which form the link needs to go to. Ex: creating a program for a company. On the main page of the program I have inserted a link to the payroll form. Now how do I tell the program to make the link go to the payroll form. Here is what I have so far: (I don't know what to do after this though.)

Dim f2 As New Form

f2.Show()

LinkLabel1.LinkVisited = True

Answers (1)
1
Naresh Singhal

Naresh Singhal

NA 567 850 7y
Hi , going through your problem, i think you need to use Linq join to retireve data from muliple
 
tables, to use join its very simple  :) 
0
First Last

First Last

NA 35 469 7y
Actually, I resolved this (with help from a great guy) and here is the working action method:
 
It creates a header/multi detail view (not a flattend view which i was intially trying to get).
 
CustomerName CustomerImage OrderDate
   Quantity ProductName, ProductType, ProductImage
CustomerName CustomerImage OrderDate
   Quantity ProductName, ProductType, ProductImage
CustomerName CustomerImage OrderDate
   Quantity ProductName, ProductType, ProductImage 
 
public ActionResult GetCustomerOrdersDetails()
{
// Calls the method to populate the list.
List customerOrders = null;
using (DashboardContext _context = new DashboardContext())
{
customerOrders = _context.OrderSet
.GroupBy(x => new { Name = x.Customer.CustomerName, Image = x.Customer.CustomerImage, Date = x.OrderDate })
.Select(x => new CustomerOrdersViewModel
{
CustomerName = x.Key.Name,
CustomerImage = x.Key.Image,
OrderDate = x.Key.Date,
OrderDetailsViewModel = x.SelectMany(y => y.OrderDetail).Select(y => new OrderDetailsViewModel
{
Quantity = y.Quatity,
ProductType = y.Product.ProductType,
ProductName = y.Product.ProductName,
ProductImage = y.Product.ProductImage
}).ToList()
}).ToList();
}
// Return a partial view.
return PartialView("~/Views/Dashboard/GetCustomerOrdersDetails.cshtml", customerOrders);
}