private void btn_CrateInvoce_Click(object sender, RoutedEventArgs e) { Win_Invoice wn = new Win_Invoice(); wn.Win_state = 1; wn.ShowDialog(); ShowInvoiceInfo(SearchStatement); }
private void Btn_Invoce_Click(object sender, RoutedEventArgs e) { var query = (from ua in databse.UserAccesses where ua.UserID == PublicVariable.GUserID where ua.SystemPartID == 12 select ua); var result = query.ToList(); if (result.Count > 0) { Win_Invoice wn = new Win_Invoice(); wn.Win_state = 1; wn.ShowDialog(); } else { MessageBox.Show("شما به این بخش دسترسی ندارید", "خطا", MessageBoxButton.OK, MessageBoxImage.Error); } }
private void btn_EditCreateInvoice_Click(object sender, RoutedEventArgs e) { object item = datagrid_invoiceshow.SelectedItem; Win_Invoice WN = new Win_Invoice(); if (item == null) { MessageBox.Show("لطفا فاکتوری را از لیست انتخاب کنید"); return; } WN.Win_state = 2; WN.InvoceID = Convert.ToInt32((datagrid_invoiceshow.SelectedCells[0].Column.GetCellContent(item) as TextBlock).Text); WN.CoustomerName = (datagrid_invoiceshow.SelectedCells[1].Column.GetCellContent(item) as TextBlock).Text; WN.Date = (datagrid_invoiceshow.SelectedCells[5].Column.GetCellContent(item) as TextBlock).Text; WN.InvociePrice_frosoh = Convert.ToInt64((datagrid_invoiceshow.SelectedCells[6].Column.GetCellContent(item) as TextBlock).Text); WN.InvoicePrice_kharid = Convert.ToInt64((datagrid_invoiceshow.SelectedCells[7].Column.GetCellContent(item) as TextBlock).Text); WN.ShowDialog(); ShowInvoiceInfo(SearchStatement); }