private void Button_Click(object sender, RoutedEventArgs e) { CostumersTable selected_costumer = (CostumersTable)CustomerSelectionComboBox.SelectedItem; CostumersBL.UpdateBL(selected_costumer, firstname_txb.Text, lastName_txb.Text, address_txb.Text, phone_txb.Text, mail_txb.Text, Int32.Parse(status_txb.Text), notes_txb.Text); this.Close(); }
private void CostumerSelectionComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { CostumersTable selectedCostumer = (CostumersTable)CostumerSelectionComboBox.SelectedItem; if (selectedCostumer.full_Name != costumerName_txb.Text) { costumerName_txb.Text = selectedCostumer.full_Name; } }
public static orderDetailsTable AddCostumerOrder(int discount, int amount, string notes, int active, string name, string type, string typeOfTree, string color, string shoeing, int cost, int costPrice, CostumersTable selectedCostumer) { orderDetailsTable odt = DataLayer.AddCostumerOrder(discount, amount, notes, active, name, type, typeOfTree, color, shoeing, cost, costPrice, selectedCostumer); return(odt); }
private void Button_Click(object sender, RoutedEventArgs e) { CostumersTable selectedCostumer = (CostumersTable)CostumerSelectionComboBox.SelectedItem; orderDetailsTable selectedOrder = (orderDetailsTable)IdOrderSelectionComboBox.SelectedItem; CostumerOrderBL.UpdateBL(Convert.ToInt32(discount_txb.Text), Convert.ToInt32(amount_txb.Text), notes_txb.Text, Convert.ToInt32(active_txb.Text), productName_txb.Text, productType_txb.Text, typeOfTree_txb.Text, color_txb.Text, shoeing_txb.Text, Convert.ToInt32(cost_txb.Text), Convert.ToInt32(costPrice_txb.Text), selectedCostumer, selectedOrder); this.Close(); }
public static void UpdateCostumerDL(CostumersTable ct, string firstName, string lastName, string address, string phone, string mail, int active, string notes) { CostumersTable selected_costumer = ct; selected_costumer.first_Name = firstName; selected_costumer.last_Name = lastName; selected_costumer.address = address; selected_costumer.phoneNumber = phone; selected_costumer.E_mail = mail; selected_costumer.active = active; selected_costumer.notes = notes; db.SaveChanges(); }
public static void UpdateCostumerOrder(int discount, int amount, string notes, int active, string name, string type, string typeOfTree, string color, string shoeing, int cost, int cosPrice, CostumersTable selectedCostumer, orderDetailsTable selectedOrder) { orderDetailsTable odt = selectedOrder; odt.discount = discount; odt.amount = amount; odt.notes = notes; odt.active = active; odt.name = name; odt.type = type; odt.typeOfTree = typeOfTree; odt.color = color; odt.shoeing = shoeing; odt.cost = cost; odt.costPrice = cosPrice; if (selectedCostumer != null) { odt.CostumersTable = selectedCostumer; odt.costumers_id = selectedCostumer.Id; } db.SaveChanges(); }
public static orderDetailsTable AddCostumerOrder(int discount, int amount, string notes, int active, string name, string type, string typeOfTree, string color, string shoeing, int cost, int costPrice, CostumersTable selectedCostumer) { orderDetailsTable odt = db.orderDetailsTable.Add(new orderDetailsTable() { CostumersTable = selectedCostumer, discount = discount, amount = amount, notes = notes, active = 0, name = name, type = type, typeOfTree = typeOfTree, color = color, shoeing = shoeing, cost = cost, costPrice = costPrice, costumers_id = selectedCostumer.Id }); db.SaveChanges(); return(odt); }
private void Button_Click(object sender, RoutedEventArgs e) { CostumersTable selectedCostumer = (CostumersTable)CostumerSelectionComboBox.SelectedItem; orderDetailsTable odt = CostumerOrderBL.AddCostumerOrder(Convert.ToInt32(discount_txb.Text), Convert.ToInt32(amount_txb.Text), notes_txb.Text, 0, productName_txb.Text, productType_txb.Text, typeOfTree_txb.Text, color_txb.Text, shoeing_txb.Text, Convert.ToInt32(cost_txb.Text), Convert.ToInt32(costPrice_txb.Text), selectedCostumer); discount_txb.Text = ""; amount_txb.Text = ""; notes_txb.Text = ""; productName_txb.Text = ""; productType_txb.Text = ""; typeOfTree_txb.Text = ""; color_txb.Text = ""; shoeing_txb.Text = ""; cost_txb.Text = ""; costPrice_txb.Text = ""; idlist.Add(odt); ContinueOrderCostumer coc = new ContinueOrderCostumer(this, this.idlist); this.Hide(); coc.ShowDialog(); }
public static void UpdateBL(CostumersTable ct, string firstName, string lastName, string address, string phone, string mail, int active, string notes) { DataLayer.UpdateCostumerDL(ct, firstName, lastName, address, phone, mail, active, notes); }
public static void UpdateBL(int discount, int amount, string notes, int active, string name, string type, string typeOfTree, string color, string shoeing, int cost, int cosPrice, CostumersTable selectedCostumer, orderDetailsTable selectedOrder) { DataLayer.UpdateCostumerOrder(discount, amount, notes, active, name, type, typeOfTree, color, shoeing, cost, cosPrice, selectedCostumer, selectedOrder); }