public void Add_Item_Click(object sender, RoutedEventArgs e)
 {
     if (txtId.Text == "" || txtInfo.Text == "" || txtName_Family.Text == "" || txtAdress.Text == "" || txtTelephone.Text == "" || txtTime_Delivery.Text == "" ||
         txtCost.Text == "" || txtBalance.Text == "")
     {
         MessageBox.Show("Input empty"); txtInfo.Focus();
     }
     else             //
     {
         DateTime date_order;
         if (clndr_Date_Order.SelectedDate != null)
         {
             date_order = clndr_Date_Order.SelectedDate.Value.Date;                     //Calendar.SelectedDate.Value.Date.ToString();
         }
         //date_order = Calendar.SelectedDate.Value.Day.ToString() + "/" + Calendar.SelectedDate.Value.Month.ToString() + "/" + Calendar.SelectedDate.Value.Year.ToString();
         else
         {
             date_order = DateTime.Now;
         }
         Item_Furnishings.AddItem(txtId, txtInfo, txtName_Family, txtAdress, txtTelephone, cmbSeller_Name, txtTime_Delivery, txtCost, txtBalance, date_order);
         writeExcel.AddItemToDataSet(Item_Furnishings.str_ItemData);
         //writeExcel.writeItemToExcel(Item_Furnishings.str_ItemData);
         txtId.Text = txtInfo.Text = txtName_Family.Text = txtAdress.Text = txtTelephone.Text = txtTime_Delivery.Text = txtCost.Text = txtBalance.Text = "";
         cmbSeller_Name.SelectedItem = null;
     }
 }
示例#2
0
        }         // Search MenuItem

        private void btn_AcceptChange_Click(object sender, RoutedEventArgs e)
        {
            try { Item_Furnishings.AcceptChangeItem(txt_Id, txt_Info, txt_Name, txt_Adress, txt_Phone, cmbSeller_Name, txt_Time_Delivery, txt_Cost, txt_Balance, txt_Date_Order); }
            catch (Exception ex) { MessageBox.Show(ex.Message.ToString() + "accept change 1"); }
            try { AcceptChangeItemDataSet(Item_Furnishings.str_ItemData); } catch (Exception ex) { MessageBox.Show(ex.Message.ToString() + "accept change 2"); }
            try { writereadExcel.writeToExcel(MainWindow.dataSet); } catch (Exception ex) { MessageBox.Show(ex.Message.ToString() + "accept change 3"); }
        }