private void getUserOrder() { SqlConnection connection = new SqlConnection(connStr); try { String query = @"SELECT [orders].[order_id] ,[ship_location] ,[phoneContact] ,[otherContact] FROM [dbo].[orders] , orders_users where [orders].[order_id]= orders_users.order_id and active = 1 and orders_users.user_id = " + uid; SqlDataAdapter adpater = new SqlDataAdapter(query, connection); connection.Open(); DataTable table = new DataTable(); adpater.Fill(table); if (table.Rows.Count == 0) { noOrder.Attributes["style"] = "display: block;"; } OrderList.DataSource = table; OrderList.DataBind(); } catch (Exception) { throw; } finally { connection.Close(); } }
protected void Page_PreRender(object sender, EventArgs e) { lock (Global.Orders) OrderList.DataSource = new List <Order>(Global.Orders); OrderList.DataBind(); }
private void Refresh() { lock (Global.Orders) OrderList.DataSource = new List <Order>(Global.Orders); OrderList.DataBind(); }
protected void DataSetBand() { int ids = int.Parse(SubareaNameDropDownList.SelectedValue.ToString()); DataSet ds = new DataSet(); ds = Leyp.SQLServerDAL.Factory.getProductsStockDAL().getDataSetByHouseDetailID(ids); OrderList.DataSource = ds.Tables["dd"].DefaultView; OrderList.DataBind(); }
protected void DataBandinit(string ProductsIDs) { int ids = int.Parse(ProductsIDs); DataSet ds = new DataSet(); ds = Leyp.SQLServerDAL.Factory.getProductsStockDAL().getDataSetByProductsID(ids); OrderList.DataSource = ds.Tables["dd"].DefaultView; OrderList.DataBind(); }
protected override void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Pedido pedido = new Pedido(); pedido.Usuario = Context.User.Identity.GetUserName(); //pedido = commands["CONSULTAR"].execute(pedido).Entidades.Cast<Pedido>().ElementAt(0); List <Pedido> listaPedido = commands["CONSULTAR"].execute(pedido).Entidades.Cast <Pedido>().ToList(); //pedido.EnderecoEntrega = commands["CONSULTAR"].execute(new Endereco() { ID = pedido.EnderecoEntrega.ID } ).Entidades.Cast<Endereco>().ElementAt(0); //pedido.Detalhes = commands["CONSULTAR"].execute(new PedidoDetalhe() { IdPedido = pedido.ID }).Entidades.Cast<PedidoDetalhe>().ToList(); //pedido.CCs = commands["CONSULTAR"].execute(new CartaoCreditoPedido() { IdPedido = pedido.ID }).Entidades.Cast<CartaoCreditoPedido>().ToList(); //entidades = new List<EntidadeDominio>(); //entidades = commands["CONSULTAR"].execute(new PedidoXCupom() { ID = pedido.ID }).Entidades; //if(entidades.Count > 0) { // pedido.CupomPromocional = commands["CONSULTAR"].execute(new PedidoXCupom() { ID = pedido.ID }).Entidades.Cast<PedidoXCupom>().ElementAt(0).Cupom; //} //entidades = new List<EntidadeDominio>(); //entidades = commands["CONSULTAR"].execute(new Cupom() { IdPedido = pedido.ID }).Entidades; //if (entidades.Count > 0) //{ // pedido.CuponsTroca = commands["CONSULTAR"].execute(new Cupom() { IdPedido = pedido.ID }).Entidades.Cast<Cupom>().ToList(); //} //// Set OrderId. //Session["currentOrderId"] = pedido.ID; // Exibi as informações do Pedido //listaPedido.Add(pedido); OrderList.DataSource = listaPedido; OrderList.DataBind(); //// Mostra os detalhes do pedido //OrderItemList.DataSource = pedido.Detalhes; //OrderItemList.DataBind(); } else { //Response.Redirect("./CheckoutError.aspx?Desc=ID%20de%20pedido%20incompatível."); } }
protected void DdlState_SelectedIndexChanged(object sender, EventArgs e) { int index = DdlState.SelectedIndex; if (index == 0) { OrderList.DataSourceID = "SqlDataSourceOrders"; OrderList.DataBind(); } else { Session["Index"] = index; OrderList.DataSourceID = "sqldsSituation"; OrderList.DataBind(); } }
protected void PlaceOrder_Click(object sender, EventArgs e) { MessageUserControl.Visible = true; List <CurrentActiveOrderList> list = new List <CurrentActiveOrderList>(); if (OrderList.Rows.Count == 0) { MessageUserControl.ShowInfo("you must first select vendor name to display Current Active Order."); VendorStockItemList.DataSource = null; VendorStockItemList.DataBind(); } if (int.Parse(VendorDLL.SelectedValue) == 0) { MessageUserControl.ShowInfo("you must first select vendor name to display Current Active Order."); } else { for (int rowindex = 0; rowindex < OrderList.Rows.Count; rowindex++) { CurrentActiveOrderList temp = new CurrentActiveOrderList(); temp.StockItemID = int.Parse((OrderList.Rows[rowindex].FindControl("StockItemID") as Label).Text); temp.Description = (OrderList.Rows[rowindex].FindControl("Description") as Label).Text; temp.QuantityOnHand = int.Parse((OrderList.Rows[rowindex].FindControl("QuantityOnHand") as Label).Text); temp.QuantityOnOrder = int.Parse((OrderList.Rows[rowindex].FindControl("QuantityOnOrder") as Label).Text); temp.ReOrderLevel = int.Parse((OrderList.Rows[rowindex].FindControl("ReOrderLevel") as Label).Text); temp.QuantityToOrder = int.Parse((OrderList.Rows[rowindex].FindControl("QuantityToOrder") as TextBox).Text); temp.Price = decimal.Parse((OrderList.Rows[rowindex].FindControl("Price") as TextBox).Text, NumberStyles.Currency); list.Add(temp); } MessageUserControl.TryRun(() => { int vendorid = int.Parse(VendorDLL.SelectedValue); PurchaseOrderDetailController sysmgr = new PurchaseOrderDetailController(); sysmgr.Place_ToPurchaseOrder(vendorid, list); List <CurrentActiveOrderList> info = sysmgr.list_PlacedCurerentActiveOrder(vendorid); OrderList.DataSource = info; OrderList.DataBind(); PurchaseOrderController order = new PurchaseOrderController(); PurchaseOrder result2 = order.CompleteOrder_GetByVendor(vendorid); GSTID.Text = string.Format("{0:C2}", result2.TaxAmount); SubTotalID.Text = string.Format("{0:C2}", result2.SubTotal); TotalID.Text = string.Format("{0:C2}", result2.Total); }, " Placing order", " Order placed sucessfully."); } }
protected void ReloadPageContent(int poID = 0) { // Clear return list CancelButton_Click(this, new EventArgs()); CartIDs.Clear(); Session["Session_CartList"] = CartIDs; ReloadReturnList(new UnorderedPurchaseItemCartController()); // Clear force close text ForceCloseTextBox.Text = ""; // Order state if (poID <= 0) // Closed { // Clear receiving grid ReceivingGrid.DataSource = null; ReceivingGrid.DataBind(); // Refresh order list OrderList.SelectedIndex = -1; OrderList.DataBind(); // Clear open order data PurchaseOrderID.Text = ""; Number.Text = ""; Vendor.Text = ""; Phone.Text = ""; // Hide controls ManagePageDisplay(false); } else // Open { PurchaseOrderDetailController sysmgr = new PurchaseOrderDetailController(); List <OpenOrderDetail> OpenOrderDetails = sysmgr.OpenOrderDetail_List(poID); // Refresh receiving grid ReceivingGrid.DataSource = OpenOrderDetails; ReceivingGrid.DataBind(); // Show controls ManagePageDisplay(true); } }
protected void Page_Load(object sender, EventArgs e) { string connectionString = "Data Source=omisbi3.niunt.niu.edu;Initial Catalog = z1776252; Persist Security Info = True; User ID = z1776252; Password = Bw1243$h11"; using (SqlConnection con = new SqlConnection(connectionString)) { try { Debug.WriteLine("before try"); con.Open(); Debug.WriteLine("inside try"); using (SqlCommand cmd = new SqlCommand("SELECT s.service,o.order_amount from orders_table o,services_table s where s.serviceid=o.s_id and o.session_id=@sessid", con)) { cmd.Parameters.AddWithValue("@sessid", Session["sessionid"].ToString()); using (SqlDataAdapter sda = new SqlDataAdapter(cmd)) { Debug.WriteLine("shopping cart inside 2nd using"); System.Data.DataTable dt = new DataTable(); Debug.WriteLine("data table is:" + dt.Rows.Count); sda.Fill(dt); OrderList.DataSource = dt; OrderList.DataBind(); } } } catch (Exception ex) { // Display error message String errorMessage = ex.Message; } finally { // Close the connection con.Close(); } } }
protected void FetchButton_Click(object sender, EventArgs e) { int orderid = int.Parse(OrderDDL.SelectedValue); MessageUserControl.TryRun(() => { OrderListsController sysmgr = new OrderListsController(); CustomerController sysmgr2 = new CustomerController(); List <PickList> results = sysmgr.OrderLists_OrderPickList(orderid); Customer result = sysmgr2.Customer_Get(orderid); Customername.Text = result.FullName; Phonenumber.Text = result.Phone; OrderList.DataSource = results; OrderList.DataBind(); }); }
protected void Page_Load(object sender, EventArgs e) { if (Session["id"] == null) { Response.Redirect("Login"); } SqlConnection conn = new SqlConnection(); conn.ConnectionString = "Data Source=ASUS;Initial Catalog=订餐;Integrated Security=True"; conn.Open(); String CommandText = "select * from 订单表 ORDER BY 收货状态"; SqlDataAdapter command = new SqlDataAdapter(CommandText, conn); DataSet dataSet = new DataSet(); command.Fill(dataSet); command.Fill(PulbicSet); OrderList.DataSource = dataSet; OrderList.DataKeyField = "Id"; //设置数据表的主键 OrderList.DataBind(); conn.Close(); }
protected void Refresh_Displays() { int vendorid = int.Parse(VendorDLL.SelectedValue); PurchaseOrderDetailController sysmgr = new PurchaseOrderDetailController(); List <CurrentActiveOrderList> info = sysmgr.list_AddedCurerentActiveOrder(vendorid); OrderList.DataSource = info; OrderList.DataBind(); StockItemController sus = new StockItemController(); List <VendorStockItemsList> stock = sus.List_VendorStockItemsForCurrentActiveOrder(vendorid, info); VendorStockItemList.DataSource = stock; VendorStockItemList.DataBind(); PurchaseOrderController order = new PurchaseOrderController(); PurchaseOrder result2 = order.Order_GetByVendor(vendorid); GSTID.Text = string.Format("{0:C2}", result2.TaxAmount); SubTotalID.Text = string.Format("{0:C2}", result2.SubTotal); TotalID.Text = string.Format("{0:C2}", result2.Total); }
protected void Page_Load(object sender, EventArgs e) { if (Session["username"] == null) { Response.Redirect("~/Account/Login.aspx"); } SqlConnection conn = new SqlConnection(); conn.ConnectionString = "Data Source=ASUS;Initial Catalog=订餐;Integrated Security=True"; conn.Open(); String CommandText = "select * from 订单表 where 用户id = " + int.Parse(Session["Id"].ToString()); SqlDataAdapter command = new SqlDataAdapter(CommandText, conn); DataSet dataSet = new DataSet(); command.Fill(dataSet); command.Fill(PulbicSet); OrderList.DataSource = dataSet; OrderList.DataKeyField = "Id";//设置数据表的主键 OrderList.DataBind(); conn.Close(); }
protected void DeleteOrder_Click(object sender, EventArgs e) { MessageUserControl.Visible = true; if (int.Parse(VendorDLL.SelectedValue) == 0) { MessageUserControl.ShowInfo("there is no active order to delete. select vendor to display current order."); } if (OrderList.Rows.Count == 0) { MessageUserControl.ShowInfo("there is no active order to delete. select vendor to display current order."); VendorStockItemList.DataSource = null; VendorStockItemList.DataBind(); } else { MessageUserControl.TryRun(() => { int vendorid = int.Parse(VendorDLL.SelectedValue); PurchaseOrderDetailController sysmgr = new PurchaseOrderDetailController(); sysmgr.Delete_CurrentOpenPurchaseOrderDetils(vendorid); OrderList.DataSource = null; OrderList.DataBind(); GSTID.Text = null; SubTotalID.Text = null; TotalID.Text = null; VendorDLL.SelectedIndex = 0; Name.Text = null; Phone.Text = null; Address.Text = null; City.Text = null; Province.Text = null; PostalCode.Text = null; VendorStockItemList.DataSource = null; VendorStockItemList.DataBind(); }, " Removing complete items from Current Order", " Items successfully removed from list."); } }
protected void Clear_Click(object sender, EventArgs e) { MessageUserControl.Visible = false; if (int.Parse(VendorDLL.SelectedValue) == 0) { MessageUserControl.ShowInfo("there are no Current Order and StockItem list to clear. "); MessageUserControl.ShowInfo(""); } GSTID.Text = ""; SubTotalID.Text = ""; TotalID.Text = ""; VendorDLL.SelectedIndex = 0; Name.Text = null; Phone.Text = null; Address.Text = null; City.Text = null; Province.Text = null; PostalCode.Text = null; OrderList.DataSource = null; OrderList.DataBind(); VendorStockItemList.DataSource = null; VendorStockItemList.DataBind(); }
protected void BindData() { string user_id = "admin"; // getUserName(); string strSql = "select * From rpt_showoclist_prd where within_code='0000'"; // if (user_id != "") { strSql += " AND userid='" + user_id + "'"; } strSql += " ORDER BY create_date,cs_req_date,mo_id,create_by,period_day Desc"; DataTable dtOc = sh.ExecuteSqlReturnDataTable(strSql); lblShowTotalRec.Text = "記錄數:" + dtOc.Rows.Count.ToString(); if (dtOc.Rows.Count == 0) { dtOc.Rows.Add(); } //gvDetails.DataSource = dtOc.DefaultView; //gvDetails.DataBind(); OrderList.DataSource = dtOc.DefaultView; OrderList.DataBind(); }
protected void VendorFetch_Click(object sender, EventArgs e) { MessageUserControl.Visible = false; string username = User.Identity.Name; ApplicationUserManager secmgr = new ApplicationUserManager( new UserStore <ApplicationUser>(new ApplicationDbContext())); EmployeeInfo info = secmgr.User_GetEmployee(username); if (VendorDLL.SelectedIndex == 0) { MessageUserControl.ShowInfo("Please select Vendor to retrive information."); } else { MessageUserControl.TryRun(() => { VendorComtroller sysmgr = new VendorComtroller(); Vendor results = sysmgr.Vendor_Get(int.Parse(VendorDLL.SelectedValue)); Name.Text = results.VendorName; Phone.Text = null; Address.Text = null; City.Text = null; Province.Text = null; PostalCode.Text = null; }); } List <CurrentActiveOrderList> list = new List <CurrentActiveOrderList>(); MessageUserControl.TryRun(() => { int employeeid = info.EmployeeID; int vendorid = int.Parse(VendorDLL.SelectedValue); for (int rowindex = 0; rowindex < OrderList.Rows.Count; rowindex++) { CurrentActiveOrderList temp = new CurrentActiveOrderList(); temp.StockItemID = int.Parse((OrderList.Rows[rowindex].FindControl("StockItemID") as Label).Text); temp.Description = (OrderList.Rows[rowindex].FindControl("Description") as Label).Text; temp.QuantityOnHand = int.Parse((OrderList.Rows[rowindex].FindControl("QuantityOnHand") as Label).Text); temp.QuantityOnOrder = int.Parse((OrderList.Rows[rowindex].FindControl("QuantityOnOrder") as Label).Text); temp.ReOrderLevel = int.Parse((OrderList.Rows[rowindex].FindControl("ReOrderLevel") as Label).Text); temp.QuantityToOrder = int.Parse((OrderList.Rows[rowindex].FindControl("QuantityToOrder") as TextBox).Text); temp.Price = decimal.Parse((OrderList.Rows[rowindex].FindControl("Price") as TextBox).Text, NumberStyles.Currency); list.Add(temp); } PurchaseOrderDetailController sysmgr = new PurchaseOrderDetailController(); List <CurrentActiveOrderList> result = sysmgr.List_StockItemsForSuggestedNewOrder(vendorid, employeeid); OrderList.DataSource = result; OrderList.DataBind(); StockItemController sus = new StockItemController(); List <VendorStockItemsList> result1 = sus.List_VendorStockItemsForCurrentActiveOrder(vendorid, result); VendorStockItemList.DataSource = result1; VendorStockItemList.DataBind(); PurchaseOrderController order = new PurchaseOrderController(); PurchaseOrder result2 = order.Order_GetByVendor(vendorid); GSTID.Text = string.Format("{0:C2}", result2.TaxAmount); SubTotalID.Text = string.Format("{0:C2}", result2.SubTotal); TotalID.Text = string.Format("{0:C2}", result2.Total); }); }
protected void Timer1_Tick(object sender, EventArgs e) { OrderList.DataBind(); }