public JsonResult SetSingleSaleInvoiceLine(int Ids) { ComboBoxResult SaleInvoiceJson = new ComboBoxResult(); var SaleInvoiceLine = from L in db.SaleInvoiceLine join H in db.SaleInvoiceHeader on L.SaleInvoiceHeaderId equals H.SaleInvoiceHeaderId into SaleInvoiceHeaderTable from SaleInvoiceHeaderTab in SaleInvoiceHeaderTable.DefaultIfEmpty() where L.SaleInvoiceLineId == Ids select new { SaleInvoiceLineId = L.SaleInvoiceLineId, SaleInvoiceNo = L.Product.ProductName }; SaleInvoiceJson.id = SaleInvoiceLine.FirstOrDefault().ToString(); SaleInvoiceJson.text = SaleInvoiceLine.FirstOrDefault().SaleInvoiceNo; return(Json(SaleInvoiceJson)); }
public IQueryable <DispatchWaybillHeaderViewModel> GetDispatchWaybillHeaderList(int DocTypeId, string Uname) { IQueryable <DispatchWaybillHeaderViewModel> DispatchWaybillHeader = from H in db.DispatchWaybillHeader join p in db.Persons on H.ConsigneeId equals p.PersonID into PersonTable from PersonTab in PersonTable.DefaultIfEmpty() join s in db.SaleInvoiceHeader on H.SaleInvoiceHeaderId equals s.SaleInvoiceHeaderId into SaleInvoiceHeaderTable from SaleInvoiceHeaderTab in SaleInvoiceHeaderTable.DefaultIfEmpty() where H.DocTypeId == DocTypeId orderby H.DispatchWaybillHeaderId select new DispatchWaybillHeaderViewModel { DispatchWaybillHeaderId = H.DispatchWaybillHeaderId, DocDate = H.DocDate, DocNo = H.DocNo, ConsigneeName = PersonTab.Name, SaleInvoiceHeaderDocNo = SaleInvoiceHeaderTab.DocNo, WaybillNo = H.WaybillNo, WaybillDate = H.WaybillDate, Remark = H.Remark, Status = H.Status, ModifiedBy = H.ModifiedBy, ReviewCount = H.ReviewCount, ReviewBy = H.ReviewBy, Reviewed = (SqlFunctions.CharIndex(Uname, H.ReviewBy) > 0), }; return(DispatchWaybillHeader); }
public IQueryable <CustomDetailViewModel> GetCustomDetailListPendingToApprove() { IQueryable <CustomDetailViewModel> CustomDetaillistpendingtoapprove = from H in db.CustomDetail join s in db.SaleInvoiceHeader on H.SaleInvoiceHeaderId equals s.SaleInvoiceHeaderId into SaleInvoiceHeaderTable from SaleInvoiceHeaderTab in SaleInvoiceHeaderTable.DefaultIfEmpty() orderby H.DocDate descending, H.DocNo descending where H.Status == (int)StatusConstants.Submitted || H.Status == (int)StatusConstants.ModificationSubmitted select new CustomDetailViewModel { CustomDetailId = H.CustomDetailId, DocDate = H.DocDate, DocNo = H.DocNo, SaleInvoiceHeaderDocNo = SaleInvoiceHeaderTab.DocNo, TRNo = H.TRNo, TRDate = H.TRDate, Remark = H.Remark, }; return(CustomDetaillistpendingtoapprove); }
public CustomDetailViewModel GetCustomDetailViewModel(int id) { CustomDetailViewModel packingheaderlistpendingtoapprove = (from H in db.CustomDetail join s in db.SaleInvoiceHeader on H.SaleInvoiceHeaderId equals s.SaleInvoiceHeaderId into SaleInvoiceHeaderTable from SaleInvoiceHeaderTab in SaleInvoiceHeaderTable.DefaultIfEmpty() orderby H.DocDate descending, H.DocNo descending where H.CustomDetailId == id select new CustomDetailViewModel { CustomDetailId = H.CustomDetailId, DocDate = H.DocDate, DocNo = H.DocNo, SaleInvoiceHeaderDocNo = SaleInvoiceHeaderTab.DocNo, TRNo = H.TRNo, TRDate = H.TRDate, Remark = H.Remark, }).FirstOrDefault(); return(packingheaderlistpendingtoapprove); }
public IQueryable <CustomDetailViewModel> GetCustomDetailViewModelForIndex() { IQueryable <CustomDetailViewModel> CustomDetail = from H in db.CustomDetail join s in db.SaleInvoiceHeader on H.SaleInvoiceHeaderId equals s.SaleInvoiceHeaderId into SaleInvoiceHeaderTable from SaleInvoiceHeaderTab in SaleInvoiceHeaderTable.DefaultIfEmpty() join d in db.DocumentType on H.DocTypeId equals d.DocumentTypeId into DocumentTypeTable from DocumentTypeTab in DocumentTypeTable.DefaultIfEmpty() orderby H.CustomDetailId select new CustomDetailViewModel { CustomDetailId = H.CustomDetailId, DocDate = H.DocDate, DocNo = H.DocNo, DocTypeName = DocumentTypeTab.DocumentTypeName, SaleInvoiceHeaderDocNo = SaleInvoiceHeaderTab.DocNo, TRNo = H.TRNo, TRDate = H.TRDate, Remark = H.Remark, }; return(CustomDetail); }