コード例 #1
0
        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();
        }
コード例 #3
0
        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();
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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();
        }
コード例 #6
0
 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);
 }