Ejemplo n.º 1
0
    void click()
    {
        model = GameObject.Find("ModelCard");
        ModelCard modelScr = model.GetComponent <ModelCard>();

        modelScr.removeElem(idToRemove, projectName, callDispatcher);
    }
    public void applyForPhases(string json)
    {
        Dictionary <int, Dictionary <string, string> > allRessource = new Dictionary <int, Dictionary <string, string> >();
        List <object> respList         = DeserializeJson <List <object> >(json);
        Dropdown      dropdownEventIDs = PhasesDropDown.GetComponent <Dropdown>();
        int           i = 0;

        foreach (object obj in respList)
        {
            Dictionary <string, object> resp          = DeserializeJson <Dictionary <string, object> >(obj.ToString());
            Dictionary <string, string> ressourceData = new Dictionary <string, string>();

            ressourceData.Add("name", resp["name"].ToString());
            ressourceData.Add("id", resp["id"].ToString());
            allRessource.Add(i, ressourceData);
            i++;
        }

        foreach (KeyValuePair <int, Dictionary <string, string> > res in allRessource)
        {
            phases.Add(res.Value["name"], res.Value["id"]);
        }
        foreach (KeyValuePair <string, string> p in phases)
        {
            dropdownEventIDs.AddOptions(new List <string> {
                p.Key
            });
        }
        GameObject modelCard;

        modelCard = GameObject.Find("ModelCard");
        ModelCard modelCardScr = modelCard.GetComponent <ModelCard>();

        modelCardScr.find(cardId, projectName, applyOnCard);
    }
Ejemplo n.º 3
0
    public override void Init()
    {
        base.Init();
        this.Create(Config.SCENE_SHIP, true, null);
        redPosX   = 155;
        redPosY   = 0;
        cardModel = ModelManager.inst.cardModel;
        InitTopBar(new string[] { Tools.GetMessageById("24109"), Tools.GetMessageById("24110") });
        c1    = this.GetController("c1");
        tabC1 = c1;
        c1.onChanged.Add(Tab_Change);
        GButton btn_esc = this.GetChild("n1").asButton;

        red       = this.GetChild("n12").asGroup;
        redTxt    = this.GetChild("n11").asTextField;
        red.alpha = 0;
//		tab = this.GetChild ("barClip") as ComTabEffect;
        btn_esc.onClick.Add(onCloseHandler);
//		tab.SetCount (2, 3);
        Tab_Change();
        this.AddGlobalListener(MainEvent.COLOR_CHANGE, OnFunction);
        this.AddGlobalListener(MainEvent.CARD_LEVELUP, OnlevelUp);
        this.AddGlobalListener(MainEvent.JUMP_COINGOLDEXPGET, OnDongHuaFun);
        this.AddGlobalListener(MainEvent.LEVEL_UP_USER, OnUserLevelup);
        OnFunction();
        oldRednum = (int)ModelManager.inst.userModel.records [Config.ASSET_REDBAGCOIN] < 0 ? 0 : (int)ModelManager.inst.userModel.records [Config.ASSET_REDBAGCOIN];
    }
Ejemplo n.º 4
0
        //const string connString = @"SERVER = TRANSFORMER2\SQLEXPRESS2016; DATABASE = ISLAMBANK; Trusted_Connection = true ";
        //const string connString = @"SERVER = KUBO\SQLEXPRESS; DATABASE = ISLAMBANK; Trusted_Connection = true ";
        public bool AddCard(ModelCard modelCard, int accountId)
        {
            try
            {
                using (SqlConnection connection = new SqlConnection(connString))
                {
                    connection.Open();
                    using (SqlCommand command = connection.CreateCommand())
                    {
                        string     sqlQuery   = @"insert into [CARD] (Card_Number,pin,Validity_from, Validity_until,Account_id) 
                                        values(@cardNumber, @pin, @validty_from, @validty_until, @account_id)
                                            ";
                        SqlCommand commandAdd = new SqlCommand(sqlQuery, connection);
                        commandAdd.Parameters.Add("@cardNumber", SqlDbType.NVarChar).Value    = modelCard.CardNumber;
                        commandAdd.Parameters.Add("@pin", SqlDbType.Char).Value               = modelCard.Pin;
                        commandAdd.Parameters.Add("@validty_from", SqlDbType.DateTime).Value  = modelCard.Validity_from;
                        commandAdd.Parameters.Add("@validty_until", SqlDbType.DateTime).Value = modelCard.Validity_until;
                        commandAdd.Parameters.Add("@account_id", SqlDbType.Int).Value         = accountId;

                        if (commandAdd.ExecuteNonQuery() > 0)
                        {
                            return(true);
                        }
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(false);
        }
Ejemplo n.º 5
0
 private void btnSaveCard_Click(object sender, EventArgs e)
 {
     newCard = new LogicCard().NewCard();
     //MessageBox.Show(newCard.Validity_from.ToString() + ' '+ newCard.Validity_until.ToString() + ' '+ newCard.CardNumber.ToString());
     newCard.Pin = (txtPin.Text);
     logicCard.CreateCard(newCard, accountId);
     Close();
 }
Ejemplo n.º 6
0
    void click()
    {
        model = GameObject.Find("ModelCard");
        ModelCard modelScr = model.GetComponent <ModelCard>();
        string    name     = inputName.GetComponent <TMP_InputField>().text;
        string    desc     = inputDesc.GetComponent <TMP_InputField>().text;

        modelScr.addCollections(name, desc, projectId.ToString(), projectName, applyInServerResponse);
    }
Ejemplo n.º 7
0
    void click()
    {
        ButtonListener but      = gameObject.GetComponent <ButtonListener>();
        ModelCard      ModelScr = Model.GetComponent <ModelCard>();

        //  ModelScr.addCollections("ENTER new card name", "ENTER new description", projectId.ToString());
        //  but.addParam("id", (ModelScr.getNbElement()).ToString());
        but.addParam("project_id", projectId.ToString());
        but.addParam("card_id", idToModify.ToString());
        but.addParam("project_name", projectName);
        but.SendToDispatch();
    }
    public override void apply()
    {
        GameObject model;

        projectId = int.Parse(args["project_id"]);
        model     = GameObject.Find("ModelCard");
        ModelCard modelScript = model.GetComponent <ModelCard>();

        modelScript.getAll(projectId.ToString(), applyInServerResponse);

        overviewButton.GetComponent <OverviewButton>().setCurrentProjectId(projectId);
        createCardButton.GetComponent <CreateCardButton>().setProjectId(projectId);
    }
Ejemplo n.º 9
0
        private void AddModel_Click(object sender, RoutedEventArgs e)
        {
            var c = new ModelCard();

            ModelCards.Add(c);
            c.Show();
            c.OnClosedCalled += (s, args) =>
            {
                ModelCard card = (ModelCard)s;
                ModelCards.Remove(card);
                card.Close();
            };
        }
Ejemplo n.º 10
0
 public void Register()
 {
     gameModel  = new ModelGame();
     alertModel = new ModelAlert();
     userModel  = new ModelUser();
     roleModel  = new ModelRole();
     guildModel = new ModelGuild();
     chatModel  = new ModelChat();
     cardModel  = new ModelCard();
     mailModel  = new ModelMail();
     fightModel = new ModelFight();
     rankModel  = new ModelRank();
     guideModel = new ModelGuide();
     shareModel = new ModelShare();
 }
Ejemplo n.º 11
0
    public override void Init()
    {
        base.Init();
        this.Create(Config.VIEW_COMSHIPINFO);

        sim           = (Dictionary <string, object>)(DataManager.inst.systemSimple ["card_attr_info"]);
        cardModel     = ModelManager.inst.cardModel;
        tips          = (object[])cardModel.shipinfo_cardData [cardModel.shipinfo_callinID];
        card          = cardModel.shipinfo_cvo;
        card.cardData = cardModel.shipinfo_cardData;
        cardModel.SetData();
        title = this.GetChild("n4").asTextField;
        list  = this.GetChild("n1").asList;

        title.text              = Tools.GetMessageById(cardModel.shipinfo_title);
        list.itemRenderer       = onListRander;
        list.numItems           = tips.Length;
        list.foldInvisibleItems = true;
        list.ResizeToFit(tips.Length);
        group.height = list.height + 80;
        this.height  = list.height + 80;
    }
Ejemplo n.º 12
0
    public override void apply()
    {
        Model = GameObject.Find("Model");

        ModelRessources = GameObject.Find("ModelRessource");

        modelPhases = GameObject.Find("ModelPhases");
        ModelCards  = GameObject.Find("ModelCard");

        foreach (KeyValuePair <string, string> arg in args)
        {
            id = int.Parse(args["id"]);
        }
        projectName = args["project_name"];
        Model       = GameObject.Find("Model");
        newResBut.GetComponent <CreateRessourceButton>().setProjectId(id);
        newResBut.GetComponent <CreateRessourceButton>().setProjectName(projectName);
        createPhaseBut.GetComponent <CreateRessourceButton>().setProjectId(id);
        createPhaseBut.GetComponent <CreateRessourceButton>().setProjectName(projectName);
        updateProj.GetComponent <ConfirmModifyButton>().setIdToModify(id);
        updateProj.GetComponent <ConfirmModifyButton>().setProjectName(projectName);
        createCardBut.GetComponent <CreateCardButton>().setProjectId(id);
        createCardBut.GetComponent <CreateCardButton>().setProjectName(projectName);
        createRuleBut.GetComponent <CreateCardButton>().setProjectName(projectName);
        ModelTest ModelScript = Model.GetComponent <ModelTest>();

        ModelScript.find(projectName, applyInServerResponse);
        ModelCard modelCardScript = ModelCards.GetComponent <ModelCard>();

        modelCardScript.getAll(projectName, applyForCards);
        ModelRessource ModelRessourceScr = ModelRessources.GetComponent <ModelRessource>();

        ModelRessourceScr.getAll(projectName, applyForRessource);
        ModelPhases modelPhasesScr = modelPhases.GetComponent <ModelPhases>();

        modelPhasesScr.getAll(projectName, applyForPhases);
    }
Ejemplo n.º 13
0
    void click()
    {
        model = GameObject.Find("ModelCard");
        ModelCard modelScr = model.GetComponent <ModelCard>();
        string    name     = inputName.GetComponent <TMP_InputField>().text;
        string    desc     = inputDesc.GetComponent <TMP_InputField>().text;

        if (name.Equals(""))
        {
            name = Guid.NewGuid().ToString();
        }
        if (desc.Equals(""))
        {
            desc = Guid.NewGuid().ToString();
        }
        if (idToModify == -1)
        {
            modelScr.addCollections(name, desc, projectId, projectName, sendList, parent.GetComponent <ModifyCardController>().getSelectedPhases());
        }
        else
        {
            modelScr.updateField(idToModify.ToString(), name, desc, projectId, projectName, sendList, parent.GetComponent <ModifyVisualCardController>().getSelectedPhases());
        }
    }
Ejemplo n.º 14
0
        public ModelCard GenerateNewCard()
        {
            string CardNumberCreate()
            {
                StringBuilder number = new StringBuilder();
                Random        r      = new Random();

                number.Append($"{r.Next(1, 9)}");
                while (number.Length < 16)
                {
                    number.Append($"{r.Next(0, 9)}");
                }
                return(number.ToString());
            }

            ModelCard newCard = new ModelCard()
            {
                CardNumber     = CardNumberCreate(),
                Validity_from  = DateTime.Now,
                Validity_until = DateTime.Now.AddYears(4)
            };

            return(newCard);
        }
Ejemplo n.º 15
0
    private void OnFunction(MainEvent e = null)
    {
        ModelCard cardModel = ModelManager.inst.cardModel;
        int       num       = cardModel.GetNewCardNum();
        int       num2      = cardModel.GetLevelUpCardNum();
        int       num3      = ModelManager.inst.cardModel.GetShipNum();

        if (c1.selectedIndex == 0)
        {
            ModelManager.inst.userModel.Remove_Notice(this.GetChild("bar0").asCom);
            if (num3 != 0)
            {
                ModelManager.inst.userModel.Add_Notice(this.GetChild("bar1").asCom, new Vector2(redPosX, redPosY), num3);
            }
            else
            {
                ModelManager.inst.userModel.Remove_Notice(this.GetChild("bar1").asCom);
            }
        }
        else
        {
            ModelManager.inst.userModel.Remove_Notice(this.GetChild("bar1").asCom);
            if (num != 0)
            {
                ModelManager.inst.userModel.Add_Notice(this.GetChild("bar0").asCom, new Vector2(redPosX, redPosY), num);
            }
            else if (num2 != 0)
            {
                ModelManager.inst.userModel.Add_Notice(this.GetChild("bar0").asCom, new Vector2(redPosX, redPosY), num2, true);
            }
            else
            {
                ModelManager.inst.userModel.Remove_Notice(this.GetChild("bar0").asCom);
            }
        }
    }
Ejemplo n.º 16
0
    public override void Init()
    {
        base.Init();
        this.Create(Config.VIEW_ITEMSHIP);
        cardModel = ModelManager.inst.cardModel;
        userModel = ModelManager.inst.userModel;
//		this.x = cardModel.v2.x;
        this.y = cardModel.v2.y;
//		Log.debug ("xxx-" + this.x + " yyy-" + this.y);
//		return;
//		view.x = 103;
//		view.y = 40;
//		view.width = ModelManager.inst.gameModel.width;
//		isFirst = true;
        cardModel.SetData();
        cfg            = DataManager.inst.systemSimple;
        userCard       = ModelManager.inst.userModel.card;
        oldred         = (int)userModel.records [Config.ASSET_REDBAGCOIN] < 0 ? 0 : (int)userModel.records [Config.ASSET_REDBAGCOIN];
        list           = this.GetChild("n28").asList; //Tools.FindChild<L_List> (this.thiss, "L_List");
        list1          = this.GetChild("n23").asList; //Tools.FindChild<L_List> (this.thiss, "L_ListZu");
        list2          = this.GetChild("n31").asList; //Tools.FindChild<L_List> (this.thiss, "L_List2");
        L_Label        = this.GetChild("n25").asTextField;
        l_mycardNum    = this.GetChild("n16").asTextField;
        c_card         = this.GetChild("n24") as ComCard;
        btn_clear      = this.GetChild("n26").asButton;
        btn_clear.text = Tools.GetMessageById("24126");
        btn_clear.onClick.Add(OnClearChangeHandler);
//		gui1 = this.GetChild ("n30").asImage;
//		gui0 = view.GetChild ("n29").asImage;
        this.GetChild("n25").asTextField.text = Tools.GetMessageById("24124");
        g_have    = this.GetChild("n27").asGroup;
        c1        = this.GetController("c1");
        cardinfo  = this.GetChild("n40").asGroup;
        cardGroup = this.GetChild("n47").asGroup;

        c1.onChanged.Add(Tab_Change);
        c1.onChangeTip.Add(Tab_ChangeTip);
        canChangeGroup = userModel.GetUnlcok(Config.UNLOCK_CARDGROUP, this.GetChild("n3").asButton);
        userModel.GetUnlcok(Config.UNLOCK_CARDGROUP, this.GetChild("n4").asButton);
        userModel.GetUnlcok(Config.UNLOCK_CARDGROUP, this.GetChild("n5").asButton);

        Dictionary <string, object> cfg1 = (Dictionary <string, object>)DataManager.inst.systemSimple ["unlock"];

        object[] i = (object[])cfg1 [Config.UNLOCK_CARDGROUP];
        msg = Tools.GetMessageById("14028", new string[] { i [0].ToString() });

        c1.changeObj.Add(this.GetChild("n3").asButton);
        c1.changeObj.Add(this.GetChild("n4").asButton);
        c1.changeObj.Add(this.GetChild("n5").asButton);

        list1.itemRenderer = List_Render1;
        list.itemRenderer  = List_Render;
        list2.itemRenderer = List_Render2;

        l_mycardNum.text = Tools.GetMessageColor(Tools.GetMessageById("17010", new string[] {
            userCard.Keys.Count + "",
            DataManager.inst.GetCardNumByLv(ModelManager.inst.userModel.effort_lv) + ""
        }), new string[] { "F8DD2CFF" });
        this.GetChild("n9").asTextField.text  = Tools.GetMessageById("24127");
        this.GetChild("n14").asTextField.text = Tools.GetMessageById("24128");

        IsChangeType(false);

        this.AddGlobalListener(MainEvent.CARD_CHANGE, OnChangeCallBack);
        this.AddGlobalListener(MainEvent.CARD_LEVELUP, OnlevelUp);
        this.AddGlobalListener(MainEvent.LEVEL_UP_USER, OnUserLevelup);
//		this.AddGlobalListener (MainEvent.JUMP_COINGOLDEXPGET, OnJumpFunction);

        if ((int)userModel.records ["card_group_index"] == 0)
        {
            Tab_Change();
        }
        else
        {
            c1.selectedIndex = (int)userModel.records ["card_group_index"];
        }
        cardModel.teamIndex = c1.selectedIndex;
        cardModel.UpdataMyCardData();

        if (GuideManager.inst.Check("1:0"))         //引导开始 升级卡牌
        {
            List_Render1(0, this.GetChild("n46"));
            GuideManager.inst.Next();
            GuideManager.inst.Show(this);
        }
//		else if(GuideManager.inst.Check ("2:0")){
//			GuideManager.inst.Clear ();
//			GuideManager.inst.Show (this);
//		}
        else
        {
            this.RemoveChild(this.GetChild("n46"));
        }
    }
Ejemplo n.º 17
0
 public bool CreateCard(ModelCard modelCard, int acc_id)
 {
     return(new RepositoryCard().AddCard(modelCard, acc_id));
 }
Ejemplo n.º 18
0
        public MainWindow()
        {
            InitializeComponent();

            try
            {
                ImageCards = JsonConvert.DeserializeObject <List <ImageCard.Properties> >(File.ReadAllText("Images.json")).Select(p => new ImageCard()
                {
                    CardProperties = p
                }).ToList();
            }
            catch
            {
                ImageCards = new List <ImageCard>();
            }
            try
            {
                ModelCards = JsonConvert.DeserializeObject <List <ModelCard.Properties> >(File.ReadAllText("Models.json")).Select(p => new ModelCard()
                {
                    CardProperties = p
                }).ToList();
            }
            catch
            {
                ModelCards = new List <ModelCard>();
            }
            try
            {
                NoteCards = JsonConvert.DeserializeObject <List <NoteCard.Properties> >(File.ReadAllText("Notes.json")).Select(p => new NoteCard()
                {
                    CardProperties = p
                }).ToList();
            }
            catch
            {
                NoteCards = new List <NoteCard>();
            }
            try
            {
                AlarmCards = JsonConvert.DeserializeObject <List <AlarmCard.Properties> >(File.ReadAllText("Alarms.json")).Select(p => new AlarmCard()
                {
                    CardProperties = p
                }).ToList();
            }
            catch
            {
                AlarmCards = new List <AlarmCard>();
            }
            try
            {
                CheckListCards = JsonConvert.DeserializeObject <List <CheckListCard.Properties> >(File.ReadAllText("CheckLists.json")).Select(p => new CheckListCard()
                {
                    CardProperties = p
                }).ToList();
            }
            catch
            {
                CheckListCards = new List <CheckListCard>();
            }

            ImageCards.ForEach((c) => {
                c.Show(); c.OnClosedCalled += (s, e) =>
                {
                    ImageCard card = (ImageCard)s;
                    ImageCards.Remove(card);
                    card.Close();
                };
            });
            ModelCards.ForEach((c) => {
                c.Show(); c.OnClosedCalled += (s, e) =>
                {
                    ModelCard card = (ModelCard)s;
                    ModelCards.Remove(card);
                    card.Close();
                };
            });
            NoteCards.ForEach((c) => {
                c.Show(); c.OnClosedCalled += (s, e) =>
                {
                    NoteCard card = (NoteCard)s;
                    NoteCards.Remove(card);
                    card.Close();
                };
            });
            AlarmCards.ForEach((c) => {
                c.Show(); c.OnClosedCalled += (s, e) =>
                {
                    AlarmCard card = (AlarmCard)s;
                    AlarmCards.Remove(card);
                    card.Close();
                };
            });
            CheckListCards.ForEach((c) => {
                c.Show(); c.OnClosedCalled += (s, e) =>
                {
                    CheckListCard card = (CheckListCard)s;
                    CheckListCards.Remove(card);
                    card.Close();
                };
            });

            Notifier.MouseDown += Notifier_MouseDown;;
            Notifier.Icon       = System.Drawing.SystemIcons.Application;

            Notifier.Text = "VCards";

            Notifier.Visible = true;

            try
            {
                Theme theme = JsonConvert.DeserializeObject <Theme>(File.ReadAllText("Theme.json"));

                dark = theme.NightMode;

                ThemeOpacity = theme.Opacity;

                new PaletteHelper().SetLightDark(dark);
                new PaletteHelper().ReplacePalette(theme.Pallete);

                OnOpacityChanged(ThemeOpacity);
            }
            catch { }
        }