public ProductUidTransactionDetail GetProductUidTransactionDetail(int ProductUidId) { ProductUidTransactionDetail Temp = (from L in db.SaleDispatchLine join t2 in db.PackingLine on L.PackingLineId equals t2.PackingLineId join H in db.SaleDispatchHeader on L.SaleDispatchHeaderId equals H.SaleDispatchHeaderId into SaleDispatchHeaderTable from SaleDispatchHeaderTab in SaleDispatchHeaderTable.DefaultIfEmpty() where t2.ProductUidId == ProductUidId select new ProductUidTransactionDetail { DocLineId = L.SaleDispatchLineId, DocNo = SaleDispatchHeaderTab.DocNo }).FirstOrDefault(); return(Temp); }
public JsonResult SetSingleSaleDispatchLine(int Ids) { ComboBoxResult SaleDispatchJson = new ComboBoxResult(); var SaleDispatchLine = from L in db.SaleDispatchLine join H in db.SaleDispatchHeader on L.SaleDispatchHeaderId equals H.SaleDispatchHeaderId into SaleDispatchHeaderTable from SaleDispatchHeaderTab in SaleDispatchHeaderTable.DefaultIfEmpty() where L.SaleDispatchLineId == Ids select new { SaleDispatchLineId = L.SaleDispatchLineId, SaleDispatchNo = L.PackingLine.Product.ProductName }; SaleDispatchJson.id = SaleDispatchLine.FirstOrDefault().ToString(); SaleDispatchJson.text = SaleDispatchLine.FirstOrDefault().SaleDispatchNo; return(Json(SaleDispatchJson)); }