Esempio n. 1
0
        private void UpdateControls()
        {
            if (orphanageGridView1.SelectedRows != null)
            {
                var retObjectOrphansCount = _radGridHelper.GetValueBySelectedRow("OrphansCount");
                if (retObjectOrphansCount != null)
                {
                    int orphansCount;
                    int.TryParse(retObjectOrphansCount.ToString(), out orphansCount);
                    bool value = orphansCount > 0 ? true : false;
                    btnShowOrphans.Enabled = value;
                }
                var retObjectFamiliesCount = _radGridHelper.GetValueBySelectedRow("FamiliesCount");
                if (retObjectFamiliesCount != null)
                {
                    int familiesCount;
                    int.TryParse(retObjectFamiliesCount.ToString(), out familiesCount);
                    bool value = familiesCount > 0 ? true : false;
                    btnShowFamilies.Enabled = value;
                }

                if (orphanageGridView1.SelectedRows.Count == 1)
                {
                    btnEdit.Enabled = true;
                }
                else
                {
                    btnEdit.Enabled = false;
                }
            }
        }
Esempio n. 2
0
        private void UpdateControls()
        {
            if (orphanageGridView1.SelectedRows != null)
            {
                var retObjectGuarantorsCount = _radGridHelper.GetValueBySelectedRow("GuarantorsCount");
                if (retObjectGuarantorsCount != null)
                {
                    int guarantorCount;
                    int.TryParse(retObjectGuarantorsCount.ToString(), out guarantorCount);
                    bool value = guarantorCount > 0 ? true : false;
                    btnShowGuarantors.Enabled = value;
                }
                var retObjectBailsCount = _radGridHelper.GetValueBySelectedRow("BailsCount");
                if (retObjectBailsCount != null)
                {
                    int bailesCount;
                    int.TryParse(retObjectBailsCount.ToString(), out bailesCount);
                    bool value = bailesCount > 0 ? true : false;
                    btnShowBails.Enabled = value;
                }

                if (orphanageGridView1.SelectedRows.Count == 1)
                {
                    btnEdit.Enabled = true;
                }
                else
                {
                    btnEdit.Enabled = false;
                }
            }
        }
Esempio n. 3
0
 private void UpdateControls()
 {
     if (orphanageGridView1.SelectedRows != null)
     {
         var OrphansCountObject = _radGridHelper.GetValueBySelectedRow("OrphansCount");
         var IsBailedObject     = _radGridHelper.GetValueBySelectedRow("IsBailed");
         var IsExcludedObject   = _radGridHelper.GetValueBySelectedRow("IsExcluded");
         if (OrphansCountObject != null)
         {
             int orphansCount;
             int.TryParse(OrphansCountObject.ToString(), out orphansCount);
             bool value = orphansCount > 0 ? true : false;
             btnShowOrphans.Enabled = value;
         }
         if (IsBailedObject != null)
         {
             bool isBailed;
             bool.TryParse(IsBailedObject.ToString(), out isBailed);
             btnBail.Image       = isBailed ? Properties.Resources.UnBailPic : Properties.Resources.BailPic;
             btnBail.ToolTipText = isBailed ? Properties.Resources.UnsetBail : Properties.Resources.SetBail;
         }
         if (IsExcludedObject != null)
         {
             bool isExcluded;
             bool.TryParse(IsExcludedObject.ToString(), out isExcluded);
             btnExclude.Image       = isExcluded ? Properties.Resources.UnhidePic : Properties.Resources.HidePic;
             btnExclude.ToolTipText = isExcluded ? Properties.Resources.UnExclude : Properties.Resources.Exclude;
         }
         if (orphanageGridView1.SelectedRows.Count == 1)
         {
             btnEdit.Enabled = true;
         }
         else
         {
             btnEdit.Enabled = false;
         }
     }
 }