public int GetMySpotOrdersCount(MyOrderQry aMyOrderQry) { logger.InfoFormat("GetMySpotOrdersCount {0}", aMyOrderQry.ToString()); int lCount = _BOCWebDBContext.OrderDatas.Where(e => e.SendCompanyName == aMyOrderQry.username && e.FutureOrSpot == 1 && e.BuyOrSell == aMyOrderQry.Side).Count(); return lCount; }
public List<SpotOrderInfo> GetMySpotOrders(MyOrderQry aMyOrderQry) { logger.InfoFormat("GetMySpotOrders {0}", aMyOrderQry.ToString()); List<BOC.Entities.OrderData> lOrders = _BOCWebDBContext.OrderDatas.Where(e => e.SendCompanyName == aMyOrderQry.username && e.FutureOrSpot == 1 && e.BuyOrSell == aMyOrderQry.Side) .OrderByDescending(e => e.PostDate) .Skip(aMyOrderQry.pagesize * (aMyOrderQry.page - 1)) .Take(aMyOrderQry.pagesize).ToList(); List<SpotOrderInfo> SpotOrderList = new List<SpotOrderInfo>(); foreach (BOC.Entities.OrderData orderdata in lOrders) { SpotOrderInfo lSpotOrderInfo = new SpotOrderInfo(); lSpotOrderInfo.OrderDataID = orderdata.OrderDataID; lSpotOrderInfo.Cuts = orderdata.Cuts; lSpotOrderInfo.SubCuts = orderdata.SubCuts; lSpotOrderInfo.Grade = orderdata.Grade; lSpotOrderInfo.SubGrade = orderdata.SubGrade; lSpotOrderInfo.Origin = orderdata.Origin; lSpotOrderInfo.EstablishmentNumber = orderdata.EstablishmentNumber; lSpotOrderInfo.Halal = orderdata.Halal; lSpotOrderInfo.Packing = orderdata.Packing; lSpotOrderInfo.Packedon = orderdata.Packedon; lSpotOrderInfo.ExpirationDate = orderdata.ExpirationDate; lSpotOrderInfo.Quantity = orderdata.Quantity; lSpotOrderInfo.Price = orderdata.Price.ToString().Trim('0').Trim('.'); lSpotOrderInfo.PhoneContact = orderdata.PhoneContact; lSpotOrderInfo.StorageLocation = orderdata.StorageLocation; lSpotOrderInfo.Delivery = orderdata.Delivery; lSpotOrderInfo.Validity = orderdata.Validity; lSpotOrderInfo.PostDate = orderdata.PostDate; lSpotOrderInfo.PicLink = orderdata.PicLink; lSpotOrderInfo.SendCompanyName = orderdata.SendCompanyName; lSpotOrderInfo.BoneinOrLess = orderdata.BoneinOrLess; lSpotOrderInfo.OxType = orderdata.OxType; lSpotOrderInfo.OxAge = orderdata.OxAge; lSpotOrderInfo.RaiseType = orderdata.RaiseType; lSpotOrderInfo.RaiseDays = orderdata.RaiseDays; lSpotOrderInfo.ShowCount = _BOCWebDBContext.ShowOrderInfos.Where(e => e.OrderDataID == orderdata.OrderDataID).Count(); SpotOrderList.Add(lSpotOrderInfo); } return SpotOrderList; }
public int MyShowInterestFutureOrdersCount(MyOrderQry aMyOrderQry) { logger.InfoFormat("MyShowInterestFutureOrdersCount {0}", aMyOrderQry.ToString()); int lOrderReturnsCount = _BOCWebDBContext.OrderReturns.Where(e => e.UserName == aMyOrderQry.username) .OrderByDescending(e => e.ReturnDateTime) .Skip(aMyOrderQry.pagesize * (aMyOrderQry.page - 1)) .Take(aMyOrderQry.pagesize).Count(); return lOrderReturnsCount; }
public List<FutureOrderInfo> GetMyFutureOrders(MyOrderQry aMyOrderQry) { logger.InfoFormat("GetMyFutureOrders {0}", aMyOrderQry.ToString()); List<BOC.Entities.OrderData> lOrders = _BOCWebDBContext.OrderDatas.Where(e => e.SendCompanyName == aMyOrderQry.username && e.FutureOrSpot == 0) .OrderByDescending(e => e.PostDate) .Skip(aMyOrderQry.pagesize * (aMyOrderQry.page - 1)) .Take(aMyOrderQry.pagesize).ToList(); List<FutureOrderInfo> FutureOrderList = new List<FutureOrderInfo>(); foreach (BOC.Entities.OrderData orderdata in lOrders) { FutureOrderInfo lFutureOrderInfo = new FutureOrderInfo(); lFutureOrderInfo.OrderDataID = orderdata.OrderDataID; lFutureOrderInfo.Cuts = orderdata.Cuts; lFutureOrderInfo.SubCuts = orderdata.SubCuts; lFutureOrderInfo.Grade = orderdata.Grade; lFutureOrderInfo.SubGrade = orderdata.SubGrade; lFutureOrderInfo.Origin = orderdata.Origin; lFutureOrderInfo.EstablishmentNumber = orderdata.EstablishmentNumber; lFutureOrderInfo.Halal = orderdata.Halal; lFutureOrderInfo.Packing = orderdata.Packing; lFutureOrderInfo.Packedon = orderdata.Packedon; lFutureOrderInfo.ExpirationDate = orderdata.ExpirationDate; lFutureOrderInfo.Quantity = orderdata.Quantity; lFutureOrderInfo.ShippingTerm = orderdata.ShippingTerm; lFutureOrderInfo.TargetPriceNegotiate = orderdata.TargetPriceNegotiate; lFutureOrderInfo.TargetPrice = orderdata.TargetPrice.ToString().Trim('0').Trim('.'); lFutureOrderInfo.PhoneContact = orderdata.PhoneContact; lFutureOrderInfo.Payment = orderdata.Payment; lFutureOrderInfo.Shipment = orderdata.Shipment; lFutureOrderInfo.Validity = orderdata.Validity; lFutureOrderInfo.PostDate = orderdata.PostDate; lFutureOrderInfo.Status = orderdata.Status; lFutureOrderInfo.PicLink = orderdata.PicLink; lFutureOrderInfo.SendCompanyName = orderdata.SendCompanyName; lFutureOrderInfo.PhoneContact = orderdata.PhoneContact; lFutureOrderInfo.IsOpen = orderdata.IsOpen; lFutureOrderInfo.BoneinOrLess = orderdata.BoneinOrLess; lFutureOrderInfo.OxType = orderdata.OxType; lFutureOrderInfo.OxAge = orderdata.OxAge; lFutureOrderInfo.RaiseType = orderdata.RaiseType; lFutureOrderInfo.RaiseDays = orderdata.RaiseDays; lFutureOrderInfo.IsPaymentTT = orderdata.IsPaymentTT; lFutureOrderInfo.PaymentFirstPercentage = orderdata.PaymentFirstPercentage; lFutureOrderInfo.PaymentFirst = orderdata.PaymentFirst; lFutureOrderInfo.PaymentSecondPercentage = orderdata.PaymentSecondPercentage; lFutureOrderInfo.PaymentSecond = orderdata.PaymentSecond; lFutureOrderInfo.BoneinOrLess = orderdata.BoneinOrLess; lFutureOrderInfo.ShowCount = _BOCWebDBContext.ShowOrderInfos.Where(e => e.OrderDataID == orderdata.OrderDataID).Count(); int lShowInterestCount = 0; int lReturnInterestCount = 0; int lNotReturnsInterestCount = 0; int lNotShowIntrerestCount = 0; List<BOC.Entities.OrderReturn> lOrderReturns = _BOCWebDBContext.OrderReturns.Where(e => e.OrderDataID == orderdata.OrderDataID).ToList(); foreach (BOC.Entities.OrderReturn orderreturn in lOrderReturns) { lShowInterestCount++; if (orderreturn.RetrurnStatus == 1) { lReturnInterestCount++; } if (orderreturn.RetrurnStatus == 0) { lNotReturnsInterestCount++; } if (!orderreturn.HasShowed) { lNotShowIntrerestCount++; } } lFutureOrderInfo.ShowInterestCount = lShowInterestCount; lFutureOrderInfo.ReturnInterestCount = lReturnInterestCount; lFutureOrderInfo.NotReturnsInterestCount = lNotReturnsInterestCount; lFutureOrderInfo.NotShowIntrerestCount = lNotShowIntrerestCount; FutureOrderList.Add(lFutureOrderInfo); } return FutureOrderList; }
public List<ReturnFutureOrderInfo> MyShowInterestFutureOrders(MyOrderQry aMyOrderQry) { logger.InfoFormat("MyShowInterestFutureOrders {0}", aMyOrderQry.ToString()); List<BOC.Entities.OrderReturn> lOrderReturns = _BOCWebDBContext.OrderReturns.Where(e => e.UserName == aMyOrderQry.username) .OrderByDescending(e => e.ReturnDateTime) .Skip(aMyOrderQry.pagesize * (aMyOrderQry.page - 1)) .Take(aMyOrderQry.pagesize).ToList(); List<ReturnFutureOrderInfo> lReturnFutureOrderInfo = new List<ReturnFutureOrderInfo>(); foreach(BOC.Entities.OrderReturn lOrderReturn in lOrderReturns) { BOC.Entities.OrderData lOrderData = _BOCWebDBContext.OrderDatas.Where(e => e.OrderDataID == lOrderReturn.OrderDataID).First(); if (lOrderData != null) { ReturnFutureOrderInfo lReturenFutureOrderInfo = new ReturnFutureOrderInfo(); lReturenFutureOrderInfo.OrderDataID = lOrderData.OrderDataID; lReturenFutureOrderInfo.Cuts = lOrderData.Cuts; lReturenFutureOrderInfo.SubCuts = lOrderData.SubCuts; lReturenFutureOrderInfo.Grade = lOrderData.Grade; lReturenFutureOrderInfo.SubGrade = lOrderData.SubGrade; lReturenFutureOrderInfo.Origin = lOrderData.Origin; if (lOrderReturn.RetrurnStatus == 1) { lReturenFutureOrderInfo.EstablishmentNumber = lOrderData.EstablishmentNumber; } else { if(lOrderData.EstablishmentNumber!= null && lOrderData.EstablishmentNumber != "") { lReturenFutureOrderInfo.EstablishmentNumber = "******"; } } lReturenFutureOrderInfo.Halal = lOrderData.Halal; lReturenFutureOrderInfo.Packing = lOrderData.Packing; lReturenFutureOrderInfo.Packedon = lOrderData.Packedon; lReturenFutureOrderInfo.ExpirationDate = lOrderData.ExpirationDate; lReturenFutureOrderInfo.Quantity = lOrderData.Quantity; lReturenFutureOrderInfo.ShippingTerm = lOrderData.ShippingTerm; lReturenFutureOrderInfo.TargetPriceNegotiate = lOrderData.TargetPriceNegotiate; lReturenFutureOrderInfo.TargetPrice = lOrderData.TargetPrice; lReturenFutureOrderInfo.PhoneContact = lOrderData.PhoneContact; lReturenFutureOrderInfo.Payment = lOrderData.Payment; lReturenFutureOrderInfo.Shipment = lOrderData.Shipment; lReturenFutureOrderInfo.Validity = lOrderData.Validity; lReturenFutureOrderInfo.PostDate = lOrderData.PostDate; lReturenFutureOrderInfo.Status = lOrderData.Status; lReturenFutureOrderInfo.PicLink = lOrderData.PicLink; lReturenFutureOrderInfo.SendCompanyName = lOrderData.SendCompanyName; lReturenFutureOrderInfo.IsPaymentTT = lOrderData.IsPaymentTT; lReturenFutureOrderInfo.PaymentFirstPercentage = lOrderData.PaymentFirstPercentage; lReturenFutureOrderInfo.PaymentFirst = lOrderData.PaymentFirst; lReturenFutureOrderInfo.PaymentSecondPercentage = lOrderData.PaymentSecondPercentage; lReturenFutureOrderInfo.PaymentSecond = lOrderData.PaymentSecond; lReturenFutureOrderInfo.BoneinOrLess = lOrderData.BoneinOrLess; lReturenFutureOrderInfo.OxType = lOrderData.OxType; lReturenFutureOrderInfo.OxAge = lOrderData.OxAge; lReturenFutureOrderInfo.RaiseType = lOrderData.RaiseType; lReturenFutureOrderInfo.RaiseDays = lOrderData.RaiseDays; lReturenFutureOrderInfo.ShowCount = _BOCWebDBContext.ShowOrderInfos.Where(e => e.OrderDataID == lOrderData.OrderDataID).Count(); int lShowInterestCount = 0; int lReturnInterestCount = 0; int lNotReturnsInterestCount = 0; int lNotShowIntrerestCount = 0; List<BOC.Entities.OrderReturn> lOrderReturnss = _BOCWebDBContext.OrderReturns.Where(e => e.OrderDataID == lOrderData.OrderDataID).ToList(); foreach (BOC.Entities.OrderReturn orderreturn in lOrderReturnss) { lShowInterestCount++; if (orderreturn.RetrurnStatus == 1) { lReturnInterestCount++; } if (orderreturn.RetrurnStatus == 0) { lNotReturnsInterestCount++; } if (!orderreturn.HasShowed) { lNotShowIntrerestCount++; } } lReturenFutureOrderInfo.ShowInterestCount = lShowInterestCount; lReturenFutureOrderInfo.ReturnInterestCount = lReturnInterestCount; lReturenFutureOrderInfo.NotReturnsInterestCount = lNotReturnsInterestCount; lReturenFutureOrderInfo.NotShowIntrerestCount = lNotShowIntrerestCount; MyShowInterestInfo lMyShowInterestInfo = new MyShowInterestInfo(); lMyShowInterestInfo.OrderReturnID = lOrderReturn.OrderReturnID; lMyShowInterestInfo.OrderDataID = lOrderReturn.OrderDataID; lMyShowInterestInfo.UserName = lOrderReturn.UserName; lMyShowInterestInfo.PriceNegotiate = lOrderReturn.PriceNegotiate; lMyShowInterestInfo.Price = lOrderReturn.Price; lMyShowInterestInfo.PaymentNegotiate = lOrderReturn.PaymentNegotiate; lMyShowInterestInfo.Payment = lOrderReturn.Payment; lMyShowInterestInfo.Quantity = lOrderReturn.Quantity; lMyShowInterestInfo.RetrunStatus = lOrderReturn.RetrurnStatus; lMyShowInterestInfo.ReturnDateTime = lOrderReturn.ReturnDateTime; lMyShowInterestInfo.PriceAcceptableFlag = lOrderReturn.PriceAcceptableFlag; lMyShowInterestInfo.MyCounterPriceFlag = lOrderReturn.MyCounterPriceFlag; lMyShowInterestInfo.MyCounterPrice = lOrderReturn.MyCounterPrice; lMyShowInterestInfo.MyAcceptPriceRengeFlag = lOrderReturn.MyAcceptPriceRengeFlag; lMyShowInterestInfo.MyAcceptPriceRengeOrg = lOrderReturn.MyAcceptPriceRengeOrg; lMyShowInterestInfo.MyAcceptPriceRenge = lOrderReturn.MyAcceptPriceRenge; lMyShowInterestInfo.NegotiateFlag = lOrderReturn.NegotiateFlag; lMyShowInterestInfo.HasShowed = lOrderReturn.HasShowed; lMyShowInterestInfo.HasReturnShowed = lOrderReturn.HasRetrunShowed; lMyShowInterestInfo.IsPaymentTT = lOrderReturn.IsPaymentTT; lMyShowInterestInfo.PaymentFirstPercentage = lOrderReturn.PaymentFirstPercentage; lMyShowInterestInfo.PaymentFirst = lOrderReturn.PaymentFirst; lMyShowInterestInfo.PaymentSecondPercentage = lOrderReturn.PaymentSecondPercentage; lMyShowInterestInfo.PaymentSecond = lOrderReturn.PaymentSecond; //List<BOC.Entities.CompanyBtcFile> lCompanyBtcFiles = _BOCWebDBContext.CompanyBtcFiles.Where(e => e.CompanyName == lOrderData.SendCompanyName).ToList(); //if (lCompanyBtcFiles.Count > 0) //{ // BOC.Entities.CompanyBtcFile lCompanyBtcFile = lCompanyBtcFiles.First(); // if (lCompanyBtcFile != null) // { // lMyShowInterestInfo.BtcFile = lCompanyBtcFile.CompanyBtCFile; // } //} if (lOrderReturn.RetrurnStatus == 1) { BOC.Entities.Company lCompany = _BOCWebDBContext.Companys.Where(e => e.LoginUserName == lOrderData.SendCompanyName).First(); if (lCompany != null) { if (lCompany.CompanyName != null && lCompany.CompanyName != "") { lMyShowInterestInfo.CompanyName = lCompany.CompanyName; } else { lMyShowInterestInfo.CompanyName = "_none"; } if (lCompany.CompanyLocalName != null && lCompany.CompanyLocalName != "") { lMyShowInterestInfo.CompanyLocalName = lCompany.CompanyLocalName; } else { lMyShowInterestInfo.CompanyLocalName = "_none"; } if (lCompany.CompanyEmail != null && lCompany.CompanyEmail != "") { lMyShowInterestInfo.CompanyEmail = lCompany.CompanyEmail; } else { lMyShowInterestInfo.CompanyEmail = "_none"; } if (lCompany.CompanyPhoneNumber != null && lCompany.CompanyPhoneNumber != "") { lMyShowInterestInfo.CompanyPhoneNumber = lCompany.CompanyPhoneNumber; } else { lMyShowInterestInfo.CompanyPhoneNumber = "_none"; } if (lCompany.CompanyFaxNumber != null && lCompany.CompanyFaxNumber != "") { lMyShowInterestInfo.CompanyFaxNumber = lCompany.CompanyFaxNumber; } else { lMyShowInterestInfo.CompanyFaxNumber = "_none"; } if (lCompany.CompanyWebSite != null && lCompany.CompanyWebSite != "") { lMyShowInterestInfo.CompanyWebSite = lCompany.CompanyWebSite; } else { lMyShowInterestInfo.CompanyWebSite = "_none"; } if (lCompany.CompanyCountry != null && lCompany.CompanyCountry != "") { lMyShowInterestInfo.CompanyCountry = lCompany.CompanyCountry; } else { lMyShowInterestInfo.CompanyCountry = "_none"; } if (lCompany.CompanyProvince != null && lCompany.CompanyProvince != "") { lMyShowInterestInfo.CompanyProvince = lCompany.CompanyProvince; } else { lMyShowInterestInfo.CompanyProvince = "_none"; } if (lCompany.CompanyAddress != null && lCompany.CompanyAddress != "") { lMyShowInterestInfo.CompanyAddress = lCompany.CompanyAddress; } else { lMyShowInterestInfo.CompanyAddress = "_none"; } BOC.Entities.ContactPerson lContactPerson = lCompany.ContactPersons.First(); if (lContactPerson != null) { if (lContactPerson.ContactPersonName != null && lContactPerson.ContactPersonName != "") { lMyShowInterestInfo.ContactPersonName = lContactPerson.ContactPersonName; } else { lMyShowInterestInfo.ContactPersonName = "_none"; } if (lContactPerson.ContactPersonCellPhoneNumber != null && lContactPerson.ContactPersonCellPhoneNumber != "") { lMyShowInterestInfo.ContactPersonCellPhoneNumber = lContactPerson.ContactPersonCellPhoneNumber; } else { lMyShowInterestInfo.ContactPersonCellPhoneNumber = "_none"; } if(lContactPerson.ContactPersonEnglishName != null && lContactPerson.ContactPersonEnglishName != "") { lMyShowInterestInfo.ContactPersonEnglishName = lContactPerson.ContactPersonEnglishName; } else { lMyShowInterestInfo.ContactPersonEnglishName = "_none"; } //lMyShowInterestInfo.ContactPersonCellPhoneNumber = lContactPerson.ContactPersonCellPhoneNumber; } } lMyShowInterestInfo.BtcFileInfo = GetTrueBtcFile(lOrderData.SendCompanyName); } else { BOC.Entities.Company lCompany = _BOCWebDBContext.Companys.Where(e => e.LoginUserName == lOrderData.SendCompanyName).First(); if (lCompany != null) { if(lCompany.CompanyName != null && lCompany.CompanyName != "") { lMyShowInterestInfo.CompanyName = "******"; } else { lMyShowInterestInfo.CompanyName = "_none"; } if (lCompany.CompanyLocalName != null && lCompany.CompanyLocalName != "") { lMyShowInterestInfo.CompanyLocalName = "******"; } else { lMyShowInterestInfo.CompanyLocalName = "_none"; } if (lCompany.CompanyEmail != null && lCompany.CompanyEmail != "") { lMyShowInterestInfo.CompanyEmail = "******"; } else { lMyShowInterestInfo.CompanyEmail = "_none"; } if (lCompany.CompanyPhoneNumber != null && lCompany.CompanyPhoneNumber != "") { lMyShowInterestInfo.CompanyPhoneNumber = "******"; } else { lMyShowInterestInfo.CompanyPhoneNumber = "_none"; } if (lCompany.CompanyFaxNumber != null && lCompany.CompanyFaxNumber != "") { lMyShowInterestInfo.CompanyFaxNumber = "******"; } else { lMyShowInterestInfo.CompanyFaxNumber = "_none"; } if (lCompany.CompanyWebSite != null && lCompany.CompanyWebSite != "") { lMyShowInterestInfo.CompanyWebSite = "******"; } else { lMyShowInterestInfo.CompanyWebSite = "_none"; } if (lCompany.CompanyCountry != null && lCompany.CompanyCountry != "") { lMyShowInterestInfo.CompanyCountry = lCompany.CompanyCountry; } else { lMyShowInterestInfo.CompanyCountry = "_none"; } if (lCompany.CompanyProvince != null && lCompany.CompanyProvince != "") { if (lMyShowInterestInfo.CompanyCountry != "_china") { lMyShowInterestInfo.CompanyProvince = "******"; } else { lMyShowInterestInfo.CompanyProvince = lCompany.CompanyProvince; } } else { lMyShowInterestInfo.CompanyProvince = "_none"; } if (lCompany.CompanyAddress != null && lCompany.CompanyAddress != "") { lMyShowInterestInfo.CompanyAddress = "******"; } else { lMyShowInterestInfo.CompanyAddress = "_none"; } BOC.Entities.ContactPerson lContactPerson = lCompany.ContactPersons.First(); if (lContactPerson != null) { if (lContactPerson.ContactPersonName != null && lContactPerson.ContactPersonName != "") { lMyShowInterestInfo.ContactPersonName = "******"; } else { lMyShowInterestInfo.ContactPersonName = "_none"; } if (lContactPerson.ContactPersonCellPhoneNumber != null && lContactPerson.ContactPersonCellPhoneNumber != "") { lMyShowInterestInfo.ContactPersonCellPhoneNumber = "******"; } else { lMyShowInterestInfo.ContactPersonCellPhoneNumber = "_none"; } if (lContactPerson.ContactPersonEnglishName != null && lContactPerson.ContactPersonEnglishName != "") { lMyShowInterestInfo.ContactPersonEnglishName = "******"; } else { lMyShowInterestInfo.ContactPersonEnglishName = "_none"; } } else { lMyShowInterestInfo.ContactPersonName = "_none"; lMyShowInterestInfo.ContactPersonCellPhoneNumber = "_none"; } } else { lMyShowInterestInfo.CompanyName = "_none"; lMyShowInterestInfo.CompanyLocalName = "_none"; lMyShowInterestInfo.CompanyEmail = "_none"; lMyShowInterestInfo.CompanyPhoneNumber = "_none"; lMyShowInterestInfo.CompanyFaxNumber = "_none"; lMyShowInterestInfo.CompanyWebSite = "_none"; lMyShowInterestInfo.CompanyCountry = "_none"; lMyShowInterestInfo.CompanyProvince = "_none"; lMyShowInterestInfo.CompanyAddress = "_none"; lMyShowInterestInfo.ContactPersonName = "_none"; lMyShowInterestInfo.ContactPersonCellPhoneNumber = "_none"; lMyShowInterestInfo.ContactPersonEnglishName = "_none"; } lMyShowInterestInfo.BtcFileInfo = GetFackBtcFile(lOrderData.SendCompanyName); } lReturenFutureOrderInfo.MyShowInterestInfo = lMyShowInterestInfo; lReturnFutureOrderInfo.Add(lReturenFutureOrderInfo); } } return lReturnFutureOrderInfo; }