private void button_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (txt_Name.Text == "")
         {
             MessageBox.Show("لطفا نام بخش را کامل کنید");
             return;
         }
         SystemPart sp = new SystemPart();
         sp.SystemPartName    = txt_Name.Text.Trim();
         sp.SystemPartDetaile = txt_Desc.Text.Trim();
         sp.SystemPartLevel   = Get_SystePartID;
         database.SystemParts.Add(sp);
         database.SaveChanges();
         MessageBox.Show("بخش جدید با موفقیت اضافه شد", "موفقیت", MessageBoxButton.OK, MessageBoxImage.Information);
     }
     catch
     {
         MessageBox.Show("در ثبت اطلاعات مشکلی به وجود آمده است", "خطا", MessageBoxButton.OK, MessageBoxImage.Error);
     }
     finally {
         this.Close();
     }
 }
Ejemplo n.º 2
0
        private void btn_createjob_Click(object sender, EventArgs e)
        {
            SystemPart s = new SystemPart();

            s.SystemPartName     = txt_name.Text.Trim();
            s.SystemPartDeatiles = txt_deatiles.Text.Trim();
            s.SystemPartLevel    = this.GetSystemPartid;
            DBCommon.Context.SystemPart.Add(s);
            DBCommon.Context.SaveChanges();
            MessageBox.Show("بخش جدید با موفقیت اضافه شد", "موفقیت", MessageBoxButtons.OK, MessageBoxIcon.Information);
            this.Close();
        }
Ejemplo n.º 3
0
    /// <summary>
    /// 注册部件
    /// </summary>
    protected virtual void registParts()
    {
        _list = new PlayerBasePart[17];
        int i = 0;

        system = new SystemPart();
        system.setMe(this);
        _list[i++] = system;

        func = new FuncPart();
        func.setMe(this);
        _list[i++] = func;

        activity = new ActivityPart();
        activity.setMe(this);
        _list[i++] = activity;

        role = new RolePart();
        role.setMe(this);
        _list[i++] = role;

        scene = new ScenePart();
        scene.setMe(this);
        _list[i++] = scene;

        character = new CharacterPart();
        character.setMe(this);
        _list[i++] = character;

        social = new SocialPart();
        social.setMe(this);
        _list[i++] = social;

        bag = new BagPart();
        bag.setMe(this);
        _list[i++] = bag;

        mail = new MailPart();
        mail.setMe(this);
        _list[i++] = mail;

        quest = new QuestPart();
        quest.setMe(this);
        _list[i++] = quest;

        guide = new GuidePart();
        guide.setMe(this);
        _list[i++] = guide;

        friend = new FriendPart();
        friend.setMe(this);
        _list[i++] = friend;

        equip = new EquipPart();
        equip.setMe(this);
        _list[i++] = equip;

        team = new TeamPart();
        team.setMe(this);
        _list[i++] = team;

        union = new UnionPart();
        union.setMe(this);
        _list[i++] = union;

        achievement = new AchievementPart();
        achievement.setMe(this);
        _list[i++] = achievement;

        pet = new PetPart();
        pet.setMe(this);
        _list[i++] = pet;
    }
Ejemplo n.º 4
0
    /// <summary>
    /// 注册部件
    /// </summary>
    protected override void registParts()
    {
        _list = new PlayerBasePart[14];
        int i = 0;

        system = new SystemPart();
        system.setMe(this);
        _list[i++] = system;

        gfunc = new GFuncPart();
        func  = gfunc;
        gfunc.setMe(this);
        _list[i++] = gfunc;

        activity = new ActivityPart();
        activity.setMe(this);
        _list[i++] = activity;

        grole = new GRolePart();
        role  = grole;
        grole.setMe(this);
        _list[i++] = grole;

        gscene = new GScenePart();
        scene  = gscene;
        gscene.setMe(this);
        _list[i++] = gscene;

        gcharacter = new GCharacterPart();
        character  = gcharacter;
        gcharacter.setMe(this);
        _list[i++] = gcharacter;

        social = new SocialPart();
        social.setMe(this);
        _list[i++] = social;

        gbag = new GBagPart();
        bag  = gbag;
        gbag.setMe(this);
        _list[i++] = gbag;

        mail = new MailPart();
        mail.setMe(this);
        _list[i++] = mail;

        quest = new QuestPart();
        quest.setMe(this);
        _list[i++] = quest;

        guide = new GuidePart();
        guide.setMe(this);
        _list[i++] = guide;

        gfriend = new GFriendPart();
        friend  = gfriend;
        gfriend.setMe(this);
        _list[i++] = gfriend;

        gunion = new GUnionPart();
        union  = gunion;
        gunion.setMe(this);
        _list[i++] = gunion;

        gteam = new GTeamPart();
        team  = gteam;
        gteam.setMe(this);
        _list[i++] = gteam;
    }