/// <summary>
 /// Handles the Closed event of the grdlookUpEditPlanTemplateListId control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="DevExpress.XtraEditors.Controls.ClosedEventArgs" /> instance containing the event data.</param>
 private void grdlookUpEditPlanTemplateListId_Closed(object sender, DevExpress.XtraEditors.Controls.ClosedEventArgs e)
 {
     try
     {
         var systemDate = GlobalVariable.SystemDate;
         spinYearOfPlaning.Value = grdlookUpEditPlanTemplateListIdView.GetFocusedRowCellValue("PlanYear") != null ? (short)grdlookUpEditPlanTemplateListIdView.GetFocusedRowCellValue("PlanYear") : 0;
         if (!ReferenceEquals(grdlookUpEditPlanTemplateListId.EditValue, ""))
         {
             var item = grdlookUpEditPlanTemplateListId.EditValue.ToString();
             if (DateTime.Parse(systemDate).Year == spinYearOfPlaning.Value)
             {
                 _planTemplateItemsPresenter.DisplayByPlanTemplateListId(int.Parse(item));
             }
             else
             {
                 _planTemplateItemsPresenter.DisplayForEstimate(int.Parse(item), (short)spinYearOfPlaning.Value, 0);
             }
         }
     }
     catch (Exception ex)
     {
         XtraMessageBox.Show(ex.Message, ResourceHelper.GetResourceValueByName("ResExceptionCaption"), MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Пример #2
0
 private void grdPlanTemplateList_Closed(object sender, ClosedEventArgs e)
 {
     if (!ReferenceEquals(grdPlanTemplateList.EditValue, "") && !ReferenceEquals(grdPlanTemplateList.EditValue, null))
     {
         var item = grdPlanTemplateList.EditValue.ToString();
         _planTemplateItemsPresenter.DisplayByPlanTemplateListId(int.Parse(item));
     }
     else
     {
         if (ActionMode == ActionModeEnum.AddNew)
         {
             PlanTemplateItems = new List <PlanTemplateItemModel>();
         }
     }
 }