コード例 #1
0
ファイル: RationController.cs プロジェクト: trigger07/SEDESOL
        public ActionResult UploadFile(int pYear, int pMonth)
        {
            string result = string.Empty;

            SedesolServiceClient client = new SedesolServiceClient();

            foreach (string fileName in Request.Files)
            {
                HttpPostedFileBase file = Request.Files[fileName];

                if (file != null && file.ContentLength > 0)
                {
                    DataTable dt = new DataTable();
                    dt           = GetDataTableFromSpreadsheet(file.InputStream, false, pYear, pMonth);
                    dt.TableName = "dtRations";
                    if (dt.Rows.Count > 1)
                    {
                        result = client.SaveRations(DTOSerializer.Serialize(dt).InnerXml);
                    }
                    else
                    {
                        result = "No se pudo obtener la informaciòn del archivo";
                    }
                }
            }
            RationModel model = new RationModel();

            model = client.GetRationSearch(pYear, pMonth);
            client.Close();

            string viewContent = ConvertViewToString("RationList", model.ListRation);

            return(Json(new { message = result, PartialView = viewContent }));
        }
コード例 #2
0
 private bool Init(RationModel model)
 {
     _clsRationModel      = model;
     _uiShipsAnchor.alpha = 0.01f;
     _listShips           = new List <ShipModel_Eater>(3);
     SetShipsInfos(model.EatingShips, model.SharedShips);
     SetShipTexture(_listShips);
     return(true);
 }
コード例 #3
0
 public void __createCacheDataBeforeCommand__()
 {
     if (_phase == CombatPhase.DAY && !IsTakeCommand())
     {
         _cache_ration = null;
         if (_GetRationData() != null)
         {
             _cache_ration = new RationModel(_ships_f, _GetRationData());
         }
     }
 }
コード例 #4
0
        public RationModel GetRationSearch(int pYear, int pMonth)
        {
            RationDAL   dal      = new RationDAL();
            ParamDAL    paramdal = new ParamDAL();
            RationModel model    = new RationModel();

            model.ListMonth  = paramdal.GetMonths();
            model.ListYear   = paramdal.GetYears();
            model.ListRation = dal.GetRationSearch(pYear, pMonth);
            return(model);
        }
コード例 #5
0
 public void __createCacheDataBeforeCommand__()
 {
     if (this._phase != CombatPhase.DAY)
     {
         return;
     }
     if (this.IsTakeCommand())
     {
         return;
     }
     this._cache_ration = null;
     if (this._GetRationData() != null)
     {
         this._cache_ration = new RationModel(this._ships_f, this._GetRationData());
     }
 }
コード例 #6
0
ファイル: RationController.cs プロジェクト: trigger07/SEDESOL
        public ActionResult Search(int pYear = 0, int pMonth = 0)
        {
            try
            {
                RationModel          model = new RationModel();
                SedesolServiceClient proxy = new SedesolServiceClient();

                model = proxy.GetRationSearch(pYear, pMonth);
                proxy.Close();

                return(PartialView("RationList", model.ListRation));
            }
            catch (Exception ex)
            {
                return(PartialView("RationList", null));
            }
        }
コード例 #7
0
 public void __createCacheDataNight__()
 {
     if (_phase == CombatPhase.NIGHT)
     {
         RationModel ration = null;
         if (_GetRationData() != null)
         {
             ration = new RationModel(_ships_f, _GetRationData());
         }
         _cache_opening_n = new NightCombatModel(this, _battleData.NightBattle, ration);
         _cache_hougeki_n = null;
         if (_battleData.NightBattle.Hougeki != null)
         {
             List <Hougeki <BattleAtackKinds_Night> > hougeki = _battleData.NightBattle.Hougeki;
             _cache_hougeki_n = new HougekiListModel(hougeki, _GetShipsDic());
         }
     }
 }
コード例 #8
0
ファイル: RationController.cs プロジェクト: trigger07/SEDESOL
        public ActionResult Create()
        {
            RationModel          model      = new RationModel();
            List <RationDTO>     listRation = new List <RationDTO>();
            SedesolServiceClient proxy      = new SedesolServiceClient();

            model.ListYear   = proxy.GetYears();
            model.ListMonth  = proxy.GetMonths();
            model.ListRation = listRation;
            var states = proxy.GetActiveStates();

            var itemToRemove = states.Single(r => r.Id == Convert.ToInt32(ConfigurationManager.AppSettings["nacExtranjero"].ToString()));

            states.Remove(itemToRemove);

            model.ListState = states;

            return(View(model));
        }
コード例 #9
0
 protected override bool Init()
 {
     _prodBattleCommandSelect = ProdBattleCommandSelect.Instantiate(((Component)BattleTaskManager.GetPrefabFile().prefabProdBattleCommandSelect).GetComponent <ProdBattleCommandSelect>(), BattleTaskManager.GetBattleCameras().cutInCamera.transform, BattleTaskManager.GetBattleManager().GetCommandPhaseModel());
     _clsRationModel          = BattleTaskManager.GetBattleManager().GetRationModel();
     if (_clsRationModel != null)
     {
         _prodCombatRation = ProdCombatRation.Instantiate(((Component)BattleTaskManager.GetPrefabFile().prefabProdCombatRation).GetComponent <ProdCombatRation>(), BattleTaskManager.GetBattleCameras().cutInCamera.transform, _clsRationModel);
         _prodCombatRation.Play(OnCombatRationFinished);
         ObserverActionQueue observerAction = BattleTaskManager.GetObserverAction();
         observerAction.Register(delegate
         {
             Mem.DelComponentSafe(ref _prodCombatRation);
         });
     }
     else
     {
         OnCombatRationFinished();
     }
     return(true);
 }
コード例 #10
0
        public void __createCacheDataNight__()
        {
            if (this._phase != CombatPhase.NIGHT)
            {
                return;
            }
            RationModel ration = null;

            if (this._GetRationData() != null)
            {
                ration = new RationModel(this._ships_f, this._GetRationData());
            }
            this._cache_opening_n = new NightCombatModel(this, this._battleData.NightBattle, ration);
            this._cache_hougeki_n = null;
            if (this._battleData.NightBattle.Hougeki != null)
            {
                List <Hougeki <BattleAtackKinds_Night> > hougeki = this._battleData.NightBattle.Hougeki;
                this._cache_hougeki_n = new HougekiListModel(hougeki, this._GetShipsDic());
            }
        }
コード例 #11
0
        public static ProdCombatRation Instantiate(ProdCombatRation prefab, Transform parent, RationModel model)
        {
            ProdCombatRation prodCombatRation = UnityEngine.Object.Instantiate(prefab);

            prodCombatRation.transform.parent = parent;
            prodCombatRation.transform.localScaleZero();
            prodCombatRation.transform.localPositionZero();
            prodCombatRation.Init(model);
            return(prodCombatRation);
        }
コード例 #12
0
        public static ProdCombatRation Instantiate(ProdCombatRation prefab, Transform parent, RationModel model)
        {
            ProdCombatRation prodCombatRation = Object.Instantiate <ProdCombatRation>(prefab);

            prodCombatRation.get_transform().set_parent(parent);
            prodCombatRation.get_transform().localScaleZero();
            prodCombatRation.get_transform().localPositionZero();
            prodCombatRation.Init(model);
            return(prodCombatRation);
        }