private void LoadMaster() { lbVoucherID.Content = "Mã phiếu: " + VoucherID; DataTable dtMaster = L3SQLServer.ReturnDataTable(BLStore.SQLStoreD07P2011(VoucherID, 0)); if (dtMaster.Rows.Count > 0) { deVoucherDate.EditValue = dtMaster.Rows[0]["VoucherDate"]; lkeSupplier.EditValue = dtMaster.Rows[0]["ObjectID"]; seTotalMoney.EditValue = dtMaster.Rows[0]["Amount"]; if (dtMaster.Rows[0]["IsPayment"].ToString() == "1") { chePaid.IsChecked = true; IsPayment = 1; chePaid.IsReadOnly = true; btnSave.IsEnabled = false; COL_InventoryID.AllowEditing = DevExpress.Utils.DefaultBoolean.False; COL_Quantity.AllowEditing = DevExpress.Utils.DefaultBoolean.False; COL_Price.AllowEditing = DevExpress.Utils.DefaultBoolean.False; COL_VAT.AllowEditing = DevExpress.Utils.DefaultBoolean.False; COL_Discount.AllowEditing = DevExpress.Utils.DefaultBoolean.False; } else { chePaid.IsChecked = false; } } }
private void LoadTDBDropdown() { DataTable dt1 = BLStore.ReturnObjectIDTable(); DataTable dt2 = BLStore.ReturnLookupInventory(); L3DataSource.LoadDataSource(lkeSupplier, dt1, true); L3DataSource.LoadDataSource(lkeInventoryID, dt2, true); }
private void btnSave_Click(object sender, RoutedEventArgs e) { if (chePaid.IsChecked == true) { IsPayment = 1; } else { IsPayment = 0; } CalTotalMoney(); btnSave.Focus(); if (!btnSave.IsFocused) { return; } if (!AllowSave()) { return; } btnSave.IsEnabled = false; double Amount = CalTotalMoney(); StringBuilder sSQL = new StringBuilder(); sSQL.AppendLine(BLStore.SQLDeleteD07T2011(VoucherID)); sSQL.AppendLine(BLStore.SQLDeleteD07T2010(VoucherID)); sSQL.AppendLine(BLStore.SQLInsertD07T2011s(VoucherID, dtGrid)); sSQL.AppendLine(BLStore.SQLInsertD07T2010(VoucherID, lkeSupplier.EditValue.ToString(), Amount, IsPayment)); if (bAdd) { sSQL.AppendLine(BLStore.UpdateStockD91T1040(dtGrid)); } if (L3SQLServer.ExecuteSQL(sSQL.ToString())) { Lemon3.Messages.L3Msg.SaveOK(); LoadMaster(); VoucherID = ""; } else { Lemon3.Messages.L3Msg.SaveNotOK(); btnSave.IsEnabled = true; } }
private void tsbDelete_ItemClick(object sender, DevExpress.Xpf.Bars.ItemClickEventArgs e) { string VoucherID = GridStore.GetFocusedRowCellValue(COL_VoucherID).ToString(); int i = GridStore.View.FocusedRowData.RowHandle.Value; StringBuilder sSQL = new StringBuilder(); sSQL.AppendLine(BLStore.SQLDeleteD07T2011(VoucherID)); sSQL.AppendLine(BLStore.SQLDeleteD07T2010(VoucherID)); try { L3SQLServer.ExecuteSQL(sSQL.ToString()); } catch (Exception) { MessageBox.Show("Lỗi!"); } LoadTDBGrid(); GridStore.FocusRowHandle(i); }
private void LoadTDBGrid() { GridStore.ItemsSource = BLStore.LoadGridVoucher(); }
private void LoadTDBGrid() { dtGrid = L3SQLServer.ReturnDataTable(BLStore.SQLStoreD07P2011(VoucherID, 1)); L3DataSource.LoadDataSource(GridVoucherInventory, dtGrid, true); }