public ReceiptMutation() { Field <NonNullGraphType <ReceiptType> >( _Creation, "Tạo và trả về một phiếu thu mới", _InputArgument <ReceiptCreateInput>(), _CheckPermission_TaskObject( p => p.PermissionManageRentingRoom, context => { var employee = AuthenticationHelper.GetEmployee(context); return(ReceiptBusiness.Add(employee, _GetInput(context))); } ) ); }
// The following methods are responsible for updating information when it is changed. /// <summary> /// Updates the user control every time it is loaded. /// </summary> public void UpdateUserControl() { var eazyCartContext = new EazyCartContext(); this.categoryBusiness = new CategoryBusiness(eazyCartContext); this.productBusiness = new ProductBusiness(eazyCartContext); this.productReceiptBusiness = new ProductReceiptBusiness(eazyCartContext); this.receiptBusiness = new ReceiptBusiness(eazyCartContext); this.UpdateSelectProductTab(); this.UpdateReceiptTab(); this.UpdatePaidAmountAndChange(0); this.SetButtonAvailability(); this.highestProductReceiptId = this.productReceiptBusiness.GetHighestId(); this.currentProductReceiptId = this.highestProductReceiptId + 1; searchBoxTextBox.Focus(); }
public ReceiptQuery() { Field <NonNullGraphType <ListGraphType <NonNullGraphType <ReceiptType> > > >( _List, "Trả về một danh sách các phiếu thu", resolve: _CheckPermission_List( p => p.PermissionGetAccountingVoucher, context => ReceiptBusiness.Get() ) ); Field <NonNullGraphType <ReceiptType> >( _Item, "Trả về thông tin một phiếu thu", _IdArgument(), _CheckPermission_Object( p => p.PermissionGetAccountingVoucher, context => ReceiptBusiness.Get(_GetId <int>(context)) ) ); }
/// <summary> /// This event is triggered when the 'Generate Report' button is clicked. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void GenerateReportButton_Click(object sender, EventArgs e) { // Renew the information. var eazyCartContext = new EazyCartContext(); this.productBusiness = new ProductBusiness(eazyCartContext); this.receiptBusiness = new ReceiptBusiness(eazyCartContext); int categoryIndex = this.reportCategoryComboBox.SelectedIndex; int typeIndex = this.reportTypeComboBox.SelectedIndex; int periodIndex = this.reportPeriodComboBox.SelectedIndex; // Validate whether appropriate values have been selected, then // proceed to generate the report. if (categoryIndex == 0) { string message = "Please select a report category"; MessageForm messageForm = new MessageForm(message, MessageFormType.Error); messageForm.ShowDialog(); return; } else if (typeIndex == 0) { string message = "Please select a report type"; MessageForm messageForm = new MessageForm(message, MessageFormType.Error); messageForm.ShowDialog(); return; } else if ((categoryIndex == 1 || categoryIndex == 3) && (periodIndex == 0)) { string message = "Please select a period"; MessageForm messageForm = new MessageForm(message, MessageFormType.Error); messageForm.ShowDialog(); return; } else { this.GetReportNumber(categoryIndex, typeIndex, periodIndex); } }
// The following methods are responsible for updating information when it is changed. /// <summary> /// Updates the user control every time it is loaded. /// </summary> private void UpdateUserControl() { var eazyCartContext = new EazyCartContext(); this.productBusiness = new ProductBusiness(eazyCartContext); this.receiptBusiness = new ReceiptBusiness(eazyCartContext); Color reportBarColor = Color.FromRgb(44, 62, 80); this.reportBarColoredBrush = new SolidColorBrush(reportBarColor); this.reportGraphLabelBrush = Brushes.Black; this.reportValueLabelBrush = Brushes.GhostWhite; this.reportFontFamily = new FontFamily("Segoe UI"); this.InitializeDefaultLabels(); this.InitializeReportTypes(); this.fileNameTextBox.Text = "EazyCartChart"; this.reportCategoryComboBox.SelectedIndex = 0; this.exportReportButton.Enabled = false; this.exportReportButton.BackColor = this.disabledButtonColor; this.reportChart.Visibility = Visibility.Hidden; }