protected void SaveData(object sender, EventArgs e) { var data = new List <AssignPicker>(); var pickerDropDown = int.Parse(PickerDropDown.SelectedValue); int orderId = int.Parse(OrderDropDown.SelectedValue); if (pickerDropDown != null && pickerDropDown != 0 && orderId != null && orderId != 0) { foreach (GridViewRow row in ProductGridView.Rows) { var dataItem = new AssignPicker(); var orderListID = row.FindControl("OrderListID") as HiddenField; dataItem.OrderListID = int.Parse(orderListID.Value); var qtypickTextBox = row.FindControl("qtyPickBox") as TextBox; var pickIssueTextBox = row.FindControl("pickIssueBox") as TextBox; dataItem.PickIssue = pickIssueTextBox.Text; //Add thr new DataItem to the list data to send to the BLL dataItem.QtyPicked = double.Parse(qtypickTextBox.Text); data.Add(dataItem); } } var controller = new OrderListController(); controller.PickerAssign(orderId, pickerDropDown, data); }
protected void FetchingInfo(object sender, EventArgs e) { var controller = new OrderListController(); var detail = controller.CustomerDetails(int.Parse(OrderDropDown.SelectedValue)); CustomerID.Value = detail.CustomerID.ToString(); CustomerNameLabel.Text = "Customer:" + detail.FullName; CustomerContact.Text = "Phone:" + detail.Contact; }
public void ParseOrdersList_ShouldReturnEmpty() { var controller = new OrderListController(_firebaseService); var emptyList = new List <Order>() { }; var json = JsonConvert.SerializeObject(emptyList); var list = controller.ParseOrdersList(json); Assert.Empty(list); }
public void GetUserOrders() { var controller = new OrderListController(_firebaseService); var orders = controller.GetUserOrders(1).Value; var expectedList = new List <Order>() { new Order() { Id = 1, UserId = 100, LastStatus = Status.InTransit } }; Assert.Single(orders); Assert.Equal(expectedList, orders); }
public void ParseOrdersList_ShouldReturnOne() { var controller = new OrderListController(_firebaseService); var expectedList = new List <Order>() { new Order() { Id = 1, UserId = 100 } }; var json = JsonConvert.SerializeObject(expectedList); var list = controller.ParseOrdersList(json); Assert.Single(list); Assert.Equal(expectedList, list); }