コード例 #1
0
 /// <summary>
 /// Valids the data.
 /// </summary>
 /// <returns></returns>
 protected override bool ValidData()
 {
     if (PlanTemplateListId == 0)
     {
         XtraMessageBox.Show(ResourceHelper.GetResourceValueByName("ResPlanTemplateListId"),
                             ResourceHelper.GetResourceValueByName("ResDetailContent"), MessageBoxButtons.OK,
                             MessageBoxIcon.Error);
         grdlookUpEditPlanTemplateListId.Focus();
         return(false);
     }
     if (CurrencyLocal != CurrencyAccounting && Math.Abs(ExchangeRate - 0F) <= 0)
     {
         XtraMessageBox.Show(ResourceHelper.GetResourceValueByName("ResEstimateExchangeRate"),
                             ResourceHelper.GetResourceValueByName("ResDetailContent"), MessageBoxButtons.OK,
                             MessageBoxIcon.Error);
         txtExchangeRate.Focus();
         return(false);
     }
     if (ActionMode == ActionModeVoucherEnum.AddNew || ActionMode == ActionModeVoucherEnum.DuplicateVoucher)
     {
         _receiptEstimatesPresenter.Display(RefTypeId, (short)spinYearOfPlaning.Value);
         if (ReceiptEstimates.Count > 0)
         {
             XtraMessageBox.Show(@"Chứng từ dự toán năm " + spinYearOfPlaning.Value + @" đã tồn tại !",
                                 ResourceHelper.GetResourceValueByName("ResDetailContent"), MessageBoxButtons.OK,
                                 MessageBoxIcon.Error);
             return(false);
         }
     }
     return(true);
 }
 /// <summary>
 /// Loads the data into grid.
 /// </summary>
 protected override void LoadDataIntoGrid()
 {
     if (GlobalVariable.DisplayVourcherMode == 1)
     {
         _receiptEstimatesPresenter.Display((int)RefTypeId);
     }
     else
     {
         _receiptEstimatesPresenter.DisplayByYear((int)RefTypeId, PostedDate);
     }
 }