コード例 #1
0
ファイル: MainWindow.cs プロジェクト: dgu123/crown
    public void open_unit(string file_name)
    {
        uf = new UnitEditor.UnitForm(file_name);
        nb.AppendPage(uf.instance, new Label(file_name));

        ShowAll();
    }
コード例 #2
0
ファイル: MainWindow.cs プロジェクト: Narinyir/crown-tools
    public void open_unit(string file_name)
    {
        uf = new UnitEditor.UnitForm (file_name);
        nb.AppendPage (uf.instance, new Label (file_name));

        ShowAll ();
    }
コード例 #3
0
ファイル: UnitCommands.cs プロジェクト: anoozz/nbooks
		public override void Run()
		{
			UnitForm form = new UnitForm(unit);
			IUnitRepository dao = new NHibernateUnitRepository();
			form.UnitSave += delegate(object sender, UnitEventArgs e) { 
				dao.SaveOrUpdate(e.Unit);
				form.Close();
			};
			WorkbenchSingleton.AddChild(form, "Edit Unit");
		}
コード例 #4
0
        private void btnUnitManager_Click(object sender, EventArgs e)
        {
            EnabledRefreshPage = true;

            if (UnitForm == null || UnitForm.IsDisposed)
            {
                UnitForm = new UnitExtSelectForm();
            }
            UnitForm.WindowState = FormWindowState.Normal;
            UnitForm.Show();
            UnitForm.BringToFront();
        }
コード例 #5
0
        public ActionResult Edit(UnitForm form)
        {
            Debug.WriteLine(string.Format("POST: Ship Controller: Edit - unitID={0}", form.ID));
            var game = GameState.Game;

            var unit = game.GameStatistics.UnitsRaw.Find(x => x.id == form.ID);

            if (unit.game_id == null || unit.game_id != game.Info.id)
            {
                return(RedirectToRoute("game", new { gameID = game.Info.id }));
            }

            unit.unit_category_id = (form.SelectedCategoryID == -1) ? null : form.SelectedCategoryID;

            unit.name            = form.Name;
            unit.unit_type       = UnitTypes.GetUnitTypesCheckboxes().Where(x => x.ID == form.SelectedUnitTypeID).First().Name;
            unit.description     = form.Description;
            unit.rp_cost         = form.RPCost;
            unit.number_to_build = form.NumberToBuild;

            unit.can_embark = form.CanEmbark;
            unit.can_attack_ground_units = form.CanAttackGroundUnits;
            unit.can_attack_boats        = form.CanAttackBoats;
            unit.can_attack_planes       = form.CanAttackPlanes;
            unit.can_attack_spaceships   = form.CanAttackSpaceships;

            unit.embarking_slots = form.EmbarkingSlots;
            unit.negate_damage   = form.NegateDamage;

            unit.base_health         = form.BaseHealth;
            unit.base_regeneration   = form.BaseRegeneration;
            unit.base_attack         = form.BaseAttack;
            unit.base_special_attack = form.BaseSpecialAttack;
            unit.base_agility        = form.BaseAgility;

            unit.gmnotes = form.GMNotes;
            Database.Session.Update(unit);

            Database.Session.Flush();
            return(RedirectToRoute("Statistics"));
        }
コード例 #6
0
ファイル: FormMain.cs プロジェクト: securitylong100/LONG_MAIN
        private void Unit_btn_Click(object sender, EventArgs e)
        {
            UnitForm unitform = new  UnitForm();

            unitform.ShowDialog();
        }
コード例 #7
0
ファイル: MainForm.cs プロジェクト: TotskyA/WareHouse
        private void единицыИзмеренияToolStripMenuItem_Click(object sender, EventArgs e)
        {
            UnitForm frm = new UnitForm(deletion_allowed);

            frm.ShowDialog();
        }
コード例 #8
0
ファイル: Home.cs プロジェクト: EJGamer21/SistemaCompras
        private void InitForm(string mode)
        {
            Form            newForm;
            DataGridViewRow selectedRow = new DataGridViewRow();

            if (mode.Equals("Edit"))
            {
                try
                {
                    selectedRow = DgvGeneric.SelectedRows[0];
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                    MessageBox.Show(
                        text: "Debes seleccionar una fila",
                        caption: "Error",
                        buttons: MessageBoxButtons.OK,
                        icon: MessageBoxIcon.Error);
                    return;
                }
            }

            switch (activeGrid)
            {
            case 0:
                newForm = new EmployeeForm(mode, selectedRow);
                newForm.ShowDialog();
                break;

            case 1:
                newForm = new DepartmentForm(mode, selectedRow);
                newForm.ShowDialog();
                break;

            case 2:
                newForm = new ItemForm(mode, selectedRow);
                newForm.ShowDialog();
                break;

            case 3:
                newForm = new BrandForm(mode, selectedRow);
                newForm.ShowDialog();
                break;

            case 4:
                newForm = new UnitForm(mode, selectedRow);
                newForm.ShowDialog();
                break;

            case 5:
                newForm = new ProviderForm(mode, selectedRow);
                newForm.ShowDialog();
                break;

            case 6:
                newForm = new ItemRequestForm(mode, selectedRow);
                newForm.ShowDialog();
                break;

            case 7:
                newForm = new PurchaseOrderForm(mode, selectedRow);
                newForm.ShowDialog();
                break;

            case 8:
                newForm = new UserForm(mode, selectedRow);
                newForm.ShowDialog();
                break;
            }
        }
コード例 #9
0
        private void unitBrowserBtn_Click(object sender, EventArgs e)
        {
            UnitForm unitForm = new UnitForm(this);

            unitForm.Show();
        }