public MainPage() { this.InitializeComponent(); VM = new MainPageModel(); theStatus = new requstStutus(); VM.reseatList(ItemListViewXML); }
public string EnterFunc(Button theBTN, requstStutus theStatus, double h, double b, int Q) { switch (theStatus) { case requstStutus.show: return($"כמות במלאי {BoxM.GetQunt(new Box(h, b))}"); case requstStutus.add: BoxM.AddBox(new Box(h, b), Q); return("התווסף בהצלחה"); case requstStutus.delet: BoxM.SellBox(new Box(h, b), Q); return("נמכר בהצלחה"); } return(default);
private void BTNEnter_Click(object sender, RoutedEventArgs e) { if (RBAdd.IsChecked.Value) { theStatus = requstStutus.add; } else if (RBLow.IsChecked.Value) { theStatus = requstStutus.delet; } else if (RBShowBoxDetail.IsChecked.Value) { theStatus = requstStutus.show; } Button theBtn = (Button)sender; int Q; int.TryParse(TBoxQ.Text, out Q); var i = VM.EnterFunc(theBtn, theStatus, double.Parse(TBoxH.Text), double.Parse(TBoxB.Text), Q); TBpopUp.Text = i.ToString(); }