2
Answers

platform dot net C# am using

Sinju George

Sinju George

14y
6.9k
1
I am developing leave management system in asp.net and C3 as language and am new to this asp.net,
Can anyone help me how can i make workflow
The requirement is if the immediate approver of that employee s not ther it should go to the next imediate superior
jus help me how can i finish,

Thanks In advance
Sinju
Answers (2)
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);
}