private void InitializeDeliverType(int deliverTypeId) { IList <DeliverTypeInfo> enableDeliverTypeList = new List <DeliverTypeInfo>(); enableDeliverTypeList = DeliverType.GetEnableDeliverTypeList(); this.DropDeliverType.DataSource = enableDeliverTypeList; this.DropDeliverType.DataBind(); int typeId = 0; string intro = ""; foreach (DeliverTypeInfo info in enableDeliverTypeList) { if (deliverTypeId > 0) { if (info.TypeId != deliverTypeId) { continue; } typeId = info.TypeId; intro = info.Intro; break; } if (info.IsDefault) { typeId = info.TypeId; intro = info.Intro; break; } } this.DropDeliverType.SelectedValue = typeId.ToString(); this.LblDeliverTypeIntro.Text = intro; }
protected void DropDeliverType_SelectedIndexChanged(object sender, EventArgs e) { DeliverTypeInfo deliverTypeById = new DeliverTypeInfo(); deliverTypeById = DeliverType.GetDeliverTypeById(DataConverter.CLng(this.DropDeliverType.SelectedValue)); if (!deliverTypeById.IsNull) { this.LblDeliverTypeIntro.Text = deliverTypeById.Intro; } }
public decimal GetPrice(DeliverType deliverType) { DeliverPrices prices = _daoTemplate.FindAll <DeliverPrices>()[0]; if (deliverType == DeliverType.CourierMoscow) { return(prices.CourierMoscow); } if (deliverType == DeliverType.CourierSubMoscow) { return(prices.CourierSubMoscow); } if (deliverType == DeliverType.Post) { return(prices.Post); } //if (deliverType == DeliverType.Myself) return(prices.Self); }
public ActionResult Edit(ContactViewModel contactViewModel, int uid, DeliverType DeliverType, PaymentType PaymentType) { if (!ModelState.IsValid || DeliverType == DeliverType.NULL) { if (DeliverType == DeliverType.NULL) { ModelState.AddModelError("DeliverType", "Выберите способ доставки"); } return(View(daoTemplate.FindOrderByUid(uid))); } var order = daoTemplate.FindOrderByUid(uid); var contact = Contact.From(contactViewModel); order.ShippingDetails = contact; order.PaymentType = PaymentType; order.DeliverType = DeliverType; order.DeliverPrice = orderService.GetPrice(order.DeliverType); daoTemplate.Save(order); return(RedirectToAction("DetailsUser", new { id = order.Uid })); }
public ActionResult Edit(ContactViewModel contactViewModel, int uid, DeliverType DeliverType, PaymentType PaymentType) { if (!ModelState.IsValid || DeliverType == DeliverType.NULL) { if (DeliverType == DeliverType.NULL) { ModelState.AddModelError("DeliverType", "Выберите способ доставки"); } return View(daoTemplate.FindOrderByUid(uid)); } var order = daoTemplate.FindOrderByUid(uid); var contact = Contact.From(contactViewModel); order.ShippingDetails = contact; order.PaymentType = PaymentType; order.DeliverType = DeliverType; order.DeliverPrice = orderService.GetPrice(order.DeliverType); daoTemplate.Save(order); return RedirectToAction("DetailsUser", new {id = order.Uid}); }
public decimal GetPrice(DeliverType deliverType) { DeliverPrices prices = _daoTemplate.FindAll<DeliverPrices>()[0]; if (deliverType == DeliverType.CourierMoscow) return prices.CourierMoscow; if (deliverType == DeliverType.CourierSubMoscow) return prices.CourierSubMoscow; if (deliverType == DeliverType.Post) return prices.Post; //if (deliverType == DeliverType.Myself) return prices.Self; }
private void BindControl(OrderInfo info) { this.LblOrderNum.Text = info.OrderNum; this.HlkUserName.Text = info.UserName; this.HlkAgentName.Text = info.AgentName; this.HlkClientName.Text = info.ClientName; if (this.IsAdminPage) { this.HlkUserName.NavigateUrl = string.Format("~/Admin/User/UserShow.aspx?UserName={0}", base.Server.UrlEncode(info.UserName)); this.HlkClientName.NavigateUrl = string.Format("~/Admin/Crm/ClientShow.aspx?ClientId={0}", info.ClientId); this.HlkAgentName.NavigateUrl = string.Format("~/Admin/User/UserShow.aspx?UserName={0}", base.Server.UrlEncode(info.AgentName)); } this.CliendId = info.ClientId; if (info.NeedInvoice) { this.LblNeedInvoice.Text = "√"; } else { this.LblNeedInvoice.Text = "\x00d7"; this.LblNeedInvoice.ForeColor = Color.FromArgb(0xff0000); } if (info.Invoiced) { this.LblInvoiced.Text = "√"; } else { this.LblInvoiced.Text = "\x00d7"; this.LblInvoiced.ForeColor = Color.FromArgb(0xff0000); } this.LblStatus.Text = BaseUserControl.EnumToHtml <OrderStatus>(info.Status); switch (Order.GetPayStatus(info)) { case PayStatus.WaitForPay: this.LblMoneyTotal.Text = BaseUserControl.EnumToHtml <PayStatus>(PayStatus.WaitForPay); break; case PayStatus.ReceivedEarnest: this.LblMoneyTotal.Text = BaseUserControl.EnumToHtml <PayStatus>(PayStatus.ReceivedEarnest); break; case PayStatus.Payoff: this.LblMoneyTotal.Text = BaseUserControl.EnumToHtml <PayStatus>(PayStatus.Payoff); break; } this.LblDeliverStatus.Text = BaseUserControl.EnumToHtml <DeliverStatus>(info.DeliverStatus); if (info.NeedInvoice) { this.LblInvoiceContent.Text = info.InvoiceContent; } this.LblRemark.Text = info.Remark; this.LblBeginDate.Text = info.BeginDate.ToString("yyyy-MM-dd"); this.LblInputTime.Text = info.InputTime.ToString("yyyy-MM-dd HH:mm:ss"); this.LblContacterName.Text = info.ContacterName; this.LblAddress.Text = info.Address; this.LblZipCode.Text = info.ZipCode; this.LblMobile.Text = info.Mobile; this.LblPhone.Text = info.Phone; this.LblEmail.Text = info.Email; this.LblPaymentType.Text = PaymentType.GetPaymentTypeById(info.PaymentType).TypeName; this.LblDeliverType.Text = DeliverType.GetDeliverTypeById(info.DeliverType).TypeName; this.LblOutOfStockProject.Text = BaseUserControl.EnumToHtml <OutOfStockProject>(info.OutOfStockProject); this.LblDeliverTime.Text = info.DeliveryTime; if (this.IsAdminPage) { this.LblMemo.Text = info.Memo; this.LblMemo.Visible = true; this.LtrMemoTitle.Visible = true; this.ShowFunctionary.Visible = true; this.LblFunctionary.Text = info.Functionary; this.LblOrderType.Text = Choiceset.GetDataText("PE_Orders", "OrderType", info.OrderType); } else { this.LblMemo.Visible = false; this.LtrMemoTitle.Visible = false; this.ShowFunctionary.Visible = false; } }