public void TestMethod3() { HttpRequest request = new HttpRequest("", "http://localhost", "a=1"); var httpRequestBase = new HttpRequestWrapper(request); var a = new StorageWareHouseDA(); var b = a.GetRequestWareSummary(httpRequestBase); // var query = from c in a.StorageWarehousings; // var c1 = a.StorageWarehousings.Where(m => m.ID == 1).FirstOrDefault(); // var b = query.FirstOrDefault(); }
public ActionResult GetProductToDay() { //TODO: get category chinh sach dai ly var todayCode = DateTime.Today.AddDays(1).TotalSeconds(); var result = GetProducts(todayCode); var cate = result; decimal quantity = 0; if (cate != null) { // lay so luong dat nhieu nhat var maxProductWeight = cate.Products.OrderByDescending(m => m.Weight / m.WeightRecipe).FirstOrDefault(); if (maxProductWeight != null) { quantity = Math.Round(Math.Ceiling(maxProductWeight.Weight * 10 / maxProductWeight.WeightRecipe) / 10, 2); } } var storageWareHouseDA = new StorageWareHouseDA(); var order = storageWareHouseDA.GetStorageWarehousingItem(todayCode, AgencyId); return(Json(new { Quantity = quantity, Data = result, Status = order?.Status })); }