コード例 #1
0
        /// <inheritdoc />
        protected override void OnEstablishDeploymentConfiguration(DeploymentContributorConfigurationSetup setup)
        {
            var inputs = setup.EnumerateInputs()
                         .Where(s => StaticDataModel.IsStaticDataDeploymentUnit(s.Filename))
                         .ToArray();

            if (inputs.Length > 0)
            {
                model = StaticDataModel.Create();
                foreach (var input in inputs)
                {
                    using (var inputStream = input.GetStream())
                    {
                        PublishMessage(new ExtensibilityError(
                                           $"Including {input.Filename} into static data deployment model.", Severity.Message));
                        model.Add(input.Filename, inputStream);
                    }
                }

                var metadata = new Dictionary <string, string>();
                using (var stream = setup.OpenNewOutput(StaticDataModelFileName, metadata))
                {
                    model.Save(stream);
                    stream.Flush();
                }
            }
        }
コード例 #2
0
 public void EquipSellClick(EquipInfoView equipInfoView)
 {
     if (selectedData != null)
     {
         PlayerData playData = EquipModel.SellPlayerEquip(selectedData);
         finalData = StaticDataModel.ReadEquipMerge(playData.equips);
         equiplistView.DisPlay_Choice(finalData, this, 1);
         bool isContains = false;
         for (int i = 0; i < finalData.Count; i++)
         {
             if (finalData[i].equipmentID == selectedData.equipmentID && finalData[i].strLevel == selectedData.strLevel)
             {
                 isContains = true;
                 break;
             }
         }
         if (!isContains)
         {
             selectedData = null;
             Destroy(equipInfoView.gameObject);
             return;
         }
         Num.text = playData.equips.Count + "/" + kucun;
         equipInfoView.count.text = (selectedData.count - 1).ToString();
     }
 }
コード例 #3
0
        void GetClasssRoom()
        {
            DataTable dt = Common.GetClassRoom();

            lstClass = new ObservableCollection <StaticDataModel>();

            StaticDataModel obj1 = new StaticDataModel();

            obj1.StaticID   = 0;
            obj1.StaticName = "All";
            lstClass.Add(obj1);

            foreach (DataRow dr in dt.Rows)
            {
                if (dr[1].ToString() != "--Select--")
                {
                    StaticDataModel obj = new StaticDataModel();
                    obj.StaticID   = int.Parse(dr[0].ToString());
                    obj.StaticName = dr[1].ToString();
                    lstClass.Add(obj);
                }
            }



            this.SelectedClass = lstClass.OrderBy(x => "StaticName").FirstOrDefault();
        }
コード例 #4
0
    public void ShowPackage()
    {
        DynamicDataModel.Init();

        data = DynamicDataModel.ReadData();
        //Debug.Log("玩家数据" + JsonMapper.ToJson(data));
        Num.text  = data.equips.Count + "/" + kucun;
        finalData = StaticDataModel.ReadEquipMerge(data.equips);

        equiplistView.DisPlay_Choice(finalData, this, Choice);
    }
コード例 #5
0
        private void GetSuppliers()
        {
            DataTable dt = Common.GetSuppliers();

            lstSuppliers = new ObservableCollection <StaticDataModel>();
            foreach (DataRow dr in dt.Rows)
            {
                StaticDataModel obj = new StaticDataModel();
                obj.StaticID   = int.Parse(dr[0].ToString());
                obj.StaticName = dr[1].ToString();
                lstSuppliers.Add(obj);
            }
        }
コード例 #6
0
        /// <inheritdoc />
        protected override void OnApplyDeploymentConfiguration(DeploymentContributorContext context,
                                                               ICollection <DeploymentContributorConfigurationStream> configurationStreams)
        {
            var configurationStream = configurationStreams.FirstOrDefault(s => s.Filename == StaticDataModelFileName);

            if (configurationStream != null)
            {
                PublishMessage(new ExtensibilityError(
                                   "Reading static data model into deployment plan.", Severity.Message));
                using (var modelStream = configurationStream.GetStream())
                {
                    model = StaticDataModel.Load(modelStream);
                }
            }
        }
コード例 #7
0
        void GetAcademicYear()
        {
            DataTable dt = Common.GetAcademicYear();

            lstAcademicYear = new ObservableCollection <StaticDataModel>();
            foreach (DataRow dr in dt.Rows)
            {
                StaticDataModel obj = new StaticDataModel();
                obj.StaticID   = int.Parse(dr[0].ToString());
                obj.StaticName = dr[1].ToString();
                lstAcademicYear.Add(obj);
            }

            this.SelectedAcademicYear = lstAcademicYear.FirstOrDefault();
        }
コード例 #8
0
    public void RankUPClick(EquipInfoView equipInfoView)
    {
        RowEquipment equipDate = selectedData;

        PlayerData newList = EquipModel.StrLevelUp(equipDate);

        finalData = StaticDataModel.ReadEquipMerge(newList.equips);

        equiplistView.DisPlay_Choice(finalData, this, 1);

        TeamModel.EquioStrChange();

        Num.text = newList.equips.Count + "/" + kucun;
        equipInfoView.Display(selectedData, this);
    }
コード例 #9
0
    public static List <RowHeroDate> ReadHeroData()
    {
        string             json = PlayerPrefs.GetString(Herokey);
        List <DynamicDate> date = JsonMapper.ToObject <List <DynamicDate> >(json);

        //20190627 start
        //string Ejson = PlayerPrefs.GetString(key);
        //PlayerData Edate = JsonMapper.ToObject<PlayerData>(Ejson);
        PlayerData Edate = ReadData();
        //20190627 end

        List <RowHeroDate> row = StaticDataModel.ReadHeroDate(date, Edate);

        string json1 = JsonMapper.ToJson(row);

        // Debug.Log("Hero数据" + json1);
        return(row);
    }
コード例 #10
0
        void GetMonth()
        {
            string[] names = DateTimeFormatInfo.CurrentInfo.MonthNames;
            lstMonths = new ObservableCollection <StaticDataModel>();
            int             counter = 0;
            StaticDataModel obj1    = new StaticDataModel();

            obj1.StaticID   = counter;
            obj1.StaticName = "All";
            lstMonths.Add(obj1);
            foreach (string str in names)
            {
                counter++;
                StaticDataModel obj = new StaticDataModel();
                obj.StaticID   = counter;
                obj.StaticName = str;
                lstMonths.Add(obj);
            }

            this.SelectedMonth = lstMonths.FirstOrDefault();
        }
コード例 #11
0
        public ActionResult ManageStaticData(string sdatatypeId, string sdataid = "")
        {
            StaticDataCommon SDC = new StaticDataCommon();
            StaticDataModel  SDM = new StaticDataModel();

            if (!string.IsNullOrEmpty(sdatatypeId))
            {
                SDM.StaticDataTypeId = sdatatypeId;
                sdatatypeId          = sdatatypeId.DecryptParameter().ToString();
                if (!string.IsNullOrEmpty(sdatatypeId) && !string.IsNullOrEmpty(sdataid))
                {
                    sdataid = sdataid.DecryptParameter();
                    if (!string.IsNullOrEmpty(sdataid))
                    {
                        SDC = buss.GetStaticDataById(sdataid, sdatatypeId);
                        SDC.StaticDataTypeId = SDC.StaticDataTypeId.EncryptParameter();
                        SDC.StaticDataId     = SDC.StaticDataId.EncryptParameter();
                        SDM = SDC.MapObject <StaticDataModel>();
                    }
                }
                return(View(SDM));
            }
            return(RedirectToAction("StaticDataList", new { SdatatypeID = SDM.StaticDataTypeId }));
        }
コード例 #12
0
        public ActionResult ManageStaticData(StaticDataModel SDM)
        {
            StaticDataCommon SDC = new StaticDataCommon();

            if (ModelState.IsValid)
            {
                SDC = SDM.MapObject <StaticDataCommon>();
                SDC.StaticDataTypeId = SDC.StaticDataTypeId.DecryptParameter();

                if (!string.IsNullOrEmpty(SDC.StaticDataId))
                {
                    SDC.StaticDataId = SDC.StaticDataId.DecryptParameter();
                }
                SDC.ActionUser = Session["username"].ToString();
                CommonDbResponse dbresp = buss.ManageStaticData(SDC);
                if (dbresp.Code == 0)
                {
                    this.ShowPopup(0, dbresp.Message);
                    return(RedirectToAction("StaticDataList", new { SdatatypeID = SDM.StaticDataTypeId }));
                }
            }
            this.ShowPopup(1, "Error");
            return(View(SDM));
        }
コード例 #13
0
 void Start()
 {
     RowDate = DynamicDataModel.ReadHeroData();
     RowDate = StaticDataModel.ReadHeroDateAddEquip(RowDate);
 }
コード例 #14
0
 public BootstrapStateCreateMetaData(Bootstrap.BootstrapMediator mediator) : base(mediator)
 {
     _staticDataModel = mediator._staticDataModel;
 }
コード例 #15
0
 /// <inheritdoc />
 public DeployStaticDataModelStep(StaticDataModel model, bool isTransactional)
 {
     this.model           = model;
     this.isTransactional = isTransactional;
 }