Example #1
0
        private void FrmFatorConversao_KeyPress(object sender, KeyPressEventArgs e)
        {
            try
            {
                if (e.KeyChar == (char)Keys.Escape)
                {
                    if (this.IsEdit || this.IsInsert)
                    {
                        DataFator.AllowUserToAddRows = false;
                        BtnEdit.Enabled   = true;
                        BtnNew.Enabled    = false;
                        BtnSave.Enabled   = false;
                        BtnDelete.Enabled = false;

                        if (IsInsert)
                        {
                            int rows = row_current + (DataFator.Rows.Count - row_current);

                            for (int i = row_current; i < rows; i++)
                            {
                                DataFator.Rows[i].Selected = true;
                            }


                            UtilObject.DeleteSelected(DataFator);
                        }

                        for (int i = 0; i < DataFator.Rows.Count; i++)
                        {
                            DataFator.Rows[i].Cells[0].ReadOnly        = true;
                            DataFator.Rows[i].Cells[0].Style.BackColor = Color.LightSlateGray;
                            DataFator.Rows[i].Cells[1].ReadOnly        = true;
                            DataFator.Rows[i].Cells[1].Style.BackColor = Color.LightSlateGray;
                            DataFator.Rows[i].Cells[2].ReadOnly        = true;
                            DataFator.Rows[i].Cells[2].Style.BackColor = Color.LightSlateGray;
                            DataFator.Rows[i].Cells[3].ReadOnly        = true;
                            DataFator.Rows[i].Cells[3].Style.BackColor = Color.LightGray;
                            DataFator.Rows[i].Cells[4].ReadOnly        = true;
                            DataFator.Rows[i].Cells[4].Style.BackColor = Color.LightGray;
                            DataFator.Rows[i].Cells[6].ReadOnly        = true;
                            DataFator.Rows[i].Cells[6].Style.BackColor = Color.LightGray;
                        }
                        row_current = 0;
                        IsEdit      = false;
                        IsInsert    = false;
                    }
                    else
                    {
                        this.Close();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show(this, ex.Message, "Erro Fatores Conversão",
                                  MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #2
0
        private void BtnDelete_Click(object sender, EventArgs e)
        {
            try
            {
                if (IsInsert)
                {
                    for (int i = 0; i < DataIdioma.Rows.Count; i++)
                    {
                        if (DataIdioma.Rows[i].Selected)
                        {
                            UtilObject.DeleteSelected(DataIdioma);
                        }
                    }
                }
                else
                {
                    DialogResult result = MessageBoxEx.Show(DataIdioma, "Deseja excluir registros!", "Confirmação",
                                                            MessageBoxButtons.YesNo, MessageBoxIcon.Information);

                    if (result == DialogResult.Yes)
                    {
                        this.Cursor = Cursors.WaitCursor;
                        IList <Idioma> ids = new List <Idioma>();

                        for (int i = 0; i < DataIdioma.Rows.Count; i++)
                        {
                            if (DataIdioma.Rows[i].Selected)
                            {
                                Idioma idioma = idiomaDAO.FindByLangu(DataIdioma.Rows[i].Cells[1].Value.ToString());
                                if (idioma != null)
                                {
                                    idiomaDAO.Delete(idioma);
                                }
                            }
                        }

                        UtilObject.DeleteSelected(DataIdioma);

                        this.principal.exibirMessage(actionOK, "Idioma(s) excluido com sucesso...", "S");
                        this.Cursor = Cursors.Default;
                    }
                }
            }
            catch (Exception ex)
            {
                this.Cursor = Cursors.Default;
                MessageBoxEx.Show(DataIdioma, ex.Message, "Erro Idiomas",
                                  MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            DataIdioma.Focus();
        }
Example #3
0
        private void BtnDelete_Click(object sender, EventArgs e)
        {
            try
            {
                if (IsInsert)
                {
                    UtilObject.DeleteSelected(DataCatCambio);
                }
                else
                {
                    DialogResult result = MessageBoxEx.Show(DataCatCambio, "Deseja excluir registros!", "Confirmação",
                                                            MessageBoxButtons.YesNo, MessageBoxIcon.Information);

                    if (result == DialogResult.Yes)
                    {
                        this.Cursor = Cursors.WaitCursor;

                        IList <int> indexes = new List <int>();

                        for (int i = 0; i < DataCatCambio.Rows.Count; i++)
                        {
                            if (DataCatCambio.Rows[i].Selected)
                            {
                                CategoriaCambio categoria = catCambioDAO.FindByCategoria(DataCatCambio.Rows[i].Cells[0].Value.ToString());
                                if (categoria != null)
                                {
                                    catCambioDAO.Delete(categoria);
                                }
                            }
                        }
                        UtilObject.DeleteSelected(DataCatCambio);
                        this.Cursor = Cursors.Default;
                    }
                }
            }
            catch (Exception ex)
            {
                this.Cursor = Cursors.Default;
                MessageBoxEx.Show(this, ex.Message, "Erro Categoria cambio",
                                  MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        /// <summary>
        /// Container Class for all the properties for organization.
        /// </summary>
        /// <param name="c"></param>
        public TorqueScriptTemplate(ref dnTorque c)
            {
            m_ts = c;
            _mConsoleobject = new ConsoleObject(ref c);
            _mMathobject = new tMath(ref c);
            	_mUtil = new UtilObject(ref c);
	_mHTTPObject = new HTTPObjectObject(ref c);
	_mTCPObject = new TCPObjectObject(ref c);
	_mDynamicConsoleMethodComponent = new DynamicConsoleMethodComponentObject(ref c);
	_mSimComponent = new SimComponentObject(ref c);
	_mArrayObject = new ArrayObjectObject(ref c);
	_mConsoleLogger = new ConsoleLoggerObject(ref c);
	_mFieldBrushObject = new FieldBrushObjectObject(ref c);
	_mPersistenceManager = new PersistenceManagerObject(ref c);
	_mSimDataBlock = new SimDataBlockObject(ref c);
	_mSimObject = new SimObjectObject(ref c);
	_mSimPersistSet = new SimPersistSetObject(ref c);
	_mSimSet = new SimSetObject(ref c);
	_mSimXMLDocument = new SimXMLDocumentObject(ref c);
	_mFileObject = new FileObjectObject(ref c);
	_mFileStreamObject = new FileStreamObjectObject(ref c);
	_mStreamObject = new StreamObjectObject(ref c);
	_mZipObject = new ZipObjectObject(ref c);
	_mDecalRoad = new DecalRoadObject(ref c);
	_mMeshRoad = new MeshRoadObject(ref c);
	_mRiver = new RiverObject(ref c);
	_mScatterSky = new ScatterSkyObject(ref c);
	_mSkyBox = new SkyBoxObject(ref c);
	_mSun = new SunObject(ref c);
	_mGuiRoadEditorCtrl = new GuiRoadEditorCtrlObject(ref c);
	_mForest = new ForestObject(ref c);
	_mForestWindEmitter = new ForestWindEmitterObject(ref c);
	_mForestBrush = new ForestBrushObject(ref c);
	_mForestBrushTool = new ForestBrushToolObject(ref c);
	_mForestEditorCtrl = new ForestEditorCtrlObject(ref c);
	_mForestSelectionTool = new ForestSelectionToolObject(ref c);
	_mCubemapData = new CubemapDataObject(ref c);
	_mDebugDrawer = new DebugDrawerObject(ref c);
	_mGuiTSCtrl = new GuiTSCtrlObject(ref c);
	_mGuiBitmapButtonCtrl = new GuiBitmapButtonCtrlObject(ref c);
	_mGuiButtonBaseCtrl = new GuiButtonBaseCtrlObject(ref c);
	_mGuiCheckBoxCtrl = new GuiCheckBoxCtrlObject(ref c);
	_mGuiIconButtonCtrl = new GuiIconButtonCtrlObject(ref c);
	_mGuiSwatchButtonCtrl = new GuiSwatchButtonCtrlObject(ref c);
	_mGuiToolboxButtonCtrl = new GuiToolboxButtonCtrlObject(ref c);
	_mGuiAutoScrollCtrl = new GuiAutoScrollCtrlObject(ref c);
	_mGuiDynamicCtrlArrayControl = new GuiDynamicCtrlArrayControlObject(ref c);
	_mGuiFormCtrl = new GuiFormCtrlObject(ref c);
	_mGuiFrameSetCtrl = new GuiFrameSetCtrlObject(ref c);
	_mGuiPaneControl = new GuiPaneControlObject(ref c);
	_mGuiRolloutCtrl = new GuiRolloutCtrlObject(ref c);
	_mGuiScrollCtrl = new GuiScrollCtrlObject(ref c);
	_mGuiStackControl = new GuiStackControlObject(ref c);
	_mGuiTabBookCtrl = new GuiTabBookCtrlObject(ref c);
	_mGuiBitmapCtrl = new GuiBitmapCtrlObject(ref c);
	_mGuiColorPickerCtrl = new GuiColorPickerCtrlObject(ref c);
	_mGuiDirectoryFileListCtrl = new GuiDirectoryFileListCtrlObject(ref c);
	_mGuiFileTreeCtrl = new GuiFileTreeCtrlObject(ref c);
	_mGuiGameListMenuCtrl = new GuiGameListMenuCtrlObject(ref c);
	_mGuiGameListOptionsCtrl = new GuiGameListOptionsCtrlObject(ref c);
	_mGuiGradientCtrl = new GuiGradientCtrlObject(ref c);
	_mGuiListBoxCtrl = new GuiListBoxCtrlObject(ref c);
	_mGuiMaterialCtrl = new GuiMaterialCtrlObject(ref c);
	_mGuiMLTextCtrl = new GuiMLTextCtrlObject(ref c);
	_mGuiPopUpMenuCtrl = new GuiPopUpMenuCtrlObject(ref c);
	_mGuiPopUpMenuCtrlEx = new GuiPopUpMenuCtrlExObject(ref c);
	_mGuiSliderCtrl = new GuiSliderCtrlObject(ref c);
	_mGuiTabPageCtrl = new GuiTabPageCtrlObject(ref c);
	_mGuiTextCtrl = new GuiTextCtrlObject(ref c);
	_mGuiTextEditCtrl = new GuiTextEditCtrlObject(ref c);
	_mGuiTextListCtrl = new GuiTextListCtrlObject(ref c);
	_mGuiTreeViewCtrl = new GuiTreeViewCtrlObject(ref c);
	_mGuiCanvas = new GuiCanvasObject(ref c);
	_mGuiControl = new GuiControlObject(ref c);
	_mGuiControlProfile = new GuiControlProfileObject(ref c);
	_mDbgFileView = new DbgFileViewObject(ref c);
	_mGuiEditCtrl = new GuiEditCtrlObject(ref c);
	_mGuiFilterCtrl = new GuiFilterCtrlObject(ref c);
	_mGuiGraphCtrl = new GuiGraphCtrlObject(ref c);
	_mGuiImageList = new GuiImageListObject(ref c);
	_mGuiInspector = new GuiInspectorObject(ref c);
	_mGuiInspectorTypeFileName = new GuiInspectorTypeFileNameObject(ref c);
	_mGuiInspectorTypeBitMask32 = new GuiInspectorTypeBitMask32Object(ref c);
	_mGuiMenuBar = new GuiMenuBarObject(ref c);
	_mGuiParticleGraphCtrl = new GuiParticleGraphCtrlObject(ref c);
	_mGuiShapeEdPreview = new GuiShapeEdPreviewObject(ref c);
	_mGuiInspectorDynamicField = new GuiInspectorDynamicFieldObject(ref c);
	_mGuiInspectorDynamicGroup = new GuiInspectorDynamicGroupObject(ref c);
	_mGuiInspectorField = new GuiInspectorFieldObject(ref c);
	_mGuiVariableInspector = new GuiVariableInspectorObject(ref c);
	_mGuiMessageVectorCtrl = new GuiMessageVectorCtrlObject(ref c);
	_mGuiProgressBitmapCtrl = new GuiProgressBitmapCtrlObject(ref c);
	_mGuiTickCtrl = new GuiTickCtrlObject(ref c);
	_mGuiTheoraCtrl = new GuiTheoraCtrlObject(ref c);
	_mMessageVector = new MessageVectorObject(ref c);
	_mEditTSCtrl = new EditTSCtrlObject(ref c);
	_mGuiMissionAreaCtrl = new GuiMissionAreaCtrlObject(ref c);
	_mMECreateUndoAction = new MECreateUndoActionObject(ref c);
	_mMEDeleteUndoAction = new MEDeleteUndoActionObject(ref c);
	_mWorldEditor = new WorldEditorObject(ref c);
	_mLangTable = new LangTableObject(ref c);
	_mPathedInterior = new PathedInteriorObject(ref c);
	_mMaterial = new MaterialObject(ref c);
	_mSimResponseCurve = new SimResponseCurveObject(ref c);
	_mMenuBar = new MenuBarObject(ref c);
	_mPopupMenu = new PopupMenuObject(ref c);
	_mFileDialog = new FileDialogObject(ref c);
	_mPostEffect = new PostEffectObject(ref c);
	_mRenderBinManager = new RenderBinManagerObject(ref c);
	_mRenderPassManager = new RenderPassManagerObject(ref c);
	_mRenderPassStateToken = new RenderPassStateTokenObject(ref c);
	_mSceneObject = new SceneObjectObject(ref c);
	_mSFXController = new SFXControllerObject(ref c);
	_mSFXParameter = new SFXParameterObject(ref c);
	_mSFXProfile = new SFXProfileObject(ref c);
	_mSFXSource = new SFXSourceObject(ref c);
	_mActionMap = new ActionMapObject(ref c);
	_mNetConnection = new NetConnectionObject(ref c);
	_mNetObject = new NetObjectObject(ref c);
	_mAIClient = new AIClientObject(ref c);
	_mAIConnection = new AIConnectionObject(ref c);
	_mAIPlayer = new AIPlayerObject(ref c);
	_mCamera = new CameraObject(ref c);
	_mDebris = new DebrisObject(ref c);
	_mGroundPlane = new GroundPlaneObject(ref c);
	_mGuiMaterialPreview = new GuiMaterialPreviewObject(ref c);
	_mGuiObjectView = new GuiObjectViewObject(ref c);
	_mItem = new ItemObject(ref c);
	_mLightBase = new LightBaseObject(ref c);
	_mLightDescription = new LightDescriptionObject(ref c);
	_mLightFlareData = new LightFlareDataObject(ref c);
	_mMissionArea = new MissionAreaObject(ref c);
	_mSpawnSphere = new SpawnSphereObject(ref c);
	_mPathCamera = new PathCameraObject(ref c);
	_mPhysicalZone = new PhysicalZoneObject(ref c);
	_mPlayer = new PlayerObject(ref c);
	_mPortal = new PortalObject(ref c);
	_mProjectile = new ProjectileObject(ref c);
	_mProximityMine = new ProximityMineObject(ref c);
	_mShapeBaseData = new ShapeBaseDataObject(ref c);
	_mShapeBase = new ShapeBaseObject(ref c);
	_mStaticShape = new StaticShapeObject(ref c);
	_mTrigger = new TriggerObject(ref c);
	_mTSStatic = new TSStaticObject(ref c);
	_mZone = new ZoneObject(ref c);
	_mRenderMeshExample = new RenderMeshExampleObject(ref c);
	_mLightning = new LightningObject(ref c);
	_mParticleData = new ParticleDataObject(ref c);
	_mParticleEmitterData = new ParticleEmitterDataObject(ref c);
	_mParticleEmitterNode = new ParticleEmitterNodeObject(ref c);
	_mPrecipitation = new PrecipitationObject(ref c);
	_mGameBase = new GameBaseObject(ref c);
	_mGameConnection = new GameConnectionObject(ref c);
	_mPhysicsDebrisData = new PhysicsDebrisDataObject(ref c);
	_mPhysicsForce = new PhysicsForceObject(ref c);
	_mPhysicsShape = new PhysicsShapeObject(ref c);
	_mAITurretShape = new AITurretShapeObject(ref c);
	_mTurretShape = new TurretShapeObject(ref c);
	_mFlyingVehicle = new FlyingVehicleObject(ref c);
	_mWheeledVehicle = new WheeledVehicleObject(ref c);
	_mTerrainBlock = new TerrainBlockObject(ref c);
	_mSettings = new SettingsObject(ref c);
	_mCompoundUndoAction = new CompoundUndoActionObject(ref c);
	_mUndoManager = new UndoManagerObject(ref c);
	_mUndoAction = new UndoActionObject(ref c);
	_mEventManager = new EventManagerObject(ref c);
	_mMessage = new MessageObject(ref c);
}