public List <OrderOutputItem> ProcessOrderDetails(OrderKey orderKey, OrderDetails orderDetails) { if (!_orderDictionary.ContainsKey(orderKey)) { //create new order and assume no output var order = new Order() { OrderDetails = orderDetails }; _orderDictionary.Add(orderKey, order); return(null); } else { var order = _orderDictionary[orderKey]; if (order.OrderDetails != null) { return(null); } order.OrderDetails = orderDetails; if (!order.OrderComplete()) { return(null); } return(order.MapToOutputItems()); } }
public override int GetHashCode() { unchecked { var hashCode = Billing != null?Billing.GetHashCode() : 0; hashCode = (hashCode * 397) ^ (CartHash != null ? CartHash.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (CartTax != null ? CartTax.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (CreatedVia != null ? CreatedVia.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Currency != null ? Currency.GetHashCode() : 0); hashCode = (hashCode * 397) ^ CustomerId; hashCode = (hashCode * 397) ^ (CustomerIpAddress != null ? CustomerIpAddress.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (CustomerNote != null ? CustomerNote.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (CustomerUserAgent != null ? CustomerUserAgent.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (DiscountTax != null ? DiscountTax.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (DiscountTotal != null ? DiscountTotal.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Id; hashCode = (hashCode * 397) ^ (Number != null ? Number.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (OrderKey != null ? OrderKey.GetHashCode() : 0); hashCode = (hashCode * 397) ^ ParentId; hashCode = (hashCode * 397) ^ (PaymentMethod != null ? PaymentMethod.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (PaymentMethodTitle != null ? PaymentMethodTitle.GetHashCode() : 0); hashCode = (hashCode * 397) ^ PricesIncludeTax.GetHashCode(); hashCode = (hashCode * 397) ^ (Shipping != null ? Shipping.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (ShippingTax != null ? ShippingTax.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (ShippingTotal != null ? ShippingTotal.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Status != null ? Status.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Total != null ? Total.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (TotalTax != null ? TotalTax.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (TransactionId != null ? TransactionId.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Version != null ? Version.GetHashCode() : 0); return(hashCode); } }
public OrderSession HoleOrderOnline(POSAirPortClassesDataContext _posDB, string order_no) { var order = GetOrderOnline(order_no); if (order == null) { throw new ObjectNotFoundException(order_no + " : data not found."); } var pos_key_order = new OrderKey(order); var pos_data = _posDB.df_header_onls.FirstOrDefault(x => x.doc_no == pos_key_order.DocNO && x.OnlineNo == order_no); if (pos_data == null) { throw new ObjectNotFoundException(order_no + " : data not found."); } int status = (int)StatusOrderPOS.HoldOrder; pos_data.LastStatus = status.ToString("0000"); pos_data.update_datetime = DateTime.Now; pos_data.user_update = "online"; _posDB.SubmitChanges(); UdpateOrderSession(order_no, pos_data.LastStatus); return(UpdateStatusOrderOnline(order_no, "hold")); }
public override string ToString() { return("Hosting unit key: " + HostingUnitKey.ToString() + "/n" + "Guest request key: " + GuestRequestKey.ToString() + "/n" + "Order key: " + OrderKey.ToString() + "/n" + "Status: " + Status.ToString() + "/n" + "Orderd date: " + OrderDate.ToString() + "/n" + "Create date" + CreateDate.ToString() + "/n"); }
public override string ToString() { return ("Hosting Unit Key: " + HostingUnitKey.ToString() + "\n" + "Guest Request Key: " + GuestRequestKey.ToString() + "\n" + "Order Key: " + OrderKey.ToString() + "\n" + "Fee: " + Fee.ToString() + "\n" + "Status: " + Status.ToString() + "\n" + "Create Date: " + CreateDate.ToString() + "\n"); //+ "Order Date: " + OrderDate.ToString() + "\n"; }
public override int GetHashCode() { //Get hash code for the Name field if it is not null. int hashProductName = OrderKey == null ? 0 : OrderKey.GetHashCode(); //Get hash code for the Code field. int hashProductCode = DeliveryOrder.GetHashCode(); //Calculate the hash code for the product. return(hashProductName ^ hashProductCode); }
public OrderKey Create(OrderKeyRowDto dto) { var orderKey = new OrderKey { ProductId = dto.ProductId, FreightId = dto.FreightId, Description = dto.Description, Requestor = _requestorService.Get(dto.RequestorInitials) }; return(orderKey); }
public DataSet GetListStationType() { string table = "SFCB.B_STATION_TYPE_NAME"; string fieldlist = "stationtype,stationtypename"; int count = 0; //待实现 order by 20150203 michael List <OrderKey> lok = new List <OrderKey>(); OrderKey ok = new OrderKey(); ok.KeyName = "StationType"; ok.IsAsc = true; lok.Add(ok); return(TransactionManager.GetData(table, fieldlist, null, null, lok, null, out count)); }
public System.Data.DataSet GetBomNoParts(string BomNumber) { int count = 0; string fieldlist = "kpnumber,kprelation,station"; string filter = "bomnumber={0}"; IList <OrderKey> order = new List <OrderKey>(); OrderKey od1 = new OrderKey(); od1.KeyName = "station,kprelation"; od1.IsAsc = true; order.Add(od1); IDictionary <string, object> mst = new Dictionary <string, object>(); mst.Add("bomnumber", BomNumber); return(TransactionManager.GetData(table, fieldlist, filter, mst, order, null, out count)); }
private List <OrderKey> GenerateOrderKeysForCart(Cart cart) { Debug.WriteLine($"Generating {cart.fobCount} FOB and {cart.cardCount} Cards"); List <OrderKey> keys = new List <OrderKey>(); for (int index = 1; index <= cart.fobCount; index++) { OrderKey key = new OrderKey(); key.resident_id = user.Result.Id; key.visitor_id = "Not Implemented"; key.card_type = "Fob"; key.package_room_access = "deny"; key.front_door_access = "allow"; key.shipping_fullname = user.Result.FirstName + " " + user.Result.LastName; key.shipping_phone = user.Result.CellPhone; key.shipping_street = user.Result.Street; key.shipping_apartment_number = user.Result.ApartmentNumber; key.shipping_state = user.Result.State; key.shipping_country = "USA"; key.shipping_zip = user.Result.ZipCode; keys.Add(key); } for (int index = 1; index <= cart.cardCount; index++) { OrderKey key = new OrderKey(); key.resident_id = user.Result.Id; key.visitor_id = "Not Implemented"; key.card_type = "Card"; key.package_room_access = "deny"; key.front_door_access = "allow"; key.shipping_fullname = user.Result.FirstName + " " + user.Result.LastName; key.shipping_phone = user.Result.CellPhone; key.shipping_street = user.Result.Street; key.shipping_apartment_number = user.Result.ApartmentNumber; key.shipping_state = user.Result.State; key.shipping_country = "USA"; key.shipping_zip = user.Result.ZipCode; keys.Add(key); } return(keys); }
public bool Equals(OrderHead other) { //Check whether the compared object is null. if (Object.ReferenceEquals(other, null)) { return(false); } //Check whether the compared object references the same data. if (Object.ReferenceEquals(this, other)) { return(true); } //Check whether the products' properties are equal. return(OrderKey.Equals(other.OrderKey) && ExternOrderKey.Equals(other.ExternOrderKey) && CMCode.Equals(other.CMCode) && DeliveryOrder.Equals(other.DeliveryOrder)); }
public void HandleInput(List <OrderInput> orderInput) { var orderDetails = orderInput.Select(x => new OrderDetails(x.OrderReference, x.Marketplace, x.Name, x.Surname)).ToList(); foreach (OrderDetails order in orderDetails) { var orderKey = new OrderKey(order.OrderReference, order.Marketplace); var orderOutput = ProcessOrderDetails(orderKey, order); if (orderOutput != null) { _outputter.ConfigureOutput(orderOutput); _outputter.ProcessOutput(); } } }
public void HandleInput(List <OrderShipmentInput> orderShipmentInput) { var orderShipments = orderShipmentInput.Select(x => new OrderShipment(x.OrderReference, x.Marketplace, x.ShippingService, x.Postcode)); foreach (OrderShipment orderShipment in orderShipments) { var orderKey = new OrderKey(orderShipment.OrderReference, orderShipment.Marketplace); var orderOutput = ProcessOrderShipment(orderKey, orderShipment); if (orderOutput != null) { _outputter.ConfigureOutput(orderOutput); _outputter.ProcessOutput(); } } }
public System.Data.DataSet GetMaterialPreparation(string woId, string masterId) { int count = 0; string table = "SFCR.T_MATERIAL_PREPARATION MP, SFCR.T_SMT_KP_MASTER KM"; string fieldlist = "MP.WOID,MP.PARTNUMBER,MP.STATIONNO,MP.MASTERID,MP.KPNUMBER,MP.KPDESC,MP.REPLACEGROUP,MP.KPDISTINCT,MP.LOCALTION,MP.BOMVER,MP.SIDE,KM.LINEID AS MACHINEID,KM.MODELNAME,MP.FEEDERTYPE"; string filter = "KM.MASTERID = MP.MASTERID AND MP.WOID ={0} AND MP.MASTERID = {1}"; IList <OrderKey> order = new List <OrderKey>(); OrderKey od1 = new OrderKey(); od1.KeyName = "MP.STATIONNO"; od1.IsAsc = true; order.Add(od1); IDictionary <string, object> mst = new Dictionary <string, object>(); mst.Add("WOID", woId); mst.Add("MASTERID", masterId); return(TransactionManager.GetData(table, fieldlist, filter, mst, order, null, out count)); }
public void HandleInput(List <OrderItemInput> orderItemInput) { var groupedItems = orderItemInput.GroupBy(x => new { x.OrderReference, x.Marketplace }); foreach (var items in groupedItems) { var orderItems = items.Select(x => new OrderItem(x.OrderReference, x.Marketplace, x.OrderItemNumber, x.Sku, x.PricePerUnit, x.Quantity)) .ToList(); var orderKey = new OrderKey(items.Key.OrderReference, items.Key.Marketplace); var orderOutput = ProcessOrderItems(orderKey, orderItems); if (orderOutput != null) { _outputter.ConfigureOutput(orderOutput); _outputter.ProcessOutput(); } } }
/// <summary> /// 获取存储过程明细 /// </summary> /// <param name="StationId"></param> /// <returns></returns> public DataSet GetSystemStoredproc(int StationId) { int count = 0; string table = "SFCB.B_WORK_TYPE a ,SFCB.b_Work_Type_Name b"; string fieldlist = "a.STATION_TYPE,a.Storedproc,a.StoredprocIdx,a.WORK_TYPE_INDEX,a.SECOND,a.WorkType,a.Fork,a.InRam,a.LastOne,b.WorkTypeName,b.Code,b.PARAM"; string filter = "a.WorkType = b.WorkType and a.Station_Type={0}"; //string group = "a.STATION_TYPE"; IList <OrderKey> order = new List <OrderKey>(); OrderKey od1 = new OrderKey(); od1.KeyName = "a.StoredprocIdx"; od1.IsAsc = true; OrderKey od2 = new OrderKey(); od2.KeyName = "a.WORK_TYPE_INDEX "; od2.IsAsc = true; order.Add(od1); order.Add(od2); IDictionary <string, object> mst = new Dictionary <string, object>(); mst.Add("Station_Type", StationId); return(TransactionManager.GetData(table, fieldlist, filter, mst, order, null, out count)); }
private OrderSession SaveSessionOrder(POSAirPortClassesDataContext _posDB, OrderHeader order, df_header_onl new_order) { // order_session db save var new_session_order = new order_session(); new_session_order.session_guid = Guid.NewGuid(); new_session_order.sale_agent_code = order.NewOrder.AgentCode; new_session_order.sale_order_no = order.NewOrder.OrderNo; new_session_order.sale_order_status = "Create"; new_session_order.sale_invoice_no = order.NewOrder.InvoiceNo; new_session_order.sale_platform = "online"; var obj_key = new OrderKey(); obj_key.Date = new_order.data_date.Date.ToString(); obj_key.DocNO = new_order.doc_no.ToString(); obj_key.MacNo = new_order.machine_no.Trim(); new_session_order.pos_order_key = JsonConvert.SerializeObject(obj_key); new_session_order.pos_order_no = new_order.machine_no.Trim() + "-" + new_order.doc_no; new_session_order.pos_order_status = new_order.LastStatus; new_session_order.pos_invice_no = new_order.machine_no.Trim() + "-" + new_order.runno; new_session_order.create_date = DateTime.Now; new_session_order.modified_date = DateTime.Now; _omDB.order_sessions.InsertOnSubmit(new_session_order); _omDB.SubmitChanges(); // order_tran db save var new_tren_order = new order_transaction(); new_tren_order.create_date = DateTime.Now; new_tren_order.session_id = new_session_order.id; new_tren_order.datail = "Create Sale Order Online [" + new_session_order.sale_order_no + "] <---> POS Order [" + new_session_order.pos_order_no + "]"; _omDB.order_transactions.InsertOnSubmit(new_tren_order); _omDB.SubmitChanges(); SaveLogInterface(_posDB, order, new_session_order); return(new OrderSession(new_session_order)); }
/// <summary> /// /// </summary> /// <param name="count"></param> /// <param name="ok"></param> /// <param name="hairEngineerName"></param> /// <returns></returns> public List<HairEngineer> GetHairEngineers(int count, OrderKey ok,string hairEngineerName) { List<HairEngineer> list = new List<HairEngineer>(); string orderKey = " order by "; switch (ok) { case OrderKey.ID: orderKey += "he.HairEngineerID desc"; break; case OrderKey.CommentNum: orderKey += "he.HairEngineerGood+he.HairEngineerBad desc"; break; case OrderKey.RecommandNum: orderKey += "he.HairEngineerRecommandNum desc"; break; case OrderKey.HitNum: orderKey += "he.HairEngineerHits desc"; break; case OrderKey.OrderNum: orderKey += "he.HairEngineerOrderNum desc"; break; default: orderKey += "he.HairEngineerID desc"; break; } string commText = ""; switch (count) { case 0: commText = "select * from HairEngineer he left join HairShop hs on hs.HairShopID = he.HairShopID where he.HairEngineerName like '%"+hairEngineerName.ToString()+"%'" + orderKey; break; default: commText = "select top " + count.ToString() + " * from HairEngineer he left join HairShop hs on hs.HairShopID = he.HairShopID where he.HairEngineerName like '%" + hairEngineerName.ToString() + "%'" + orderKey; break; } using (SqlConnection conn = new SqlConnection(DataHelper2.SqlConnectionString)) { { using (SqlCommand comm = new SqlCommand()) { comm.Connection = conn; comm.CommandText = commText; conn.Open(); using (SqlDataReader sdr = comm.ExecuteReader()) { while (sdr.Read()) { HairEngineer hairEngineer = new HairEngineer(); hairEngineer.HairEngineerID = int.Parse(sdr["HairEngineerID"].ToString()); hairEngineer.HairEngineerAge = sdr["HairEngineerAge"].ToString(); hairEngineer.HairEngineerName = sdr["HairEngineerName"].ToString(); hairEngineer.HairEngineerSex = int.Parse(sdr["HairEngineerSex"].ToString()); //hairEngineer.HairEngineerPhoto = sdr["HairEngineerPhoto"].ToString(); hairEngineer.HairShopID = int.Parse(sdr["HairShopID"].ToString()); hairEngineer.HairShopName = sdr["HairShopName"].ToString(); hairEngineer.HairEngineerYear = sdr["HairEngineerYear"].ToString(); hairEngineer.HairEngineerSkill = sdr["HairEngineerSkill"].ToString(); hairEngineer.HairEngineerTagIDs = sdr["HairEngineerTagIDs"].ToString(); hairEngineer.HairEngineerPictureStoreIDs = sdr["HairEngineerPictureStoreIDs"].ToString(); hairEngineer.HairEngineerHits = int.Parse(sdr["HairEngineerHits"].ToString()); hairEngineer.HairEngineerDescription = sdr["HairEngineerDescription"].ToString(); //hairEngineer.HairEngineerOrderNum = int.Parse(sdr["HairEngineerOrderNum"].ToString()); //hairEngineer.HairEngineerRecommandNum = int.Parse(sdr["HairEngineerRecommandNum"].ToString()); hairEngineer.HairEngineerRawPrice = sdr["HairEngineerRawPrice"].ToString(); hairEngineer.HairEngineerTel = sdr["HairEngineerTel"].ToString(); hairEngineer.HairEngineerGood = int.Parse(sdr["HairEngineerGood"].ToString()); hairEngineer.HairEngineerBad = int.Parse(sdr["HairEngineerBad"].ToString()); hairEngineer.HairEngineerClassID = sdr["HairEngineerClassID"].ToString(); hairEngineer.HairEngineerClassName = sdr["HairEngineerClassID"].ToString(); hairEngineer.HairEngineerConstellation = sdr["HairEngineerConstellation"].ToString(); list.Add(hairEngineer); } } } } } return list; }
/// <summary> /// ��ȡ����ʦ�����б� /// </summary> /// <param name="userID"></param> /// <param name="count"></param> /// <param name="orderKey">����KEY ����ʱ�������պ�������������ʦ����</param> /// <returns></returns> public List<HairEngineerComment> GetHairEngineerCommentsByUserID(int userID, int count, OrderKey ok) { List<HairEngineerComment> list = new List<HairEngineerComment>(); string orderKey = " order by "; switch (ok) { case OrderKey.Good: orderKey += "IsGood desc"; break; case OrderKey.ID: orderKey += "HairEngineerID desc"; break; case OrderKey.Time: orderKey += "HairEngineerCommentCreateTime desc"; break; default: orderKey += "HairEngineerCommentID desc"; break; } string commText = string.Empty; switch (count) { case 0: commText = "select * from HairEngineerComment where UserID=" + userID.ToString() + orderKey; break; default: commText = "select top " + count.ToString() + " * from HairEngineerComment where UserID=" + userID.ToString() + orderKey; break; } using (SqlConnection conn = new SqlConnection(DataHelper2.SqlConnectionString)) { { using (SqlCommand comm = new SqlCommand()) { comm.Connection = conn; comm.CommandText = commText; conn.Open(); using (SqlDataReader sdr = comm.ExecuteReader()) { while (sdr.Read()) { HairEngineerComment hairEngineerComment = new HairEngineerComment(); hairEngineerComment.CommentCreateTime = Convert.ToDateTime(sdr["HairEngineerCommentCreateTime"].ToString()); hairEngineerComment.CommentID = int.Parse(sdr["HairEngineerCommentID"].ToString()); hairEngineerComment.CommentText = sdr["HairEngineerCommentText"].ToString(); hairEngineerComment.HairEngineerID = int.Parse(sdr["HairEngineerID"].ToString()); hairEngineerComment.UserAddress = sdr["UserAddress"].ToString(); hairEngineerComment.UserID = int.Parse(sdr["UserID"].ToString()); hairEngineerComment.UserName = sdr["UserName"].ToString(); hairEngineerComment.IsGood = Convert.ToBoolean(sdr["IsGood"].ToString()); list.Add(hairEngineerComment); } } } } } return list; }
private void UpdateRenderOrderKey(RenderContext context) { //var dist = Math.Abs((BoundsSphereWithTransform.Center - context.Camera.Position).Length() - BoundsSphereWithTransform.Radius); //RenderOrderKey = OrderKey.Create(RenderOrder, dist); RenderOrderKey = OrderKey.Create(RenderOrder, 0); }
protected virtual OrderKey OnUpdateRenderOrderKey() { return(OrderKey.Create(RenderOrder, 0)); }
public List<ArticleComment> GetArticleCommentsByUserID(int userID, int count, OrderKey ok) { List<ArticleComment> list = new List<ArticleComment>(); string orderKey = " order by "; switch (ok) { //case OrderKey.Good: // orderKey = "IsGood desc"; // break; case OrderKey.ID: orderKey = "ArticleID desc"; break; case OrderKey.Time: orderKey = "ArticleCommentCreateTime desc"; break; default: orderKey = "ArticleCommentID desc"; break; } string commText = string.Empty; switch (count) { case 0: commText = "SELECT ArticleCommentText, UserID, UserName, UserAddress, ArticleCommentCreateTime, ArticleID, ArticleCommentID " + " FROM ArticleComment " + " WHERE (UserID = " + userID + ") "+ orderKey ; break; default: commText = "select top " + count.ToString() + " * from ArticleComment WHERE (UserID = " + userID + ")" + orderKey ; break; } using (SqlConnection conn = new SqlConnection(DataHelper2.SqlConnectionString)) { { using (SqlCommand comm = new SqlCommand()) { comm.Connection = conn; comm.CommandText = commText; conn.Open(); using (SqlDataReader reader = comm.ExecuteReader()) { while (reader.Read()) { ArticleComment comment = new ArticleComment(); comment.CommentID = int.Parse(reader["ArticleCommentID"].ToString()); comment.ArticleID = int.Parse(reader["ArticleID"].ToString()); comment.CommentCreateTime = DateTime.Parse(reader["ArticleCommentCreateTime"].ToString()); comment.CommentText = reader["ArticleCommentText"].ToString(); comment.UserAddress = reader["UserAddress"].ToString(); comment.UserID = int.Parse(reader["UserID"].ToString()); comment.UserName = reader["UserName"].ToString(); list.Add(comment); } } } } } return list; }
//public HairShop GetHairShopByEntityID(Int32 HairShopID) //{ } /// <summary> /// ��������� /// </summary> /// <param name="count">0 ȫ��</param> /// <returns></returns> public List<HairShop> GetHairShops(int count,OrderKey ok) { List<HairShop> list = new List<HairShop>(); string orderKey = " order by "; switch (ok) { case OrderKey.ID: orderKey += "hs.HairShopID desc"; break; case OrderKey.CommentNum: orderKey += "hs.HairShopGood+hs.HairShopBad desc"; break; case OrderKey.RecommandNum: orderKey += "hs.HairShopRecommandNum desc"; break; case OrderKey.HitNum: orderKey += "hs.HairShopVisitNum desc"; break; case OrderKey.OrderNum: orderKey += "hs.HairShopOrderNum desc"; break; default: orderKey += "hs.HairShopID desc"; break; } string commText = ""; switch (count) { case 0: commText = "select * from HairShop hs left join City c on hs.HairShopCityID=c.cityID left join MapZone m on hs.HairShopMapZoneID = m.MapZoneID left join HotZone h on hs.HairShopHotZoneID = h.HotZoneID left join TypeTable tt on hs.TypeID=tt.TypeID"+orderKey; break; default: commText = "select top " + count.ToString() + " * from HairShop hs left join City c on hs.HairShopCityID=c.cityID left join MapZone m on hs.HairShopMapZoneID = m.MapZoneID left join HotZone h on hs.HairShopHotZoneID = h.HotZoneID left join TypeTable tt on hs.TypeID=tt.TypeID" + orderKey; break; } using (SqlDataReader sdr = SqlHelper.ExecuteReader(DataHelper2.SqlConnectionString, CommandType.Text, commText)) { while (sdr.Read()) { HairShop hairShop = new HairShop(); hairShop.HairShopID = int.Parse(sdr["HairShopID"].ToString()); hairShop.HairShopName = sdr["HairShopName"].ToString(); hairShop.HairShopCityID = int.Parse(sdr["HairShopCityID"].ToString()); hairShop.HairShopCityName = sdr["CityName"].ToString(); hairShop.HairShopMapZoneID = int.Parse(sdr["HairShopMapZoneID"].ToString()); hairShop.HairShopMapZoneName = sdr["MapZoneName"].ToString(); hairShop.HairShopHotZoneID = int.Parse(sdr["HairShopHotZoneID"].ToString()); hairShop.HairShopHotZoneName = sdr["HotZoneName"].ToString(); hairShop.HairShopAddress = sdr["HairShopAddress"].ToString(); hairShop.HairShopPhoneNum = sdr["HairShopPhoneNum"].ToString(); ///hairShop.HairShopPictureStoreIDs = sdr["HairShopPictureStoreIDs"].ToString(); //hairShop.HairShopMainIDs = sdr["HairShopMainIDs"].ToString(); //hairShop.HairShopPartialIDs = sdr["HairShopPartialIDs"].ToString(); hairShop.HairShopEngineerNum = int.Parse(sdr["HairShopEngineerNum"].ToString()); hairShop.HairShopOpenTime = sdr["HairShopOpenTime"].ToString(); //hairShop.HairShopOrderNum = int.Parse(sdr["HairShopOrderNum"].ToString()); hairShop.HairShopVisitNum = int.Parse(sdr["HairShopVisitNum"].ToString()); //hairShop.WorkRangeIDs = sdr["WorkRangeIDs"].ToString(); hairShop.HairShopWebSite = sdr["HairShopWebSite"].ToString(); hairShop.HairShopEmail = sdr["HairShopEmail"].ToString(); hairShop.HairShopDiscount = sdr["HairShopDiscount"].ToString(); hairShop.HairShopLogo = sdr["HairShopLogo"].ToString(); hairShop.TravelInfo = sdr["TravelInfo"].ToString(); // try // { // hairShop.HairShopRecommandNum = int.Parse(sdr["HairShopRecommandNum"].ToString()); // } //catch // { // hairShop.HairShopRecommandNum = 0; //} hairShop.HairShopCreateTime = sdr["HairShopCreateTime"].ToString(); hairShop.HairShopDescription = sdr["HairShopDescription"].ToString(); hairShop.ProductIDs = sdr["ProductIDs"].ToString(); hairShop.HairShopTagIDs = sdr["HairShopTagIDs"].ToString(); hairShop.HairShopShortName = sdr["HairShopShortName"].ToString(); //hairShop.IsBest = bool.Parse(sdr["IsBest"].ToString()); hairShop.IsJoin = bool.Parse(sdr["IsJoin"].ToString()); hairShop.TypeID = int.Parse(sdr["TypeID"].ToString()); hairShop.TypeName = sdr["TypeName"].ToString(); hairShop.IsPostStation = bool.Parse(sdr["IsPostStation"].ToString()); hairShop.IsPostMachine = bool.Parse(sdr["IsPostMachine"].ToString()); hairShop.HairShopGood = int.Parse(sdr["HairShopGood"].ToString()); hairShop.HairShopBad = int.Parse(sdr["HairShopBad"].ToString()); hairShop.OutLogs = sdr["outLogs"].ToString(); hairShop.InnerLogs = sdr["innerLogs"].ToString(); Decimal parseValue; Decimal.TryParse(sdr["HairCutPrice"].ToString(), out parseValue); hairShop.HairCutPirce = parseValue; Decimal.TryParse(sdr["HairCutDiscount"].ToString(), out parseValue); hairShop.HairCutDiscount = parseValue; Decimal.TryParse(sdr["HairMarcelPrice"].ToString(), out parseValue); hairShop.HairMarcelPrice = parseValue; Decimal.TryParse(sdr["HairMarcelDiscount"].ToString(), out parseValue); hairShop.HairMarcelDiscount = parseValue; Decimal.TryParse(sdr["HairDyePrice"].ToString(), out parseValue); hairShop.HairDyePrice = parseValue; Decimal.TryParse(sdr["HairDyeDiscount"].ToString(), out parseValue); hairShop.HairDyeDiscount = parseValue; Decimal.TryParse(sdr["HairShapePrice"].ToString(), out parseValue); hairShop.HairShapePrice = parseValue; Decimal.TryParse(sdr["HairShapeDiscount"].ToString(), out parseValue); hairShop.HairShapeDiscount = parseValue; Decimal.TryParse(sdr["HairConservationPrice"].ToString(), out parseValue); hairShop.HairConservationPrice = parseValue; Decimal.TryParse(sdr["HairConservationDiscount"].ToString(), out parseValue); hairShop.HairConservationDiscount = parseValue; hairShop.LocationMapURL = sdr["LocationMapURL"].ToString(); if (sdr["IsServeMarcel"] == null || bool.Parse(sdr["IsServeMarcel"].ToString()) == false) hairShop.IsServeMarce = false; else hairShop.IsServeMarce = true; if (sdr["IsServeDye"] == null || bool.Parse(sdr["IsServeDye"].ToString()) == false) hairShop.IsServeDye = false; else hairShop.IsServeDye = true; if (sdr["IsServeHairCut"] == null || bool.Parse(sdr["IsServeHairCut"].ToString()) == false) hairShop.IsServeHairCut = false; else hairShop.IsServeHairCut = true; hairShop.Square = sdr["Square"].ToString(); //zhh add check int value=0; int.TryParse(sdr["HairShopNormal"].ToString(),out value); hairShop.HairShopNormal = value; int.TryParse(sdr["postid"].ToString(), out value); hairShop.Postid = value; list.Add(hairShop); } } return list; }
/// <summary> /// /// </summary> /// <param name="Top"></param> /// <param name="WhereCaused"></param> /// <param name="Key"></param> /// <returns></returns> public DataTable GetHairShopList(int Top, String WhereCaused, OrderKey Key) { StringBuilder orderKey = new StringBuilder(); orderKey.Append(" order by "); switch (Key) { case OrderKey.ID: orderKey.Append("HairShopID desc"); break; case OrderKey.CommentNum: orderKey.Append("HairShopGood+HairShopBad desc"); break; case OrderKey.RecommandNum: orderKey.Append("HairShopRecommandNum desc"); break; case OrderKey.HitNum: orderKey.Append("HairShopVisitNum desc"); break; case OrderKey.OrderNum: orderKey.Append("HairShopOrderNum desc"); break; default: orderKey.Append("HairShopID desc"); break; } String cmdText = String.Empty; switch (Top) { case 0: cmdText = @"SELECT HairShopID, HairShopName, HairShopVisitNum, CASE WHEN HairShopGood = 0 OR HairShopBad = 0 THEN 0 WHEN HairShopGood != 0 AND HairShopBad != 0 THEN HairShopGood/(HairShopGood + HairShopBad) END AS 'HairGoodPraisedRate',HairShopLogo FROM HairShop WHERE " + WhereCaused + orderKey.ToString(); break; default: cmdText = "SELECT Top " + Top.ToString() + @" HairShopID, HairShopName, HairShopVisitNum, CASE WHEN HairShopGood = 0 OR HairShopBad = 0 THEN 0 WHEN HairShopGood != 0 AND HairShopBad != 0 THEN HairShopGood/(HairShopGood + HairShopBad) END AS 'HairGoodPraisedRate',HairShopLogo FROM HairShop WHERE " + WhereCaused + orderKey.ToString(); break; } DataTable table = new DataTable("HairShopInfo"); DataColumnCollection columnList = table.Columns; foreach (string str in new String[] { "HairShopID", "HairShopName", "HairShopVisitNum", "HairGoodPraisedRate", "HairShopLogo", }) { columnList.Add(str); } table = SqlHelper.ExecuteDataset(DataHelper2.SqlConnectionString, CommandType.Text, cmdText).Tables[0]; return table; }
private static IEnumerable <Message <OrderKey, OrderEventRecord> > GetEventSequence() { var order1Key = new OrderKey { OrderId = Guid.NewGuid() }; var order2Key = new OrderKey { OrderId = Guid.NewGuid() }; var order3Key = new OrderKey { OrderId = Guid.NewGuid() }; var product1Id = Guid.NewGuid(); var product2Id = Guid.NewGuid(); yield return(new Message <OrderKey, OrderEventRecord> { Key = order1Key, Value = new OrderEventRecord { Timestamp = DateTime.UtcNow, Event = new OrderCreationEvent { LineItems = new[] { new OrderLineItem { ProductId = product1Id, Quantity = 1 }, new OrderLineItem { ProductId = product2Id, Quantity = 1 }, }, }, }, }); yield return(new Message <OrderKey, OrderEventRecord> { Key = order2Key, Value = new OrderEventRecord { Timestamp = DateTime.UtcNow, Event = new OrderCreationEvent { LineItems = new[] { new OrderLineItem { ProductId = product2Id, Quantity = 5 }, }, }, }, }); yield return(new Message <OrderKey, OrderEventRecord> { Key = order1Key, Value = new OrderEventRecord { Timestamp = DateTime.UtcNow, Event = new OrderLineItemModificationEvent { Index = 1, LineItem = new OrderLineItem { ProductId = product2Id, Quantity = 10 }, }, }, }); yield return(new Message <OrderKey, OrderEventRecord> { Key = order3Key, Value = new OrderEventRecord { Timestamp = DateTime.UtcNow, Event = new OrderCreationEvent { LineItems = Array.Empty <OrderLineItem>(), }, }, }); yield return(new Message <OrderKey, OrderEventRecord> { Key = order1Key, Value = new OrderEventRecord { Timestamp = DateTime.UtcNow, Event = new OrderLineItemModificationEvent { Index = 0, LineItem = new OrderLineItem { ProductId = product1Id, Quantity = 5 }, }, }, }); yield return(new Message <OrderKey, OrderEventRecord> { Key = order3Key, Value = new OrderEventRecord { Timestamp = DateTime.UtcNow, Event = new OrderCancellationEvent { }, }, }); }
public List<ProductComment> GetProductCommentsByProductID(int productID, int count, OrderKey ok) { List<ProductComment> list = new List<ProductComment>(); string orderKey = " order by "; switch (ok) { //case OrderKey.Good: // orderKey = "IsGood desc"; // break; case OrderKey.ID: orderKey = "UserID desc"; break; case OrderKey.Time: orderKey = "ProductCommentCreateTime desc"; break; default: orderKey = "ProductCommentID desc"; break; } string commText = string.Empty; switch (count) { case 0: commText = "select * from ProductComment where ProductID=" + productID.ToString() + orderKey; break; default: commText = "select top " + count.ToString() + " * from ProductComment where ProductID=" + productID.ToString() + orderKey; break; } using (SqlConnection conn = new SqlConnection(DataHelper2.SqlConnectionString)) { { using (SqlCommand comm = new SqlCommand()) { comm.Connection = conn; comm.CommandText = commText; conn.Open(); using (SqlDataReader sdr = comm.ExecuteReader()) { while (sdr.Read()) { ProductComment productComment = new ProductComment(); productComment.CommentCreateTime = Convert.ToDateTime(sdr["ProductCommentCreateTime"].ToString()); productComment.CommentID = int.Parse(sdr["ProductCommentID"].ToString()); productComment.CommentText = sdr["ProductCommentText"].ToString(); productComment.ProductID = int.Parse(sdr["ProductID"].ToString()); productComment.UserAddress = sdr["UserAddress"].ToString(); productComment.UserID = int.Parse(sdr["UserID"].ToString()); productComment.UserName = sdr["UserName"].ToString(); list.Add(productComment); } } } } } return list; }
public List<Product> GetProducts(int count, OrderKey ok,string productName) { List<Product> list = new List<Product>(); string orderKey = " order by "; switch (ok) { case OrderKey.ID: orderKey += "ProductID desc"; break; //case OrderKey.CommentNum: //������δ��Ԥ������ݲ�ʵ�� // orderKey += "he.HairEngineerGood+he.HairEngineerBad desc"; // break; case OrderKey.HitNum: orderKey += "ProductHits desc"; break; default: orderKey += "ProductID desc"; break; } string commText = ""; switch (count) { case 0: commText = "select * from Product where ProductName like '%"+productName+"%'" + orderKey; break; default: commText = "select top " + count.ToString() + " * from Product where ProductName like '%" + productName + "%'" + orderKey; break; } using (SqlConnection conn = new SqlConnection(DataHelper2.SqlConnectionString)) { { using (SqlCommand comm = new SqlCommand()) { comm.Connection = conn; comm.CommandText = commText; conn.Open(); using (SqlDataReader sdr = comm.ExecuteReader()) { while (sdr.Read()) { Product product = new Product(); product.ProductID = int.Parse(sdr["ProductID"].ToString()); product.ProductName = sdr["ProductName"].ToString(); product.ProductCompany = sdr["ProductCompany"].ToString(); product.ProductCompanyDescription = sdr["ProductCompanyDescription"].ToString(); product.ProductPictureStoreIDs = sdr["ProductPictureStoreIDs"].ToString(); product.ProductHits = int.Parse(sdr["ProductHits"].ToString()); product.ProductDescription = sdr["ProductDescription"].ToString(); product.HairShopIDs = sdr["HairShopIDs"].ToString(); product.ProductRawPrice = sdr["ProductRawPrice"].ToString(); product.ProductPrice = sdr["ProductPrice"].ToString(); product.ProductDiscount = sdr["ProductDiscount"].ToString(); product.ProductTagIDs = sdr["ProductTagIDs"].ToString(); list.Add(product); } } } } } return list; }
public override string ToString() { return("Hosting Unit ID: " + HostingUnitKey.ToString() + " Hosting Request ID: " + GuestRequestKey.ToString() + " Order ID: " + OrderKey.ToString() + " Order Status: " + Status + " Order Creation Date: " + CreateDate.ToString("d") + " Offer Date Submission: " + OrderDate.ToString("d")); }
public List<HairShop> GetHairShops(int count, string selectCondition, OrderKey ok,Sort sort) { List<HairShop> list = new List<HairShop>(); string orderKey = " order by "; switch (ok) { case OrderKey.ID: orderKey += "hs.HairShopID"; break; case OrderKey.CommentNum: orderKey += "hs.HairShopGood+hs.HairShopBad"; break; case OrderKey.RecommandNum: orderKey += "hs.HairShopRecommandNum"; break; case OrderKey.HitNum: orderKey += "hs.HairShopVisitNum"; break; case OrderKey.OrderNum: orderKey += "hs.HairShopOrderNum"; break; default: orderKey += "hs.HairShopID"; break; } string commText = ""; switch (count) { case 0: commText = "select * from HairShop hs left join City c on hs.HairShopCityID=c.cityID left join MapZone m on hs.HairShopMapZoneID = m.MapZoneID left join HotZone h on hs.HairShopHotZoneID = h.HotZoneID left join TypeTable tt on hs.TypeID=tt.TypeID " + selectCondition + orderKey + " " + sort.ToString(); break; default: commText = "select top " + count.ToString() + " * from HairShop hs left join City c on hs.HairShopCityID=c.cityID left join MapZone m on hs.HairShopMapZoneID = m.MapZoneID left join HotZone h on hs.HairShopHotZoneID = h.HotZoneID left join TypeTable tt on hs.TypeID=tt.TypeID " + selectCondition + orderKey + " " + sort.ToString(); break; } using (SqlConnection conn = new SqlConnection(DataHelper2.SqlConnectionString)) { { using (SqlCommand comm = new SqlCommand()) { comm.Connection = conn; comm.CommandText = commText; conn.Open(); using (SqlDataReader sdr = comm.ExecuteReader()) { while (sdr.Read()) { HairShop hairShop = new HairShop(); hairShop.HairShopID = int.Parse(sdr["HairShopID"].ToString()); hairShop.HairShopName = sdr["HairShopName"].ToString(); hairShop.HairShopCityID = int.Parse(sdr["HairShopCityID"].ToString()); hairShop.HairShopCityName = sdr["CityName"].ToString(); hairShop.HairShopMapZoneID = int.Parse(sdr["HairShopMapZoneID"].ToString()); hairShop.HairShopMapZoneName = sdr["MapZoneName"].ToString(); hairShop.HairShopHotZoneID = int.Parse(sdr["HairShopHotZoneID"].ToString()); hairShop.HairShopHotZoneName = sdr["HotZoneName"].ToString(); hairShop.HairShopAddress = sdr["HairShopAddress"].ToString(); hairShop.HairShopPhoneNum = sdr["HairShopPhoneNum"].ToString(); //hairShop.HairShopPictureStoreIDs = sdr["HairShopPictureStoreIDs"].ToString(); //hairShop.HairShopMainIDs = sdr["HairShopMainIDs"].ToString(); //hairShop.HairShopPartialIDs = sdr["HairShopPartialIDs"].ToString(); hairShop.HairShopEngineerNum = int.Parse(sdr["HairShopEngineerNum"].ToString()); hairShop.HairShopOpenTime = sdr["HairShopOpenTime"].ToString(); //hairShop.HairShopOrderNum = int.Parse(sdr["HairShopOrderNum"].ToString()); hairShop.HairShopVisitNum = int.Parse(sdr["HairShopVisitNum"].ToString()); //hairShop.WorkRangeIDs = sdr["WorkRangeIDs"].ToString(); hairShop.HairShopWebSite = sdr["HairShopWebSite"].ToString(); hairShop.HairShopEmail = sdr["HairShopEmail"].ToString(); hairShop.HairShopDiscount = sdr["HairShopDiscount"].ToString(); hairShop.HairShopLogo = sdr["HairShopLogo"].ToString(); hairShop.TravelInfo = sdr["TravelInfo"].ToString(); //try //{ // hairShop.HairShopRecommandNum = int.Parse(sdr["HairShopRecommandNum"].ToString()); //} //catch //{ // hairShop.HairShopRecommandNum = 0; //} hairShop.HairShopCreateTime = sdr["HairShopCreateTime"].ToString(); hairShop.HairShopDescription = sdr["HairShopDescription"].ToString(); hairShop.ProductIDs = sdr["ProductIDs"].ToString(); hairShop.HairShopTagIDs = sdr["HairShopTagIDs"].ToString(); hairShop.HairShopShortName = sdr["HairShopShortName"].ToString(); //hairShop.IsBest = bool.Parse(sdr["IsBest"].ToString()); hairShop.IsJoin = bool.Parse(sdr["IsJoin"].ToString()); hairShop.TypeID = int.Parse(sdr["TypeID"].ToString()); hairShop.TypeName = sdr["TypeName"].ToString(); hairShop.IsPostStation = bool.Parse(sdr["IsPostStation"].ToString()); hairShop.IsPostMachine = bool.Parse(sdr["IsPostMachine"].ToString()); hairShop.HairShopGood = int.Parse(sdr["HairShopGood"].ToString()); hairShop.HairShopBad = int.Parse(sdr["HairShopBad"].ToString()); try { hairShop.Postid = int.Parse(sdr["postid"].ToString()); } catch { hairShop.Postid = 0; } hairShop.OutLogs = sdr["outLogs"].ToString(); hairShop.InnerLogs = sdr["innerLogs"].ToString(); hairShop.HairShopNormal = int.Parse(sdr["HairShopNormal"].ToString()); try { hairShop.HairConservationDiscountMin = decimal.Parse(sdr["HairConservationPriceMin"].ToString()); } catch { hairShop.HairConservationDiscountMin = 0; } try { hairShop.HairConservationPrice = decimal.Parse(sdr["HairConservationPrice"].ToString()); } catch { hairShop.HairConservationPrice = 0; } try { hairShop.HairCutDiscountMin = decimal.Parse(sdr["HairCutPriceMin"].ToString()); } catch { hairShop.HairCutDiscountMin = 0; } try { hairShop.HairCutPirce = decimal.Parse(sdr["HairCutPrice"].ToString()); } catch { hairShop.HairCutPirce = 0; } try { hairShop.HairDyeDiscountMin = decimal.Parse(sdr["HairDyePriceMin"].ToString()); } catch { hairShop.HairDyeDiscountMin = 0; } try { hairShop.HairDyePrice = decimal.Parse(sdr["HairDyePrice"].ToString()); } catch { hairShop.HairDyePrice = 0; } try { hairShop.HairMarcelDiscountMin = decimal.Parse(sdr["HairMarcelPriceMin"].ToString()); } catch { hairShop.HairMarcelDiscountMin = 0; } try { hairShop.HairMarcelPrice = decimal.Parse(sdr["HairMarcelPrice"].ToString()); } catch { hairShop.HairMarcelPrice = 0; } try { hairShop.HairShapeDiscountMin = decimal.Parse(sdr["HairShapePriceMin"].ToString()); } catch { hairShop.HairShapeDiscountMin = 0; } try { hairShop.HairShapePrice = decimal.Parse(sdr["HairShapePrice"].ToString()); } catch { hairShop.HairShapePrice = 0; } list.Add(hairShop); } } } } } return list; }
protected override OrderKey OnUpdateRenderOrderKey() { return(OrderKey.Create(RenderOrder, materialVariable == null ? (ushort)0 : materialVariable.ID)); }
public override string ToString() { string text = "Hosting Unit Key: " + HostingUnitKey.ToString() + "Guest Request Key: " + GuestRequestKey.ToString() + "\n Order Key: " + OrderKey.ToString() + "\n The request was created on " + CreateDate.ToString() + "\nStatus: "; switch ((int)Status) { case 0: text += " Not answered"; break; case 1: text += " The mail was sent"; break; case 2: text += " Closed because the client was not interested"; break; case 3: text += " Closed by answer to the client"; break; } if ((int)Status > 0) { text += "\nOrderDate: " + OrderDate.ToString(); } return(text); }