public CustAddressVM getAddressMasterInfoByID(string _ID) { objF01034 = new F01034Repository(); Mapper.CreateMap<F01034, CustAddressVM>(); F01034 objEntity = objF01034.GetSingle(x => x.CustomerID == _ID); CustAddressVM objResult = new CustAddressVM(); objResult = Mapper.Map(objEntity, objResult); return objResult; }
public IList<SalesDetailInfoModel> getAllSalesInfo(int page, int pagesize) { IList<SalesDetailInfoModel> resultObj = new List<SalesDetailInfoModel>(); SH = new F42020Repository(); SD = new F42021Repository(); Cust = new F01030Repository(); CustAddr = new F01034Repository(); var objSH = SH.GetAll(); var objSD = SD.GetAll(); var objCust = Cust.GetAll(); var objCustAddr = CustAddr.GetAll(); var objResultJoin = from sh in objSH join sd in objSD on new { DocType = sh.DocType, DocNo = sh.DocNo } equals new { DocType = sd.DocType, DocNo = sd.DocNo } join cust in objCust on sh.CustomerID equals cust.CustomerID join custAddr in objCustAddr on cust.CustomerID equals custAddr.CustomerID select new { sh.DocType, sh.DocNo, sd.LineNum, sh.CustomerID, cust.CustomerName, custAddr.TaxID, custAddr.Phone, custAddr.Email }; foreach (var data in objResultJoin) { SalesDetailInfoModel objSingle = new SalesDetailInfoModel(); objSingle.DocType = data.DocType; objSingle.DocNo = data.DocNo; objSingle.LineNum = data.LineNum; objSingle.CustomerID = data.CustomerID; objSingle.CustomerName = data.CustomerName; objSingle.TaxID = data.TaxID; objSingle.Phone = data.Phone; objSingle.Email = data.Email; resultObj.Add(objSingle); } return resultObj.OrderBy(a => a.DocType).ThenBy(a => a.DocNo).ThenBy(a => a.LineNum).Skip(page * pagesize).Take(pagesize).ToList(); }