private void ShowGrid() { LoadVendor(); if (MainWindow.userName == "admin") { if (MainWindow.isgst == 1) { cc.OpenConnection(); cc.DataGridDisplay("Select Bno,gtotal,Vid,FORMAT(PurchaseDate,'dd-MMM-yyyy') as PDate,Payment from TransactionDetails where Vid=" + vendorID + " and BillType='GST'"); dataGridPurchasedVendor.ItemsSource = cc.dt.AsDataView(); dataGridPurchasedVendor.Visibility = System.Windows.Visibility.Visible; cc.CloseConnection(); } else { cc.OpenConnection(); cc.DataGridDisplay("Select Bno,gtotal,Vid,FORMAT(PurchaseDate,'dd-MMM-yyyy') as PDate,Payment from TransactionDetails where Vid=" + vendorID + " and BillType='NON_GST'"); dataGridPurchasedVendor.ItemsSource = cc.dt.AsDataView(); dataGridPurchasedVendor.Visibility = System.Windows.Visibility.Visible; cc.CloseConnection(); } } else { cc.OpenConnection(); cc.DataGridDisplay("Select Bno,gtotal,Vid,FORMAT(PurchaseDate,'dd-MMM-yyyy') as PDate,Payment from TransactionDetails where Vid=" + vendorID + " and BillType='GST'"); dataGridPurchasedVendor.ItemsSource = cc.dt.AsDataView(); dataGridPurchasedVendor.Visibility = System.Windows.Visibility.Visible; cc.CloseConnection(); } }
public HistoryPage() { InitializeComponent(); cc.OpenConnection(); cc.DataGridDisplay("select * from Stock"); histDataGrid.ItemsSource = cc.dt.AsDataView(); histDataGrid.Visibility = System.Windows.Visibility.Visible; }
private void LoadVendor() { cc.OpenConnection(); cc.DataGridDisplay("select distinct Vid,Vname from VendorDetails"); dataGridVendor.ItemsSource = cc.dt.AsDataView(); dataGridVendor.Visibility = System.Windows.Visibility.Visible; cc.CloseConnection(); }
private void ShowGrid() { LoadExpense(); cc.OpenConnection(); cc.DataGridDisplay("select Epayment,EDate from ExpenseTransactionDetails where Eid=" + expenseID + ""); dataGridExpenseList.ItemsSource = cc.dt.AsDataView(); dataGridExpenseList.Visibility = System.Windows.Visibility.Visible; cc.CloseConnection(); }
public ExpenseListPage() { InitializeComponent(); cc.OpenConnection(); cc.DataGridDisplay("select distinct Eid,Ename from ExpenseDetails"); dataGridVendor.ItemsSource = cc.dt.AsDataView(); dataGridVendor.Visibility = System.Windows.Visibility.Visible; cc.CloseConnection(); }
private void ShowGrid() { ShowDetails(); if (MainWindow.userName == "admin") { if (MainWindow.isgst == 1) { cc.DataGridDisplay("select itemid,iname,rate,purchaseQty,total,sprice,gst_percent,gst_amount from Stock where Bno = " + billNumber + " and BillType='GST' "); } else { cc.DataGridDisplay("select itemid,iname,rate,purchaseQty,total,sprice,gst_percent,gst_amount from Stock where Bno = " + billNumber + " and BillType='NON_GST' "); } } else { cc.DataGridDisplay("select itemid,iname,rate,purchaseQty,total,sprice,gst_percent,gst_amount from Stock where Bno = " + billNumber + " and BillType='GST' "); } dataGridVendorBill.ItemsSource = cc.dt.AsDataView(); dataGridVendorBill.Visibility = System.Windows.Visibility.Visible; }
private void LoadGrid() { cc.OpenConnection(); if (MainWindow.userName == "admin") { if (checkBoxGST.IsChecked == true) { cc.DataGridDisplay("select distinct CustomerName,CustomerPhone from BillStock where CustomerName not like 'Cust_%' and BillType='GST'"); } else { cc.DataGridDisplay("select distinct CustomerName,CustomerPhone from BillStock where CustomerName not like 'Cust_%' and BillType='NON_GST'"); } } else { cc.DataGridDisplay("select distinct CustomerName,CustomerPhone from BillStock where CustomerName not like 'Cust_%' and BillType='GST'"); } dataGridCustomer.ItemsSource = cc.dt.AsDataView(); dataGridCustomer.Visibility = System.Windows.Visibility.Visible; cc.CloseConnection(); }
private void gridDisplay() { cc.OpenConnection(); if (MainWindow.userName == "admin") { if (MainWindow.isgst == 1) { cc.DataGridDisplay("select distinct BillNo,NetAmount,AmountPaid,Credit,Debit,Date from CustomerTransactions where CustomerPhone = '" + customerPhone + "' and BillType='GST' "); } else { cc.DataGridDisplay("select distinct BillNo,NetAmount,AmountPaid,Credit,Debit,Date from CustomerTransactions where CustomerPhone = '" + customerPhone + "' and BillType='NON_GST' "); } } else { cc.DataGridDisplay("select distinct BillNo,NetAmount,AmountPaid,Credit,Debit,Date from CustomerTransactions where CustomerPhone = '" + customerPhone + "' and BillType='GST' "); } dataGridCustomer.ItemsSource = cc.dt.AsDataView(); dataGridCustomer.Visibility = System.Windows.Visibility.Visible; cc.CloseConnection(); }
private void billDisplay() { cc.OpenConnection(); if (MainWindow.userName == "admin") { if (MainWindow.isgst == 1) { cc.DataGridDisplay("select distinct ItemNo,Product,Price,ProductQuantity,TotalPrice,gstPercent,gstRate from BillStock where BillNo = " + bno + " and BillType='GST'"); } else { cc.DataGridDisplay("select distinct ItemNo,Product,Price,ProductQuantity,TotalPrice,gstPercent,gstRate from BillStock where BillNo = " + bno + " and BillType='NON_GST'"); } } else { cc.DataGridDisplay("select distinct ItemNo,Product,Price,ProductQuantity,TotalPrice,gstPercent,gstRate from BillStock where BillNo = " + bno + " and BillType='GST'"); } dataGridCustomer.ItemsSource = cc.dt.AsDataView(); dataGridCustomer.Visibility = System.Windows.Visibility.Visible; cc.CloseConnection(); }
public PurchasedVendor(string selectedName) { InitializeComponent(); VnameCombo = selectedName; LoadVendor(); cc.OpenConnection(); cc.CreateView("CREATE VIEW PurchasedVendor AS Select Stock.iname,Stock.rate,Stock.quantity,Stock.total,Stock.gtotal,TransactionDetails.Vname,TransactionDetails.PurchaseDate from Stock,TransactionDetails where Stock.Bno=TransactionDetails.Bno"); //cc.DataGridDisplay("select iname,rate,quantity,total,gtotal,PurchaseDate from Stock where Vname='"+VnameCombo+"'"); cc.DataGridDisplay("Select * from PurchasedVendor where Vname='" + VnameCombo + "'"); dataGridPurchasedVendor.ItemsSource = cc.dt.AsDataView(); dataGridPurchasedVendor.Visibility = System.Windows.Visibility.Visible; cc.DropView("DROP VIEW PurchasedVendor"); cc.CloseConnection(); }
private void viewBill() { if (txtBillNo.Text != null) { if (MainWindow.userName == "admin") { cc.OpenConnection(); string txtbn = Convert.ToString(txtBillNo.Text); if (checkBoxGST.IsChecked == true) { if (cc.BillPreview("select COUNT(*) from BillStock where BillNo = @bno and BillType='GST'", "@bno", txtbn, billExistValue) > 0) { displayDetails(); int bn = Convert.ToInt32(txtBillNo.Text); cc.DataGridDisplay("select ItemNo,Product,Price,ProductQuantity,gstPercent,gstRate,TotalPrice from BillStock where BillNo = " + bn + " and BillType='GST' "); dataGrid1.ItemsSource = cc.dt.AsDataView(); } else { MessageBox.Show("Bill does not exist"); txtBillNo.Text = currentBillNo; txtBillNo.Focus(); } } else { if (cc.BillPreview("select COUNT(*) from BillStock where BillNo = @bno and BillType='NON_GST'", "@bno", txtbn, billExistValue) > 0) { displayDetails(); int bn = Convert.ToInt32(txtBillNo.Text); cc.DataGridDisplay("select ItemNo,Product,Price,ProductQuantity,gstPercent,gstRate,TotalPrice from BillStock where BillNo = " + bn + " and BillType='NON_GST'"); dataGrid1.ItemsSource = cc.dt.AsDataView(); } else { MessageBox.Show("Bill does not exist"); txtBillNo.Text = currentBillNo; txtBillNo.Focus(); } } cc.CloseConnection(); } else { cc.OpenConnection(); string txtbn = Convert.ToString(txtBillNo.Text); if (cc.BillPreview("select COUNT(*) from BillStock where BillNo = @bno and BillType='GST'", "@bno", txtbn, billExistValue) > 0) { displayDetails(); int bn = Convert.ToInt32(txtBillNo.Text); cc.DataGridDisplay("select ItemNo,Product,Price,ProductQuantity,gstPercent,gstRate,TotalPrice from BillStock where BillNo = " + bn + " and BillType='GST' "); dataGrid1.ItemsSource = cc.dt.AsDataView(); } else { MessageBox.Show("Bill does not exist"); txtBillNo.Text = currentBillNo; txtBillNo.Focus(); } cc.CloseConnection(); } } }
private void ViewBill() { if (txt_Bill_No.Text != null) { if (MainWindow.userName == "admin") { if (checkBoxGST.IsChecked == true) { cc.OpenConnection(); string txtbn = Convert.ToString(txt_Bill_No.Text); if (cc.BillPreview("select COUNT(*) from Stock where Bno = @bno and BillType='GST'", "@bno", txtbn, billExistValue) > 0) { displayVendorDetails(); int bn = Convert.ToInt32(txt_Bill_No.Text); cc.DataGridDisplay("select itemid,iname,rate,purchaseQty,total,sprice,gst_percent,gst_amount from Stock where Bno = " + bn + " and BillType='GST'"); dataGridPurchase.ItemsSource = cc.dt.AsDataView(); } else { MessageBox.Show("Bill does not exist"); txt_Bill_No.Text = currentBillNo; txt_Bill_No.Focus(); } cc.CloseConnection(); } else { cc.OpenConnection(); string txtbn = Convert.ToString(txt_Bill_No.Text); if (cc.BillPreview("select COUNT(*) from Stock where Bno = @bno and BillType='NON_GST'", "@bno", txtbn, billExistValue) > 0) { displayVendorDetails(); int bn = Convert.ToInt32(txt_Bill_No.Text); cc.DataGridDisplay("select itemid,iname,rate,purchaseQty,total,sprice,gst_percent,gst_amount from Stock where Bno = " + bn + " and BillType='NON_GST'"); dataGridPurchase.ItemsSource = cc.dt.AsDataView(); } else { MessageBox.Show("Bill does not exist"); txt_Bill_No.Text = currentBillNo; txt_Bill_No.Focus(); } cc.CloseConnection(); } } else { cc.OpenConnection(); string txtbn = Convert.ToString(txt_Bill_No.Text); if (cc.BillPreview("select COUNT(*) from Stock where Bno = @bno and BillType='GST'", "@bno", txtbn, billExistValue) > 0) { displayVendorDetails(); int bn = Convert.ToInt32(txt_Bill_No.Text); cc.DataGridDisplay("select itemid,iname,rate,purchaseQty,total,sprice,gst_percent,gst_amount from Stock where Bno = " + bn + " and BillType='GST'"); dataGridPurchase.ItemsSource = cc.dt.AsDataView(); } else { MessageBox.Show("Bill does not exist"); txt_Bill_No.Text = currentBillNo; txt_Bill_No.Focus(); } cc.CloseConnection(); } } }