Ejemplo n.º 1
0
        void SaveModel()
        {
            MainBar.Focus();
            if (string.IsNullOrEmpty(txtName.Text))
            {
                MessageBox.Show("请填写国家英文名");
                return;
            }

            if (string.IsNullOrEmpty(txtEnName.Text))
            {
                MessageBox.Show("请填写国家英文名");
                return;
            }



            if (model.FID == 0 || model.FID.ToString() == "")
            {
                visaORM.TCountry.AddObject(model);

                visaORM.SaveChanges();
                countryCollection.Add(model);
            }
            else
            {
                visaORM.ObjectStateManager.ChangeObjectState(model, System.Data.EntityState.Modified);
                visaORM.SaveChanges();
            }
            MessageBox.Show("保存成功");
        }
Ejemplo n.º 2
0
        void SaveModel()
        {
            MainBar.Focus();

            if (string.IsNullOrEmpty(txtFullName.Text))
            {
                MessageBox.Show("请填写姓名");
                return;
            }



            model.FModifyDate = DateTime.Now;
            model.FModifyUser = MainContext.UserID;


            if (model.FID == 0 || model.FID.ToString() == "")
            {
                visaORM.TB_AuditPosition.AddObject(model);
                model.FCreateDate = DateTime.Now;
                model.FCreateUser = MainContext.UserID;
                model.FStatus     = true;

                visaORM.SaveChanges();
                vietnamCollection.Add(model);
            }
            else
            {
                visaORM.ObjectStateManager.ChangeObjectState(model, System.Data.EntityState.Modified);
                visaORM.SaveChanges();
            }
            MessageBox.Show("保存成功");
        }
Ejemplo n.º 3
0
        //private static bool draw;
        private static void OnDraw(EventArgs args)
        {
            foreach (var unit in HeroManager.AllHeroes.Where(o => !o.IsMe && o.IsHPBarRendered).Where(o => o.IsAlly ? DrawAllies : DrawEnemies))
            {
                var HPBarPos = new Vector2(unit.HPBarPosition.X, unit.HPBarPosition.Y);
                // Summoner spells
                foreach (var summonerSpell in Summoners)
                {
                    var spell    = unit.Spellbook.GetSpell(summonerSpell);
                    var cooldown = spell.CooldownExpires - Game.Time;
                    var percent  = (cooldown > 0 && Math.Abs(spell.Cooldown) > float.Epsilon) ? 1f - (cooldown / spell.Cooldown) : 1f;
                    var spellPos = unit.GetSummonerOffset(spell.Slot);
                    if (SummonerSpells.ContainsKey(spell.Name) || spell.Name.Contains("smite"))
                    {
                        var sprite = spell.Name.Contains("smite") ? SummonerSpells["summonersmite"] : SummonerSpells[spell.Name];
                        sprite.Color = GetDrawColor(percent);
                        sprite.Draw(new Vector2(spellPos.X, spellPos.Y));
                    }

                    if (DrawText && cooldown > 0)
                    {
                        Text.TextValue = Math.Floor(cooldown).ToString();
                        Text.Position  = new Vector2((int)spellPos.X - 30 + Text.TextValue.Length, (int)spellPos.Y - 1);
                        Text.Draw();
                    }
                }

                // Spell cooldowns
                foreach (var slot in SpellSlots)
                {
                    var spell    = unit.Spellbook.GetSpell(slot);
                    var cooldown = spell.CooldownExpires - Game.Time;
                    var percent  = (cooldown > 0 && Math.Abs(spell.Cooldown) > float.Epsilon) ? 1f - (cooldown / spell.Cooldown) : 1f;
                    var spellPos = unit.GetSpellOffset(slot);

                    Drawing.DrawLine(new Vector2(spellPos.X, spellPos.Y + 2),
                                     new Vector2(spellPos.X + (int)(percent * 22), spellPos.Y + 2),
                                     Mode == 1 ? 5 : 11, spell.IsLearned ? GetDrawColor(percent) : System.Drawing.Color.SlateGray);

                    if (DrawText && spell.IsLearned && cooldown > 0)
                    {
                        Text.TextValue = Math.Floor(cooldown).ToString();
                        Text.Position  = new Vector2((int)spellPos.X + 10 - Text.TextValue.Length * 2, (int)spellPos.Y + 28);
                        Text.Draw();
                    }
                }

                //Cooldowns
                if (Exp)
                {
                    Drawing.DrawLine(new Vector2(HPBarPos.X - OffsetXpX, HPBarPos.Y - OffsetXpY),
                                     new Vector2(HPBarPos.X - OffsetXpX + 104 * (unit.Experience.XPPercentage / 100),
                                                 HPBarPos.Y - OffsetXpY), 3, System.Drawing.Color.DarkOrange);
                }

                // Draw the main hud
                MainBar.Draw(new Vector2((HPBarPos.X + OffsetHudX), (HPBarPos.Y + OffsetHudY + Mode * 2 - (Exp ? 0 : 1))));
            }
        }
Ejemplo n.º 4
0
        public static void OnDrawEnd(EventArgs args)
        {
            if (Settings.TurnOff)
            {
                return;
            }

            foreach (var unit in EntityManager.Heroes.AllHeroes.Where(o => o.IsHPBarRendered && !o.IsMe).Where(o => o.IsAlly ? Settings.DrawAllies : Settings.DrawEnemies))
            {
                var hpBarPos = new Vector2(unit.HPBarPosition.X, unit.HPBarPosition.Y + -1);
                // Summoner spells
                foreach (var summonerSpell in Summoners)
                {
                    var spell    = unit.Spellbook.GetSpell(summonerSpell);
                    var cooldown = spell.CooldownExpires - Game.Time;
                    var spellPos = GetSummonerOffset(unit, spell.Slot);
                    if (SummonerSpells.ContainsKey(spell.Name.ToLower()))
                    {
                        var sprite = SummonerSpells[spell.Name.ToLower()];
                        sprite.Color = cooldown < 0 ? Color.White : Color.FromArgb(255, Color.DimGray);
                        sprite.Draw(new Vector2(spellPos.X + 1, spellPos.Y + 3));
                    }

                    if (!(cooldown > 0))
                    {
                        continue;
                    }

                    Text.TextValue = Math.Floor(cooldown).ToString(CultureInfo.InvariantCulture);
                    Text.Position  = new Vector2((int)spellPos.X - 30 + Text.TextValue.Length, (int)spellPos.Y + 4);
                    Text.Draw();
                }

                // Spells
                foreach (var slot in SpellSlots)
                {
                    var spell    = unit.Spellbook.GetSpell(slot);
                    var cooldown = spell.CooldownExpires - Game.Time;
                    var percent  = (cooldown > 0 && Math.Abs(spell.Cooldown) > float.Epsilon) ? 1f - (cooldown / spell.Cooldown) : 1f;
                    var spellPos = GetSpellOffset(unit, slot);

                    Drawing.DrawLine(new Vector2(spellPos.X, spellPos.Y + 2),
                                     new Vector2(spellPos.X + (int)(percent * 22), spellPos.Y + 2),
                                     5, spell.IsLearned ? GetDrawColor(percent) : Color.SlateGray);

                    if (!spell.IsLearned || !(cooldown > 0))
                    {
                        continue;
                    }

                    Text.TextValue = Math.Floor(cooldown).ToString(CultureInfo.InvariantCulture);
                    Text.Position  = new Vector2((int)spellPos.X + 10 - Text.TextValue.Length * 2, (int)spellPos.Y + 28);
                    Text.Draw();
                }

                // Draw the main hud
                MainBar.Draw(new Vector2(hpBarPos.X + OffsetHudX, hpBarPos.Y + OffsetHudY - 1));
            }
        }
Ejemplo n.º 5
0
        public MainPage()
        {
            InitializeComponent();


            MainBrowser = Browser;

            MainBar.Init(Browser);
        }
Ejemplo n.º 6
0
        public static void ExperienceOverlay()
        {
            MainBar MainBar = SearchControl <MainBar>();

            if (MainBar == null)
            {
                return;
            }

            //if (Value)
            // MainBar.AddWPF<Templates.Mainbar.ExperienceHelperObserver>("ExperienceHelper");
            //else
            // MainBar.Remove("ExperienceHelper");
        }
Ejemplo n.º 7
0
        public static void ToggleExperienceNumbers()
        {
            MainBar MainBar = SearchControl <MainBar>();

            if (MainBar == null)
            {
                return;
            }

            if (Value)
            {
                MainBar.Add <Templates.ExperienceItems>("ShowNumbers");
            }
            else
            {
                MainBar.Remove("ShowNumbers");
            }
        }
Ejemplo n.º 8
0
        public static void ToggleSkillCooldown()
        {
            MainBar MainBar = SearchControl <MainBar>();

            if (MainBar == null)
            {
                return;
            }

            if (Value)
            {
                MainBar.Add <Skillbar>("Skill");
            }
            else
            {
                MainBar.Remove("Skill");
            }
        }
Ejemplo n.º 9
0
    void Awake()
    {
        if (instance == null)

            //if not, set instance to this
            instance = this;

        //If instance already exists and it's not this:
        else if (instance != this)

            //Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a GameManager.
            Destroy(gameObject);

        //Sets this to not be destroyed when reloading scene
        DontDestroyOnLoad(gameObject);

        Init();
    }
Ejemplo n.º 10
0
        public static void ToggleBuffs()
        {
            MainBar MainBar = SearchControl <MainBar>();

            if (MainBar == null)
            {
                return;
            }

            if (Value)
            {
                MainBar.Add <BuffsControl>("Buffs");
            }

            else
            {
                // Buffs.Reset();
                MainBar.Remove("Buffs");
            }
        }
Ejemplo n.º 11
0
    void Awake()
    {
        if (instance == null)
        {
            //if not, set instance to this
            instance = this;
        }

        //If instance already exists and it's not this:
        else if (instance != this)
        {
            //Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a GameManager.
            Destroy(gameObject);
        }

        //Sets this to not be destroyed when reloading scene
        DontDestroyOnLoad(gameObject);


        Init();
    }
 public MainBarSettingsViewModel(IModuleController host, MainBar mainBar)
 {
     this.host    = host;
     this.mainBar = mainBar;
 }
Ejemplo n.º 13
0
        //private static bool draw;
        private static void OnDraw(EventArgs args)
        {
            foreach (var unit in EntityManager.Heroes.AllHeroes.Where(o => o.IsHPBarRendered && !o.IsMe).Where(o => o.IsAlly ? DrawAllies : DrawEnemies))
            {
                var hpBarPos = new Vector2(unit.HPBarPosition.X, unit.HPBarPosition.Y + (Mode == 1 ? -1 : 0));
                // Summoner spells
                foreach (var summonerSpell in Summoners)
                {
                    var spell    = unit.Spellbook.GetSpell(summonerSpell);
                    var cooldown = spell.CooldownExpires - Game.Time;
                    var spellPos = unit.GetSummonerOffset(spell.Slot);
                    if (SummonerSpells.ContainsKey(spell.Name.ToLower()))
                    {
                        var sprite = SummonerSpells[spell.Name.ToLower()];
                        sprite.Color = cooldown < 0 ? Color.White : Color.FromArgb(255, Color.Red);
                        sprite.Draw(new Vector2(spellPos.X, spellPos.Y));
                    }

                    if (DrawText && cooldown > 0)
                    {
                        Text.TextValue = Math.Floor(cooldown).ToString(CultureInfo.InvariantCulture);
                        Text.Position  = new Vector2((int)spellPos.X - 30 + Text.TextValue.Length, (int)spellPos.Y - 1);
                        Text.Draw();
                    }
                }

                // Spell cooldowns
                foreach (var slot in SpellSlots)
                {
                    var spell    = unit.Spellbook.GetSpell(slot);
                    var cooldown = spell.CooldownExpires - Game.Time;
                    var percent  = (cooldown > 0 && Math.Abs(spell.Cooldown) > float.Epsilon) ? 1f - (cooldown / spell.Cooldown) : 1f;
                    var spellPos = unit.GetSpellOffset(slot);

                    Drawing.DrawLine(new Vector2(spellPos.X, spellPos.Y + 2),
                                     new Vector2(spellPos.X + (int)(percent * 22), spellPos.Y + 2),
                                     Mode == 1 ? 5 : 11, spell.IsLearned ? GetDrawColor(percent) : Color.SlateGray);

                    if (DrawText && spell.IsLearned && cooldown > 0)
                    {
                        Text.TextValue = Math.Floor(cooldown).ToString(CultureInfo.InvariantCulture);
                        Text.Position  = new Vector2((int)spellPos.X + 10 - Text.TextValue.Length * 2, (int)spellPos.Y + 28);
                        Text.Draw();
                    }
                }

                //Cooldowns
                if (Exp)
                {
                    Drawing.DrawLine(new Vector2(hpBarPos.X - OffsetXpX, hpBarPos.Y - OffsetXpY),
                                     new Vector2(hpBarPos.X - OffsetXpX + 104,
                                                 hpBarPos.Y - OffsetXpY), 3, Color.DarkGray);
                    Drawing.DrawLine(new Vector2(hpBarPos.X - OffsetXpX, hpBarPos.Y - OffsetXpY),
                                     new Vector2(hpBarPos.X - OffsetXpX + 104 * (unit.Experience.XPPercentage / 100),
                                                 hpBarPos.Y - OffsetXpY), 3, Color.DarkOrange);
                }

                // Draw the main hud
                MainBar.Draw(new Vector2((hpBarPos.X + OffsetHudX), (hpBarPos.Y + OffsetHudY - (Exp ? 0 : 1))));
            }
        }
Ejemplo n.º 14
0
        private void UserSave()
        {
            MainBar.Focus();



            if (txtPassConfirm.Text != txtPassword.Text)
            {
                MessageBox.Show("两次输入的密码不一致,保存失败。");
                return;
            }

            if (model.FUserName == null || model.FCompanyName == null)
            {
                MessageBox.Show("必须录入用户名和公司。");
                return;
            }



            if (model.FID == 0 || model.FID.ToString() == "")
            {
                var tempObj = visaORM.User.FirstOrDefault(u => u.FUserName == model.FUserName);
                {
                    if (tempObj != null)
                    {
                        MessageBox.Show("该用户名已经存在,请使用其他用户名");
                        return;
                    }
                }

                visaORM.User.AddObject(model);
                model.FIsDelete = false;


                visaORM.SaveChanges();
                NowUserId = model.FID;

                userList.Add(model);

                //getDefaultModel = 0;

                InitData();
            }
            else
            {
                if (visaORM.ObjectStateManager.GetObjectStateEntries(EntityState.Modified).Count() == 0)
                {
                    visaORM.User.Attach(model);
                }
                visaORM.ObjectStateManager.ChangeObjectState(model, EntityState.Modified);
                visaORM.SaveChanges();
                NowUserId = model.FID;
            }


            var list = from m in visaORM.TB_Menu
                       join ur in visaORM.TB_UserRights
                       on m.FID equals ur.FMenuID
                       where m.FType == 1 && ur.FUserID == model.FID
                       select ur;


            foreach (TB_UserRights urObj in list)
            {
                visaORM.DeleteObject(urObj);
            }

            selectedMenu.Clear();

            foreach (var nodeObjLevel1 in MenuTree.View.Nodes)
            {
                foreach (var nodeObjLevel2 in nodeObjLevel1.Nodes)
                {
                    foreach (var nodeObjLevel3 in nodeObjLevel2.Nodes)
                    {
                        if (nodeObjLevel3.IsChecked == true)
                        {
                            selectedMenu.Add(nodeObjLevel3.Content as TB_Menu);
                        }
                    }
                    if (nodeObjLevel2.IsChecked == true)
                    {
                        selectedMenu.Add(nodeObjLevel2.Content as TB_Menu);
                    }
                }
                if (nodeObjLevel1.IsChecked == true)
                {
                    selectedMenu.Add(nodeObjLevel1.Content as TB_Menu);
                }
            }


            TB_UserRights urModel;

            foreach (var menuObj in selectedMenu)
            {
                urModel             = new TB_UserRights();
                urModel.FUserID     = model.FID;
                urModel.FMenuID     = menuObj.FID;
                urModel.FCreateDate = DateTime.Now;
                urModel.FCreateUser = MainContext.UserID;
                urModel.FModifyDate = DateTime.Now;
                urModel.FModifyUser = MainContext.UserID;
                urModel.FStatus     = true;

                visaORM.TB_UserRights.AddObject(urModel);
            }

            TB_UserRights outMenuObj;

            if (CreateURModel(cbTable2Admin, out outMenuObj) == true)
            {
                if (outMenuObj != null)
                {
                    visaORM.TB_UserRights.AddObject(outMenuObj);
                }
            }
            else
            {
                if (outMenuObj != null)
                {
                    visaORM.DeleteObject(outMenuObj);
                }
            }

            visaORM.SaveChanges();


            InitData();

            MessageBox.Show("保存成功");
        }
Ejemplo n.º 15
0
        void auditList()
        {
            MainBar.Focus();

            if (cbSentVisa.SelectedIndex == -1)
            {
                MessageBox.Show("请选择需要审核的名单");
                return;
            }



            //string SentNo = cbSentVisa.SelectedItem.ToString();

            //var modelCollection = from c in visaORM.Customer
            //                     join s in visaORM.SendInfo
            //                     on c.FID equals s.FCustomerID
            //                     where s.FSendNo == SentNo
            //                     select c;



            string todayStringShort = DateTime.Now.ToString("yyMMdd");
            string todayStringAll   = DateTime.Now.ToShortDateString();

            int i = 0;

            foreach (var model in sendCollection)
            {
                sp_SelectTable3ForExcel_Result rowObj = gridMain.GetRow(i) as sp_SelectTable3ForExcel_Result;
                i++;
                if (rowObj.SelectChk == false)
                {
                    continue;
                }

                Customer cModel = visaORM.Customer.FirstOrDefault(c => c.FID == model.QID);
                if (cModel != null)
                {
                    visaORM.Customer.Attach(cModel);
                    cModel.FSysChk     = true;
                    cModel.FSysChkDate = DateTime.Now;
                    cModel.FSysChkUser = MainContext.UserID;

                    visaORM.ObjectStateManager.ChangeObjectState(cModel, System.Data.EntityState.Modified);

                    var modelSend = visaORM.SendInfo.FirstOrDefault(s => s.FCustomerID == cModel.FID);

                    if (modelSend != null)
                    {
                        modelSend.FModifyDate = DateTime.Now;
                        modelSend.FModifyUser = MainContext.UserID;

                        modelSend.FSysChk     = true;
                        modelSend.FSysChkDate = cModel.FSysChkDate;
                        modelSend.FSysChkUser = MainContext.UserID;
                        visaORM.ObjectStateManager.ChangeObjectState(modelSend, System.Data.EntityState.Modified);
                    }
                }
            }
            visaORM.SaveChanges();

            MessageBox.Show("审核成功");

            InitData();
        }