Esempio n. 1
0
 public override void Run(object sender, System.EventArgs e)
 {
     try
     {
         DF3DApplication app = (DF3DApplication)this.Hook;
         if (app == null || app.Workbench == null)
         {
             return;
         }
         app.Workbench.BarPerformClick("CancelSelection");
         ComboBoxEdit cbEdit = sender as ComboBoxEdit;
         CboItem      item   = cbEdit.SelectedItem as CboItem;
         CommonUtils.Instance().SetCurEditLayer(item == null ? null : item.Value);
         app.Workbench.UpdateMenu();
         if (item != null && item.Value != null)
         {
             IBaseLayer layer = item.Value.GetTreeLayer();
             if (layer != null)
             {
                 layer.Visible = true;
             }
             else
             {
                 IFeatureLayer fl = item.Value.GetFeatureLayer();
                 if (fl != null)
                 {
                     fl.VisibleMask = gviViewportMask.gviViewAllNormalView;
                 }
             }
         }
     }
     catch (Exception ex)
     {
     }
 }
Esempio n. 2
0
        public override void Init(object sender)
        {
            List <DF3DFeatureClass> dffcList = DF3DFeatureClassManager.Instance.GetAllFeatureClass();

            if (dffcList != null && dffcList.Count > 0)
            {
                BarEditItem item = sender as BarEditItem;
                if (item.Edit is RepositoryItemComboBox)
                {
                    RepositoryItemComboBox ricb = item.Edit as RepositoryItemComboBox;
                    ricb.NullText        = "(请选择)";
                    ricb.NullValuePrompt = "(请选择)";
                    ricb.Items.Clear();
                    ricb.Items.Insert(0, "(清空选择)");
                    for (int i = 0; i < dffcList.Count; i++)
                    {
                        DF3DFeatureClass dffc    = dffcList[i];
                        CboItem          cboItem = new CboItem(dffc.ToString(), dffc);
                        ricb.Items.Add(cboItem);
                    }
                }
            }
        }
Esempio n. 3
0
        bool CamposOK()
        {
            bool booEstado = true;
            int  n_fila    = 0;

            if (TxtNumSer.Text == "")
            {
                MessageBox.Show("¡ No ha especificado el numero de serie del programa de produccion !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                TxtNumSer.Focus();
                booEstado = false;
                return(booEstado);
            }

            if (TxtNumDoc.Text == "")
            {
                MessageBox.Show("¡ No ha especificado el numero de documento del programa de produccion !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                TxtNumDoc.Focus();
                booEstado = false;
                return(booEstado);
            }

            if (TxtFchReg.Text == "")
            {
                MessageBox.Show("¡ No ha especificado la fecha de registro !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                TxtFchReg.Focus();
                booEstado = false;
                return(booEstado);
            }

            if (Convert.ToInt16(CboSol.SelectedValue) == 0)
            {
                MessageBox.Show("¡ No ha especificado en nombre del solicitante de los insumos !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                CboSol.Focus();
                booEstado = false;
                return(booEstado);
            }

            if (Convert.ToInt16(CboItem.SelectedValue) == 0)
            {
                MessageBox.Show("¡ No ha especificado el nombre producto !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                CboItem.Focus();
                booEstado = false;
                return(booEstado);
            }

            if (FgInsumos.Rows.Count == 2)
            {
                MessageBox.Show("¡ La solicitud de materiales debe de tener como minimo un insumo !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                FgInsumos.Focus();
                booEstado = false;
                return(booEstado);
            }
            else
            {
                for (n_fila = 2; n_fila <= FgInsumos.Rows.Count - 1; n_fila++)
                {
                    if (Convert.ToDouble(funFunciones.NulosN(FgInsumos.GetData(n_fila, 5))) == 0)
                    {
                        MessageBox.Show("¡ Debe de indicar la cantidad de insumo entregada en la fila Nº" + n_fila.ToString() + "!", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                        FgInsumos.Focus();
                        booEstado = false;
                        return(booEstado);
                    }
                }
            }

            return(booEstado);
        }
Esempio n. 4
0
        private static int GetComboBoxEnum(System.Windows.Forms.ComboBox cbo)
        {
            CboItem item = (CboItem)cbo.Items[cbo.SelectedIndex];

            return(item.e);
        }