protected void btnPay_Click(object sender, EventArgs e) { string remark = ""; D_LoginUserInfo ui = Session["LoginUserInfo"] as D_LoginUserInfo; if (txtMethod.Value == "3") { remark = txtCheckNumber.Text; } AdminOrderBiz biz = new AdminOrderBiz(); int orderId = PageTools.GetSavedId("OrderId",null); decimal amount = PageTools.ParseDecimal(txtPay.Text); int chargeForId = ui.userId; if ( payEmp.SelectedIndex>0 ) chargeForId = int.Parse(payEmp.SelectedValue); int r = biz.Payment( Session["LoginUserInfo"], orderId, amount, int.Parse(txtMethod.Value), 0, chargeForId, ui.userId, remark); if (r < 0) { lbMsg.ForeColor = System.Drawing.Color.Red; switch (r) { case -1: lbMsg.Text = "订单状态不能付款"; break; case -2: lbMsg.Text = "付款金额超过应付额"; break; case -3: lbMsg.Text = "订单不存在"; break; case -9: lbMsg.Text = "金额不能为0"; break; default: lbMsg.Text = "订单状态不确定"; break; } } else { lbMsg.Text = "付款成功."; lbMsg.ForeColor = System.Drawing.Color.DarkGreen; txtPay.Text = "0.00"; } RefreshControl(); if (m_afterPayment != null && m_afterPayment != "") { Delegate d = Delegate.CreateDelegate(typeof(EventHandler), Page, m_afterPayment); ((EventHandler)d)(this, null); } }
// auto fill protected void btnFillCustomerInfo_Click(object sender, EventArgs e) { int orderId = PageTools.GetSavedId("OrderId", Request.QueryString["id"]); if (orderId > 0) { AdminOrderBiz obiz = new AdminOrderBiz(); int customerID = obiz.GetOrderCustomer(orderId); if (customerID > 0) { AdminUserBiz biz = new AdminUserBiz(); D_UserInfo ui = biz.GetUserInfo(customerID); TextBox tbFirstname = fvCreditCard.FindControl("firstNameTextBox") as TextBox; if (tbFirstname != null) { TextBox tbLastname = fvCreditCard.FindControl("lastNameTextBox") as TextBox; TextBox tbAddress = fvCreditCard.FindControl("addressTextBox") as TextBox; TextBox tbCity = fvCreditCard.FindControl("cityTextBox") as TextBox; TextBox tbState = fvCreditCard.FindControl("stateTextBox") as TextBox; TextBox tbZip = fvCreditCard.FindControl("zipTextBox") as TextBox; Controls_CountrySelector country = fvCreditCard.FindControl("CountrySelector1") as Controls_CountrySelector; tbFirstname.Text = ui.firstName; tbLastname.Text = ui.lastName; tbAddress.Text = ui.address; tbCity.Text = ui.city; tbState.Text = ui.state; tbZip.Text = ui.zip; country.CountryCode = ui.country; } } } }
protected void btnNewOrder_Click(object sender, EventArgs e) { int sid = PageTools.GetSavedId("scheduleID", null); AdminOrderBiz biz = new AdminOrderBiz(); int orderId = biz.AddEmptyOrder(sid, ((D_LoginUserInfo)Session["LoginUserInfo"]).userId); if (orderId > 0) { biz.RecalculateOrder(orderId); Response.Redirect("OrderEdit.aspx?mode=edit&id=" + orderId.ToString()); } else txtMsg.Text = "Add new order ERROR!"; }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { int orderId = PageTools.GetSavedId("OrderId", Request.QueryString["id"]); if ( orderId==0) Response.Redirect("OrderList.aspx"); AdminOrderBiz biz = new AdminOrderBiz(); int status = biz.GetOrderStatus(orderId); if (status != 2 && status!=3 ) Response.Redirect("ProcessError.aspx?errMsg=Order's status incorrect. Please check.&nav=OrderDetail.aspx"); OrderInfoCtl1.OrderId = orderId; } }
private void ResetAgentID() { int orderID = PageTools.GetSavedId("orderID", null); AdminOrderBiz biz = new AdminOrderBiz(); int agentID = biz.GetAgentID(orderID); AgentOrderBiz abiz = new AgentOrderBiz(); bool isChangeable = abiz.IsOrderMatched(orderID); seleAgent.SelectedValue = agentID.ToString(); if (isChangeable) { btnChange.Enabled = true; lbMsg.Text = ""; } else { btnChange.Enabled = false; lbMsg.Text = "已經進行Invoice Match的訂單不能再修改Agent Transfor。"; } }
private void ResetAgentID() { int orderID = PageTools.GetSavedId("orderID", null); AdminOrderBiz biz = new AdminOrderBiz(); int agentID = biz.GetAgentID(orderID); AgentOrderBiz abiz = new AgentOrderBiz(); bool isChangeable = abiz.IsAgentChangeable(orderID); seleAgent.SelectedValue = agentID.ToString(); if (isChangeable) { btnChange.Enabled = true; lbMsg.Text = ""; } else { btnChange.Enabled = false; lbMsg.Text = "不能修改Agent!請先撤銷此Order對應的收付賬單。"; } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { int orderId = PageTools.GetSavedId("OrderId", Request.QueryString["id"]); if (orderId==0) Response.Redirect("OrderList.aspx"); AdminOrderBiz biz = new AdminOrderBiz(); int status = biz.GetOrderStatus(orderId); if (status != 2) { PageLogic.ShowError("Order's status incorrect. Please check.", "OrderDetail.aspx"); return; } OrderInfoCtl1.OrderId = orderId; OrderInfoCtl1.DataBind(); PaymentCtl1.DataBind(); } }
public bool CreditCardPayment(object loginUserInfo, int crId) { if (loginUserInfo == null || crId == 0) return false; D_LoginUserInfo ui = loginUserInfo as D_LoginUserInfo; DS_CreditCards.CCDetailDataTable dt = GetCreditDetail(crId); if (dt == null || dt.Rows.Count < 1) return false; DS_CreditCards.CCDetailRow row = dt.Rows[0] as DS_CreditCards.CCDetailRow; AdminOrderBiz biz = new AdminOrderBiz(); int paymentId = biz.Payment( loginUserInfo, row.orderId, row.totalAmount, 2, 0, ui.userId, ui.userId, "[" + row.cardType + "] " + MaskedCardNumber(row.cardNumber)); if (paymentId <= 0) return false; string sql = @" update CreditCard set paymentId=@paymentId, status=8, payDate=getdate() where crId=@crId; "; SqlParameter[] para = { new SqlParameter("@crId", crId), new SqlParameter("@paymentId", paymentId) }; int i = m_dao.ExecuteNoQuery(sql, para); return (i == 1); }
private int DoPayment(string payAmountString, int paymentMethod, string remark) { decimal amount = PageTools.ParseDecimal(payAmountString); if (amount <= 0) { lbMsg.Text = "金額不能為0或負數!"; return 0; } D_LoginUserInfo ui = Session["LoginUserInfo"] as D_LoginUserInfo; int orderId = PageTools.GetSavedId("OrderId", null); int chargeForId = ui.userId; if (payEmp.SelectedIndex > 0) chargeForId = int.Parse(payEmp.SelectedValue); AdminOrderBiz biz = new AdminOrderBiz(); int r = biz.Payment(Session["LoginUserInfo"], orderId, amount, paymentMethod, 0, chargeForId, ui.userId, remark); if (r < 0) { lbMsg.ForeColor = System.Drawing.Color.Red; switch (r) { case -1: lbMsg.Text = "订单状态不能付款"; break; case -2: lbMsg.Text = "付款金额超过应付额"; break; case -3: lbMsg.Text = "订单不存在"; break; case -9: lbMsg.Text = "金额不能为0"; break; default: lbMsg.Text = "订单状态不确定"; break; } } else { lbMsg.Text = "付款成功."; lbMsg.CssClass = "ok_message"; } return r; }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { int orderId = PageTools.GetSavedId("OrderId", null); if (orderId <= 0) tabsPayment.Visible = false; AdminOrderBiz biz = new AdminOrderBiz(); if (!biz.IsAgentOrder(orderId)) tabsPayment.Tabs.FromKey("Agent").Visible = false; } }
public static bool OrderEditable(int orderId) { if (HttpContext.Current.Session["LoginUserInfo"] == null) return false; D_LoginUserInfo ui = HttpContext.Current.Session["LoginUserInfo"] as D_LoginUserInfo; if (ui == null || ui.userId < 0) return false; AdminOrderBiz biz = new AdminOrderBiz(); return biz.OrderEditable(orderId, ui.positionIds); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { int orderId = PageTools.GetSavedId("OrderId", Request.QueryString["id"]); if (orderId == 0) Response.Redirect("OrderList.aspx"); AdminOrderBiz biz = new AdminOrderBiz(); int status = biz.GetOrderStatus(orderId); //���Ȩ�� if (status >= 7) { PageLogic.ShowError("Order is closed. ��������ɡ�", "OrderDetail.aspx"); return; } else if (status >2 ) { if (!PageLogic.CheckActionAuth("EditFullPaidOrder")) { PageLogic.ShowError("You have not authorization. ��û��Ȩ�ޡ�", "OrderDetail.aspx"); return; } } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Request.QueryString["do"] == "new") { fvOrderDetail.ChangeMode(FormViewMode.Insert); } else { int orderId = PageTools.GetSavedId("OrderId", Request.QueryString["id"]); if (orderId == 0) Response.Redirect("OrderList.aspx"); AdminOrderBiz biz = new AdminOrderBiz(); int status = biz.GetOrderStatus(orderId); //���Ȩ�� if (status >= 7) { PageLogic.ShowError("Order is closed. ��������ɡ�", "OrderDetail.aspx"); return; } else if (status > 2) { if (!PageLogic.CheckActionAuth("EditFullPaidOrder")) { PageLogic.ShowError("You have not authorization. ��û��Ȩ�ޡ�", "OrderDetail.aspx"); return; } } fvOrderDetail.ChangeMode(FormViewMode.Edit); TicketDetailDataset.SelectParameters["orderID"].DefaultValue = orderId.ToString(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { int orderId = PageTools.GetSavedId("OrderId", Request.QueryString["id"]); if ( orderId==0 ) Response.Redirect("OrderList.aspx"); lnkPrint.NavigateUrl = "PrintTicket.aspx" + Request.Url.Query; AdminOrderBiz biz = new AdminOrderBiz(); int scheduleId = biz.GetOrderScheduleId(orderId); OrderInfoCtl1.OrderId = orderId; OrderInfoCtl1.DataBind(); OrdersCCListDataset.SelectParameters["orderId"].DefaultValue = orderId.ToString(); lstOrdersCCList.DataBind(); OplogList1.OpType = 4; OplogList1.RelateID = orderId; VoucherDataset.SelectParameters["orderID"].DefaultValue = orderId.ToString(); lnkBusSeats.NavigateUrl = "~/BusSeats.aspx?id="+ scheduleId.ToString(); // OrderEdit权限检查 int status = biz.GetOrderStatus(orderId); int orderType = biz.GetOrderType(orderId); if (orderType > 0) { // is ticket lnkOrderEdit.NavigateUrl = "TicketEdit.aspx"; lnkPrint.NavigateUrl = "PrintQTicket.aspx" + Request.Url.Query; } if (PageLogic.CheckPageAuth("OrderEdit.aspx")) { if (status >= 3 && status<7) { if (!PageLogic.CheckActionAuth("EditFullPaidOrder")) { lnkOrderEdit.Attributes.Add("onclick", "alert('You have not authorization to edit orders in this status.\\n\\n您没有授权修改此状态下的订单。');return false;"); } } if (status >= 7) { lnkOrderEdit.Attributes.Add("onclick", "alert('Order been closed.\\n订单已完成。');return false;"); } } else { lnkOrderEdit.Enabled = false; } if (status ==0 || status >= 3) { lnkPayment.Enabled = false; } if (status < 2) { lnkRefund.Enabled = lnkPrint.Enabled = false; } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { int orderId = PageTools.GetSavedId("OrderId", Request.QueryString["id"]); if (orderId == 0) Response.Redirect("OrderActive.aspx"); AdminOrderBiz biz = new AdminOrderBiz(); int status = biz.GetOrderStatus(orderId); if (status != 2) { PageLogic.ShowError("Order's status incorrect. Please check.", "OrderDetail.aspx"); return; } int scheduleId = biz.GetOrderScheduleId(orderId); OrderInfoCtl1.OrderId = orderId; OrderInfoCtl1.DataBind(); CompareValidator rv = fvCreditCard.FindControl("CompareValidator1") as CompareValidator; if (rv != null) { rv.ValueToCompare = biz.GetBalance(orderId).ToString(); } } }