private OrderSerializerBody GetOrderInformation(order o)
{
string address = string.Format("{0}://{1}", Request.Url.Scheme, Request.Url.Authority);
UserSerealizerBody cook = GetUserInfoBuffered(o.Id_Cook);
aspnetuser cust = DataManager.User.GetUserByIdBuffered(o.Id_Customer);
UserSerealizerBody customer = new UserSerealizerBody
{
Id = o.Id_Customer,
Email = o.Email,
Address = o.Address,
FirstName = o.FirstName,
Surname = o.Surname,
Phone = o.Phone,
Username = cust == null ? null : cust.UserName,
AvatarUrl = cust == null ? null : (address + cust.Avatar_Url)
};
OrderSerializerBody res = new OrderSerializerBody
{
Comment = o.Comment,
Comunication = o.ordercontactmethod.Name,
Deadline = o.DeadLine == null ? null : ConvertToUnixTime((DateTime)o.DeadLine).ToString(),
Delivery = o.orderdelivery.Name,
FinishTime = o.FinishTime == null ? null : ConvertToUnixTime((DateTime)o.FinishTime).ToString(),
Payment = o.orderpaymentmethod.Name,
Status = o.orderstatu.Name,
Cook = cook,
Id_Order = o.Id_Order,
Total = o.total,
IngridientsBuyer = o.orderingridientbuyer.Name,
Customer = customer
};
return res;
}