コード例 #1
0
        private IEnumerator RepairKitConfirmModeEnter()
        {
            GameObject Instance = Util.Instantiate(Prefab_RepairKitConfim, base.transform.parent.gameObject);

            repairKitConfim = Instance.GetComponent <StrategyRepairKitConfirm>();
            RepairMng       = new RepairManager(SingletonMonoBehaviour <AppInformation> .Instance.CurrentDeck.AreaId);
            RepairDockModel[] dockModels = RepairMng.GetDocks();
            for (int i = 0; i < RepairMng.GetDocks().Length; i++)
            {
                if (dockModels[i].GetShip() != null && dockModels[i].GetShip().MemId == FocusBanner.ShipModel.MemId)
                {
                    repairDockModel = dockModels[i];
                    break;
                }
            }
            if (repairDockModel == null)
            {
                ModeProcessor.ChangeMode(0);
                yield break;
            }
            repairKitConfim.SetModel(repairDockModel, RepairMng.Material.RepairKit);
            repairKitConfim.SetOnSelectPositive(OnDesideRepairKit);
            repairKitConfim.SetOnSelectNeagtive(OnCancelRepairKit);
            yield return(new WaitForEndOfFrame());

            repairKitConfim.Open();
            yield return(null);
        }
コード例 #2
0
ファイル: dialog.cs プロジェクト: syncsyncsynchalt/BD-6Kr
        public void _init_repair()
        {
            rep              = GameObject.Find("Repair Root").GetComponent <repair>();
            csb              = GameObject.Find("dialog_top/dialog/Banner/CommonShipBanner2").GetComponent <CommonShipBanner>();
            bd3              = GameObject.Find("board3_top/board3").GetComponent <board3>();
            _Button_Yes      = GameObject.Find("dialog_top/dialog/btn_yes").GetComponent <UIButton>();
            _Button_No       = GameObject.Find("dialog_top/dialog/btn_no").GetComponent <UIButton>();
            btn_obj[0]       = _Button_No.gameObject;
            btn_obj[1]       = _Button_Yes.gameObject;
            _uiOverlayButton = GameObject.Find("dialog_top/dialog/OverlayBtn").GetComponent <UIButton>();
            EventDelegate.Add(_uiOverlayButton.onClick, _onClickOverlayButton);
            UIButtonMessage component = _Button_Yes.GetComponent <UIButtonMessage>();

            component.target       = base.gameObject;
            component.functionName = "Pressed_Button_Yes";
            component.trigger      = UIButtonMessage.Trigger.OnClick;
            UIButtonMessage component2 = _Button_No.GetComponent <UIButtonMessage>();

            component2.target       = base.gameObject;
            component2.functionName = "Pressed_Button_No";
            component2.trigger      = UIButtonMessage.Trigger.OnClick;
            _clsRepair                       = rep.now_clsRepair();
            dockSelectController             = new KeyControl(0, 1);
            dockSelectController.isLoopIndex = false;
            dockSelectController.setChangeValue(0f, 1f, 0f, -1f);
            sw = GameObject.Find("sw01").GetComponent <sw>();
            sw.setSW(stat: false);
            _bVector = Vector3.one;
        }
コード例 #3
0
        public JsonResult SearchJobID(string term)
        {
            try
            {
                term = term.Trim();

                var items = RepairManager.GetBySearch(term);
                //items = items.Where(m => m.RepairStatuies[0].WorkingStatus.iDefault == (int)Working.Claim).ToList();


                return(Json(items.Select(m => new
                {
                    label = m.sRepairNo + " - " + m.Product.sProductName,
                    m.kRepairId,
                    m.sRepairNo,
                    sProductName = m.vProductName,
                    kProductTypeId = m.Product.kProductTypeId,
                    kBrandId = m.Product.kBrandId,
                    sBrandDescription = m.Product.vBrandDescription,
                    sProductTypeDescription = m.Product.vProductTypeDescription,
                    m.Product.kProductId,
                    m.Product.sProductModel,
                    m.sSerial,
                    dtInsuranceExpire = m.dtInsuranceExpire != null ? m.dtInsuranceExpire.GetValueOrDefault().AddYears(543).ToString(DateExtension.DateNumber()) : ""
                })
                            , JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                return(Json(new { Result = "ERROR", Message = ex.Message }));
            }
        }
コード例 #4
0
 void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
 }
コード例 #5
0
        public JsonResult EditStatus(RepairStatus model)
        {
            try
            {
                WorkingStatusManager.EditRepairStatus(model);


                //re-initial data
                Repair model2 = RepairManager.GetById(model.kRepairId);


                //Inform all connected clients
                var clientName = User.Identity.Name;
                Task.Factory.StartNew(() =>
                {
                    var clients = Hub.GetClients <RealTimeJTableDemoHub>();
                    clients.RecordUpdated(clientName, model2);
                });


                return(Json(new { Result = "OK" }));
            }
            catch (Exception ex)
            {
                return(Json(new { Result = "ERROR", Message = ex.Message }));
            }
        }
コード例 #6
0
        public void _init_repair()
        {
            this.rep              = GameObject.Find("Repair Root").GetComponent <repair>();
            this.csb              = GameObject.Find("dialog_top/dialog/Banner/CommonShipBanner2").GetComponent <CommonShipBanner>();
            this.bd3              = GameObject.Find("board3_top/board3").GetComponent <board3>();
            this._Button_Yes      = GameObject.Find("dialog_top/dialog/btn_yes").GetComponent <UIButton>();
            this._Button_No       = GameObject.Find("dialog_top/dialog/btn_no").GetComponent <UIButton>();
            this.btn_obj[0]       = this._Button_No.get_gameObject();
            this.btn_obj[1]       = this._Button_Yes.get_gameObject();
            this._uiOverlayButton = GameObject.Find("dialog_top/dialog/OverlayBtn").GetComponent <UIButton>();
            EventDelegate.Add(this._uiOverlayButton.onClick, new EventDelegate.Callback(this._onClickOverlayButton));
            UIButtonMessage component = this._Button_Yes.GetComponent <UIButtonMessage>();

            component.target       = base.get_gameObject();
            component.functionName = "Pressed_Button_Yes";
            component.trigger      = UIButtonMessage.Trigger.OnClick;
            UIButtonMessage component2 = this._Button_No.GetComponent <UIButtonMessage>();

            component2.target                     = base.get_gameObject();
            component2.functionName               = "Pressed_Button_No";
            component2.trigger                    = UIButtonMessage.Trigger.OnClick;
            this._clsRepair                       = this.rep.now_clsRepair();
            this.dockSelectController             = new KeyControl(0, 1, 0.4f, 0.1f);
            this.dockSelectController.isLoopIndex = false;
            this.dockSelectController.setChangeValue(0f, 1f, 0f, -1f);
            this.sw = GameObject.Find("sw01").GetComponent <sw>();
            this.sw.setSW(false);
            this._bVector = Vector3.get_one();
        }
コード例 #7
0
 private bool IsValidRepair()
 {
     RepairMng       = new RepairManager(SingletonMonoBehaviour <AppInformation> .Instance.CurrentDeck.AreaId);
     repairDockModel = null;
     RepairDockModel[] docks = RepairMng.GetDocks();
     if (FocusBanner.ShipModel.NowHp >= FocusBanner.ShipModel.MaxHp)
     {
         CommonPopupDialog.Instance.StartPopup(Util.getPopupMessage(PopupMess.NoDamage));
         return(false);
     }
     if (SingletonMonoBehaviour <AppInformation> .Instance.CurrentDeckAreaModel.NDockMax == 0)
     {
         CommonPopupDialog.Instance.StartPopup("この海域には入渠ドックがありません");
         return(false);
     }
     for (int i = 0; i < RepairMng.GetDocks().Length; i++)
     {
         if (docks[i].State == NdockStates.EMPTY)
         {
             repairDockModel = docks[i];
             break;
         }
     }
     if (repairDockModel == null)
     {
         CommonPopupDialog.Instance.StartPopup("入渠ドックに空きがありません");
         return(false);
     }
     if (!RepairMng.IsValidStartRepair(FocusBanner.ShipModel.MemId))
     {
         CommonPopupDialog.Instance.StartPopup("資源が不足しています");
         return(false);
     }
     return(true);
 }
コード例 #8
0
        public ActionResult getYearList()
        {
            int      pageIndex = Request["page"] == null ? 1 : int.Parse(Request["page"]);
            int      pageSize  = Request["rows"] == null ? 10 : int.Parse(Request["rows"]);
            GridData gd        = new RepairManager().getYearList(pageIndex, pageSize);
            string   s         = JsonHelper.JsonDllSerializeEntity <GridData>(gd);

            return(Content(s));
        }
コード例 #9
0
        protected override void Run(CancellationToken cancellationToken)
        {
            IRepairTask repairTask = CreateRepairTask();

            RepairManager.CreateRepairTaskAsync(Guid.NewGuid(), repairTask).GetAwaiter().GetResult();

            RepairManager.CompletedEvent.WaitOne();
            PolicyAgentService.CompletedEvent.WaitOne();
            CompletedEvent.Set();
        }
コード例 #10
0
        public void UpdateInfo(int dockNo)
        {
            this.selected_dock = dockNo;
            this._isBtnMaruUp  = false;
            this._clsRepair    = this.rep.now_clsRepair();
            iTween.ScaleTo(base.get_gameObject(), new Vector3(0.6f, 0.6f, 0.6f), 0f);
            int numOfKeyPossessions = this._clsRepair.NumOfKeyPossessions;

            GameObject.Find("dialog3_top/dialog3/Text_b").GetComponent <UILabel>().text = numOfKeyPossessions.ToString();
            GameObject.Find("dialog3_top/dialog3/Text_a").GetComponent <UILabel>().text = (numOfKeyPossessions - 1).ToString();
        }
        protected override void Run(CancellationToken cancellationToken)
        {
            IRepairTask repairTask = CreateRepairTask();

            RepairManager.CreateRepairTaskAsync(Guid.NewGuid(), repairTask).GetAwaiter().GetResult();

            ((MockRepairTask)repairTask).CreatedTimestamp = DateTime.UtcNow;

            RepairManager.CompletedEvent.WaitOne();
            CompletedEvent.Set();
        }
コード例 #12
0
        private IRepairTask CreateRepairTask()
        {
            var repairTask = RepairManager.NewRepairTask(
                Guid.NewGuid().ToString(),
                InfrastructureService.Parallel.Constants.RepairActionFormat.ToString(RepairActionTypeEnum.Reboot));

            repairTask.Target      = new NodeRepairTargetDescription("Role.0");
            repairTask.State       = RepairTaskState.Created;
            repairTask.Description = "Creating a repair task externally and not via IS";

            return(repairTask);
        }
コード例 #13
0
 public void StartUp()
 {
     this.rep                  = base.get_gameObject().get_transform().get_parent().get_parent().GetComponent <repair>();
     this.bd3b                 = this.rep.get_gameObject().get_transform().FindChild("board3_top/board3/Button").GetComponent <board3_btn>();
     this.bd3                  = this.rep.get_gameObject().get_transform().FindChild("board3_top/board3").GetComponent <board3>();
     this.dia                  = GameObject.Find("dialog_top/dialog").GetComponent <dialog>();
     this.btn_obj[0]           = GameObject.Find("switch_ball");
     this.btn_obj[1]           = this.bd3b.get_gameObject();
     this.dockSelectController = new KeyControl(0, 1, 0.4f, 0.1f);
     this.dockSelectController.setChangeValue(-1f, 0f, 1f, 0f);
     this.nyukyo     = false;
     this._clsRepair = this.rep.now_clsRepair();
 }
コード例 #14
0
        //
        // GET: /RepairSub/

        public ActionResult saveRepair()
        {
            MsgBox mb = new MsgBox();
            repair r  = new repair();

            r.ID         = Guid.NewGuid().ToString();
            r.labName    = Request["labName"] == null ? "" : Request["labName"].ToString();
            r.repairName = Request["repairName"] == null ? "" : Request["repairName"].ToString();
            r.account    = System.Web.HttpContext.Current.Session["account"].ToString();
            r.isDone     = 0;
            mb           = new RepairManager().saveRepair(r);
            return(Json(mb));
        }
コード例 #15
0
    private void Awake()
    {
        GameManager gameManager = GameManager.Instance;

        //Debug.Log(this.gameObject.name + " ", gameManager);
        _repairManager = gameManager.GetComponent <RepairManager>();
        _repairState   = 1.0f;
        MoveMiniAnt(1, true);
        MoveMiniAnt(2, true);
        MoveMiniAnt(3, true);
        ant1.SetActive(false);
        ant2.SetActive(false);
        ant3.SetActive(false);
    }
コード例 #16
0
 public void UpdateInfo(int ret)
 {
     _isBtnMaruUp = false;
     _clsRepair   = rep.now_clsRepair();
     sm           = _clsRepair.GetDockData(ret).GetShip();
     csb.SetShipData(sm);
     iTween.ScaleTo(base.gameObject, new Vector3(0.6f, 0.6f, 0.6f), 0f);
     ele_l      = GameObject.Find("dialog2_top/dialog2/label_shipname").GetComponent <UILabel>();
     ele_l.text = sm.Name;
     ele_l      = GameObject.Find("dialog2_top/dialog2/label_lv").GetComponent <UILabel>();
     ele_l.text = string.Empty + sm.Level;
     GameObject.Find("dialog2/label_param_1").GetComponent <UILabel>().text = _clsRepair.GetDockData(ret).RemainingTurns.ToString();
     GameObject.Find("dialog2/label_param_2").GetComponent <UILabel>().text = rep.now_repairkit().ToString();
     GameObject.Find("dialog2/label_param_3").GetComponent <UILabel>().text = (rep.now_repairkit() - 1).ToString();
     shipid = sm.MstId;
 }
コード例 #17
0
 public void _init_repair()
 {
     this.rep                  = base.get_gameObject().get_transform().get_parent().get_parent().GetComponent <repair>();
     this.bd3b                 = this.rep.get_gameObject().get_transform().FindChild("board3_top/board3/Button").GetComponent <board3_btn>();
     this.bd3                  = this.rep.get_gameObject().get_transform().FindChild("board3_top/board3").GetComponent <board3>();
     this.bd2                  = GameObject.Find("board2").GetComponent <board2>();
     this.btn_obj[0]           = GameObject.Find("switch_ball");
     this.btn_obj[1]           = this.bd3b.get_gameObject();
     this.sw                   = GameObject.Find("sw01").GetComponent <sw>();
     this.dockSelectController = new KeyControl(0, 1, 0.4f, 0.1f);
     this.dockSelectController.setChangeValue(-1f, 0f, 1f, 0f);
     this.nyukyo         = false;
     this.bd3firstUpdate = true;
     this.cy             = 1;
     this._clsRepair     = this.rep.now_clsRepair();
 }
コード例 #18
0
        public ActionResult repairFinished()
        {
            string id = Request["ID"] == null ? "" : Request["ID"].ToString();
            MsgBox mb = new MsgBox();

            if (string.IsNullOrEmpty(id))
            {
                mb.status = false;
                mb.msg    = "待维修ID不能为空。";
            }
            else
            {
                mb = new RepairManager().setRepairFinished(id);
            }
            return(Json(mb));
        }
コード例 #19
0
        public void StartUP()
        {
            this.rep = GameObject.Find("Repair Root").GetComponent <repair>();
            this.rep.set_mode(-1);
            if (this._isStartUpDone)
            {
                return;
            }
            this._isStartUpDone = true;
            this.bd2            = this.rep.get_transform().FindChild("board2_top/board2").GetComponent <board2>();
            this.bd3            = this.rep.get_transform().FindChild("board3_top/board3").GetComponent <board3>();
            this.dia            = GameObject.Find("dialog").GetComponent <dialog>();
            this.dia2           = GameObject.Find("dialog2").GetComponent <dialog2>();
            this.dia3           = GameObject.Find("dialog3").GetComponent <dialog3>();
            for (int i = 0; i < 4; i++)
            {
                GameObject[] arg_DE_0 = this.shutter;
                int          arg_DE_1 = i;
                string       arg_D4_0 = "board1_top/board/Grid/0";
                int          num      = i;
                arg_DE_0[arg_DE_1] = GameObject.Find(arg_D4_0 + num.ToString() + "/Shutter");
            }
            this._clsRepair = this.rep.now_clsRepair();
            this.now_kit    = this._clsRepair.Material.RepairKit;
            this._ANI       = this.rep.get_transform().FindChild("info").GetComponent <Animation>();
            int num2 = this._clsRepair.MapArea.NDockCount;

            if (num2 == this._clsRepair.MapArea.NDockMax)
            {
                num2--;
            }
            this.dockSelectController = new KeyControl(0, num2, 0.4f, 0.1f);
            this.dock_flag_init();
            this.dockSelectController.setChangeValue(-1f, 0f, 1f, 0f);
            this.dockSelectController.isLoopIndex = false;
            this._first_key     = false;
            this._go_kosoku     = 0;
            this._go_kosoku_m   = -1;
            this._select_dock   = 0;
            this._select_dock_m = -1;
            this._dock_exist    = false;
            this.redraw();
            this.bd2.StartUp();
            this.bd3.StartUp();
        }
コード例 #20
0
 public void StartUP()
 {
     rep = GameObject.Find("Repair Root").GetComponent <repair>();
     rep.set_mode(-1);
     if (!_isStartUpDone)
     {
         _isStartUpDone = true;
         bd2            = ((Component)rep.transform.FindChild("board2_top/board2")).GetComponent <board2>();
         bd3            = ((Component)rep.transform.FindChild("board3_top/board3")).GetComponent <board3>();
         dia            = GameObject.Find("dialog").GetComponent <dialog>();
         dia2           = GameObject.Find("dialog2").GetComponent <dialog2>();
         dia3           = GameObject.Find("dialog3").GetComponent <dialog3>();
         for (int i = 0; i < 4; i++)
         {
             GameObject[] array = shutter;
             int          num   = i;
             int          num2  = i;
             array[num] = GameObject.Find("board1_top/board/Grid/0" + num2.ToString() + "/Shutter");
         }
         _clsRepair = rep.now_clsRepair();
         now_kit    = _clsRepair.Material.RepairKit;
         _ANI       = ((Component)rep.transform.FindChild("info")).GetComponent <Animation>();
         int num3 = _clsRepair.MapArea.NDockCount;
         if (num3 == _clsRepair.MapArea.NDockMax)
         {
             num3--;
         }
         dockSelectController = new KeyControl(0, num3);
         dock_flag_init();
         dockSelectController.setChangeValue(-1f, 0f, 1f, 0f);
         dockSelectController.isLoopIndex = false;
         _first_key     = false;
         _go_kosoku     = 0;
         _go_kosoku_m   = -1;
         _select_dock   = 0;
         _select_dock_m = -1;
         _dock_exist    = false;
         redraw();
         bd2.StartUp();
         bd3.StartUp();
     }
 }
コード例 #21
0
        public JsonResult ProductTracking(string term)
        {
            try
            {
                var items = RepairManager.GetByTracking(term.Trim());

                if (items == null)
                {
                    return(Json(new { result = "ไม่พบข้อมูล/not found." }, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    TrackingCounterManager.IncreaseNextItemNo();
                    return(Json(new { result = items.vProductTracking }, JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception ex)
            {
                return(Json(new { result = "ไม่พบข้อมูล/not found." }, JsonRequestBehavior.AllowGet));
            }
        }
コード例 #22
0
        public void StartUp()
        {
            if (this._startup)
            {
                return;
            }
            this._startup = true;
            this.bd       = GameObject.Find("board1_top/board").GetComponent <board>();
            this.bd3      = GameObject.Find("board3_top/board3").GetComponent <board3>();
            this.rep      = base.get_gameObject().get_transform().get_parent().get_parent().GetComponent <repair>();
            this.rep_p    = this.rep.get_transform().FindChild("board2_top/board2/UIScrollListRepair").GetComponent <UIScrollListRepair>();
            Camera component = this.rep.get_transform().FindChild("Camera").GetComponent <Camera>();

            this._clsScroll      = new KeyScrollControl(6, 6, this.scb);
            this._clsRepair      = this.rep.now_clsRepair();
            this.damage_flag     = 0;
            this._debug_shipping = false;
            TweenPosition.Begin(base.get_gameObject(), 0.01f, new Vector3(840f, 123f, -1f));
            this.ships = this._clsRepair.GetShipList();
            this.dockSelectController = new KeyControl(0, 0, 0.4f, 0.1f);
            this.dockSelectController.setChangeValue(0f, 0f, 0f, 0f);
            this.rep_p.SetCamera(component);
            this.rep_p.SetKeyController(this.dockSelectController);
            this.rep_p.ResumeControl();
            this.rep_p.SetOnSelectedListener(delegate(UIScrollListRepairChild child)
            {
                this.rep_p.keyController.ClearKeyAll();
                this.rep_p.LockControl();
                this.rep.set_mode(-2);
                if (child.GetModel() == null)
                {
                    return;
                }
                this.bd3.UpdateInfo(child.GetModel());
                this.bd3.board3_appear(true);
                this.rep.setmask(2, true);
                this.rep.set_mode(3);
            });
            this.redraw();
        }
コード例 #23
0
        public MainWindow(Employee employee)
        {
            InitializeComponent();

            //Declare variables
            _employee        = employee;
            _employeeManager = new EmployeeManager();
            _carManager      = new CarManager();
            _customerManager = new CustomerManager();
            _billingManager  = new BillManager();
            _saleManager     = new SaleManager();
            _partsManager    = new PartsManager();
            _repairManager   = new RepairManager();

            lblUser.Content = employee.getEmployeeName();

            //Reset labels and group boxes
            refreshListView();
            hideAllGroupBoxes();
            blankLabels();
            disableButtons();
        }
コード例 #24
0
 private void OnDestroy()
 {
     ShipStates               = null;
     key                      = null;
     FocusBanner              = null;
     SupplyMng                = null;
     RepairMng                = null;
     OrganizeMng              = null;
     ModeProcessor            = null;
     dialogKeyController      = null;
     repairDockModel          = null;
     Prefab_RepairConfim      = null;
     repairConfim             = null;
     Prefab_RepairKitConfim   = null;
     repairKitConfim          = null;
     Prefab_OrganizeDetailMng = null;
     Prefab_OrganizeList      = null;
     OrganizeDetailMng        = null;
     DeckNoIcon               = null;
     DeckNoLabel              = null;
     ListSelectShipModel      = null;
     CurrentDeck              = null;
 }
コード例 #25
0
 public void StartUp()
 {
     if (!_startup)
     {
         _startup = true;
         bd       = GameObject.Find("board1_top/board").GetComponent <board>();
         bd3      = GameObject.Find("board3_top/board3").GetComponent <board3>();
         rep      = ((Component)base.gameObject.transform.parent.parent).GetComponent <repair>();
         rep_p    = ((Component)rep.transform.FindChild("board2_top/board2/UIScrollListRepair")).GetComponent <UIScrollListRepair>();
         Camera component = ((Component)rep.transform.FindChild("Camera")).GetComponent <Camera>();
         _clsScroll      = new KeyScrollControl(6, 6, scb);
         _clsRepair      = rep.now_clsRepair();
         damage_flag     = 0;
         _debug_shipping = false;
         TweenPosition.Begin(base.gameObject, 0.01f, new Vector3(840f, 123f, -1f));
         ships = _clsRepair.GetShipList();
         dockSelectController = new KeyControl();
         dockSelectController.setChangeValue(0f, 0f, 0f, 0f);
         rep_p.SetCamera(component);
         rep_p.SetKeyController(dockSelectController);
         rep_p.ResumeControl();
         rep_p.SetOnSelectedListener(delegate(UIScrollListRepairChild child)
         {
             rep_p.keyController.ClearKeyAll();
             rep_p.LockControl();
             rep.set_mode(-2);
             if (child.GetModel() != null)
             {
                 bd3.UpdateInfo(child.GetModel());
                 bd3.board3_appear(bstat: true);
                 rep.setmask(2, value: true);
                 rep.set_mode(3);
             }
         });
         redraw();
     }
 }
コード例 #26
0
 private void Start()
 {
     this._MapArea    = SingletonMonoBehaviour <AppInformation> .Instance.CurrentAreaID;
     this._clsRepair  = new RepairManager(this._MapArea);
     this._mstManager = Mst_DataManager.Instance;
     this._shipdata   = new Mst_ship();
     this._FadeDone   = false;
     if (SingletonMonoBehaviour <PortObjectManager> .exist())
     {
         SingletonMonoBehaviour <PortObjectManager> .Instance.PortTransition.EndTransition(delegate
         {
             SoundUtils.SwitchBGM(BGMFileInfos.PortTools);
             this.OnTransitionFinished();
         }, true, true);
     }
     else
     {
         this.OnTransitionFinished();
     }
     this._isStartUP   = false;
     this._now_texgirl = 0;
     this.bd1          = GameObject.Find("board1_top/board").GetComponent <board>();
     this.StartUp();
 }
コード例 #27
0
        public ActionResult caculate()
        {
            MsgBox mb = new RepairManager().caculate();

            return(Json(mb));
        }
コード例 #28
0
        public void DockStatus(int MapArea, int TargetDock)
        {
            _first_key = true;
            rep.GetMstManager();
            rep.GetMst_ship();
            rep.update_portframe();
            _clsRepair = rep.now_clsRepair();
            dock_count = _clsRepair.GetDocks().Length;
            for (int i = 0; i < dock_count; i++)
            {
                int num = i;
                bds2            = GameObject.Find("board1_top/board/Grid/0" + num.ToString() + "/bg/BackGround").GetComponent <UISprite>();
                bds2.spriteName = "list_bg";
                int num2 = i;
                bds2            = GameObject.Find("board1_top/board/Grid/0" + num2.ToString() + "/bg/BackGround3").GetComponent <UISprite>();
                bds2.spriteName = "cardArea_YB";
                int num3 = i;
                bds2            = GameObject.Find("board1_top/board/Grid/0" + num3.ToString() + "/bg/BackGround2").GetComponent <UISprite>();
                bds2.spriteName = AreaIdToSeaSpriteName(rep.NowArea());
                int num4 = i;
                GameObject.Find("board1_top/board/Grid/0" + num4.ToString() + "/Shutter/BGKey").transform.localScaleZero();
                int num5 = i;
                GameObject.Find("board1_top/board/Grid/0" + num5.ToString() + "/Shutter/BGMes").transform.localScaleZero();
                if (TargetDock == -1)
                {
                    shutter[i].transform.localScale = Vector3.zero;
                }
                dock_cursor[i] = GameObject.Find("board1_top/board/Grid/" + dock[i].name + "/bg/BackGround");
                btn_Stk[i].SetActive(true);
            }
            int nDockMax = _clsRepair.MapArea.NDockMax;

            for (int j = dock_count; j < nDockMax; j++)
            {
                if (TargetDock != -1 && TargetDock != j)
                {
                    continue;
                }
                int num6 = j;
                bds2            = GameObject.Find("board1_top/board/Grid/0" + num6.ToString() + "/bg/BackGround").GetComponent <UISprite>();
                bds2.spriteName = "list_bg_bar_closed";
                int num7 = j;
                bds2            = GameObject.Find("board1_top/board/Grid/0" + num7.ToString() + "/bg/BackGround3").GetComponent <UISprite>();
                bds2.spriteName = null;
                int num8 = j;
                bds2            = GameObject.Find("board1_top/board/Grid/0" + num8.ToString() + "/bg/BackGround2").GetComponent <UISprite>();
                bds2.spriteName = null;
                if (_first_key)
                {
                    if (_clsRepair.IsValidOpenNewDock())
                    {
                        int num9 = j;
                        GameObject.Find("board1_top/board/Grid/0" + num9.ToString() + "/Shutter/BGMes").GetComponent <UISprite>().spriteName = "huki_r_02";
                        int num10 = j;
                        GameObject.Find("board1_top/board/Grid/0" + num10.ToString() + "/Shutter/BGKey").GetComponent <UISprite>().spriteName = "btn_addDock";
                    }
                    else
                    {
                        int num11 = j;
                        GameObject.Find("board1_top/board/Grid/0" + num11.ToString() + "/Shutter/BGMes").GetComponent <UISprite>().spriteName = "huki_r_01";
                        int num12 = j;
                        GameObject.Find("board1_top/board/Grid/0" + num12.ToString() + "/Shutter/BGKey").GetComponent <UISprite>().spriteName = "btn_addDock";
                    }
                    int num13 = j;
                    GameObject.Find("board1_top/board/Grid/0" + num13.ToString() + "/Shutter/BGKey").transform.localScaleOne();
                    _first_key = false;
                }
                else
                {
                    int num14 = j;
                    GameObject.Find("board1_top/board/Grid/0" + num14.ToString() + "/Shutter/BGKey").transform.localScaleZero();
                    int num15 = j;
                    GameObject.Find("board1_top/board/Grid/0" + num15.ToString() + "/Shutter/BGMes").transform.localScaleZero();
                }
                shutter[j].transform.localScale = Vector3.one;
                dock_cursor[j] = GameObject.Find("board1_top/board/Grid/" + dock[j].name + "/Shutter/ShutterALL");
                dock_cursor[j].transform.localScale = Vector3.one;
                btn_Stk[j].SetActive((j <= dock_count) ? true : false);
                r_now[j].SetActive(false);
            }
            for (int k = nDockMax; k < 4; k++)
            {
                if (TargetDock == -1 || TargetDock == k)
                {
                    int num16 = k;
                    bds2            = GameObject.Find("board1_top/board/Grid/0" + num16.ToString() + "/bg/BackGround").GetComponent <UISprite>();
                    bds2.spriteName = null;
                    int num17 = k;
                    bds2            = GameObject.Find("board1_top/board/Grid/0" + num17.ToString() + "/bg/BackGround3").GetComponent <UISprite>();
                    bds2.spriteName = null;
                    int num18 = k;
                    bds2            = GameObject.Find("board1_top/board/Grid/0" + num18.ToString() + "/bg/BackGround2").GetComponent <UISprite>();
                    bds2.spriteName = null;
                    int num19 = k;
                    GameObject.Find("board1_top/board/Grid/0" + num19.ToString() + "/Shutter/BGKey").transform.localScaleZero();
                    int num20 = k;
                    GameObject.Find("board1_top/board/Grid/0" + num20.ToString() + "/Shutter/BGMes").transform.localScaleZero();
                    shutter[k].transform.localScale = Vector3.zero;
                    btn_Stk[k].SetActive(false);
                    r_now[k].SetActive(false);
                }
            }
            for (int l = 0; l < dock_count; l++)
            {
                crane_anime component = GameObject.Find("board/Grid/0" + l.ToString() + "/Anime").GetComponent <crane_anime>();
                ShipModel   ship      = _clsRepair.GetDockData(l).GetShip();
                if (TargetDock != -1 && TargetDock != l)
                {
                    continue;
                }
                if (_clsRepair.GetDockData(l).ShipId != 0 && _clsRepair.GetDockData(l).RemainingTurns != 0)
                {
                    r_now[l].SetActive(true);
                    btn_Stk[l].SetActive(false);
                    int num21 = l;
                    tex = GameObject.Find("board/Grid/0" + num21.ToString() + "/repair_now/ship_banner").GetComponent <UITexture>();
                    if (ship.DamageStatus == DamageState.Taiha)
                    {
                        tex.mainTexture = SingletonMonoBehaviour <ResourceManager> .Instance.ShipTexture.Load(ship.MstId, 2);
                    }
                    else if (ship.DamageStatus == DamageState.Tyuuha)
                    {
                        tex.mainTexture = SingletonMonoBehaviour <ResourceManager> .Instance.ShipTexture.Load(ship.MstId, 2);
                    }
                    else
                    {
                        tex.mainTexture = SingletonMonoBehaviour <ResourceManager> .Instance.ShipTexture.Load(ship.MstId, 1);
                    }
                    int num22 = l;
                    lab      = GameObject.Find("board/Grid/0" + num22.ToString() + "/repair_now/text_ship_name").GetComponent <UILabel>();
                    lab.text = ship.Name;
                    int num23 = l;
                    lab      = GameObject.Find("board/Grid/0" + num23.ToString() + "/repair_now/text_level").GetComponent <UILabel>();
                    lab.text = string.Empty + ship.Level;
                    int num24 = l;
                    lab      = GameObject.Find("board/Grid/0" + num24.ToString() + "/repair_now/text_hp").GetComponent <UILabel>();
                    lab.text = ship.NowHp + "/" + ship.MaxHp;
                    MaxHP[l] = ship.MaxHp;
                    int num25 = l;
                    ele_d       = GameObject.Find("board/Grid/0" + num25.ToString() + "/repair_now/HP_Gauge/panel/HP_bar_meter2").GetComponent <UISprite>();
                    ele_d.width = (int)((float)ship.NowHp * 210f / (float)ship.MaxHp);
                    ele_d.color = Util.HpGaugeColor2(ship.MaxHp, ship.NowHp);
                    int num26 = l;
                    ele_d       = GameObject.Find("board/Grid/0" + num26.ToString() + "/repair_now/HP_Gauge/panel/HP_bar_meter").GetComponent <UISprite>();
                    ele_d.width = (int)((float)ship.NowHp * 210f / (float)ship.MaxHp);
                    ele_d.color = Util.HpGaugeColor2(ship.MaxHp, ship.NowHp);
                    int num27 = l;
                    lab      = GameObject.Find("board/Grid/0" + num27.ToString() + "/repair_now/text_least_time").GetComponent <UILabel>();
                    lab.text = string.Empty + _clsRepair.GetDockData(l).RemainingTurns;
                    int num28 = l;
                    uibutton = GameObject.Find("board/Grid/0" + num28.ToString() + "/repair_now/btn_high_repair").GetComponent <UIButton>();
                    if (_clsRepair.Material.RepairKit > 0)
                    {
                        uibutton.isEnabled = true;
                    }
                    else
                    {
                        uibutton.isEnabled = false;
                    }
                    set_anime(l, stat: false);
                    component.start_anime(l);
                }
                else
                {
                    r_now[l].SetActive(false);
                    btn_Stk[l].SetActive(true);
                    component.stop_anime(l);
                    set_anime(l, stat: false);
                }
            }
            swsw = GameObject.Find("board3_top/board3/sw01").GetComponent <sw>();
            swsw.set_sw_stat((_clsRepair.Material.RepairKit > 0) ? true : false);
            _dock_exist = true;
        }
コード例 #29
0
        public JsonResult EditClaim(Claim claim_sending, ClaimStatus status_sending)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(Json(new { Result = "ERROR", Message = "Form is not valid! Please correct it and try again." }));
                }

                Repair repair    = null;
                Claim  itemFound = ClaimManager.GetById(claim_sending.kClaimId);
                if (itemFound == null)
                {
                    return(Json(new { Result = "ERROR", Message = "Item Not Found" }));
                }
                if (itemFound.IsComplete == true)
                {
                    return(Json(new { Result = "ERROR", Message = "ปิด job!" }));
                }

                var status = WorkingStatusManager.GetById(status_sending.kWorkingStatusId);
                if (status.iDefault == (int)Working.ConfirmRepair && claim_sending.IsRecieved != true)
                {
                    return(Json(new { Result = "ERROR", Message = "ตรวจรับสินค้า!" }));
                }


                bool isStatusChange = false;
                if (status_sending.kWorkingStatusId != itemFound.kWorkingStatusId)
                {
                    #region update claim status side
                    if (status.iDefault == (int)Working.ConfirmRepair)
                    {
                        status_sending.kStaffId = itemFound.kOwnerId.Value;
                    }
                    else
                    {
                        status_sending.kStaffId = (Guid)Membership.GetUser().ProviderUserKey;
                    }
                    status_sending.dtDateAdd      = DateTime.Now;
                    status_sending.kClaimStatusId = Guid.NewGuid();
                    ClaimStatusManager.Create(status_sending);

                    #endregion

                    #region also update repair status side
                    if (!String.IsNullOrEmpty(itemFound.sRepairNo))
                    {
                        repair = RepairManager.GetByRepairNo(itemFound.sRepairNo);
                        RepairStatus repairStatus = new RepairStatus
                        {
                            kStaffId         = itemFound.kOwnerId.Value,
                            kRepairId        = repair.kRepairId,
                            kWorkingStatusId = status_sending.kWorkingStatusId,
                            kRepairStatusId  = Guid.NewGuid()
                        };
                        RepairStatusManager.Create(repairStatus);
                    }
                    #endregion

                    isStatusChange = true;
                }


                #region update claim
                //assign claim
                itemFound.dtDateUpdate = DateTime.Now;
                itemFound.IsRecieved   = claim_sending.IsRecieved;
                itemFound.IsNoCredit   = claim_sending.IsNoCredit;
                if (isStatusChange)
                {
                    itemFound.kStaffId = itemFound.kOwnerId.Value;
                }
                ClaimManager.Edit(itemFound);
                #endregion

                #region update repair
                if (isStatusChange)
                {
                    if (repair != null)
                    {
                        repair.kStaffId = status_sending.kStaffId;
                    }
                    RepairManager.Edit(repair);
                }
                #endregion

                if (isStatusChange)
                {
                    //create remind for history
                    RemindHistory remind = new RemindHistory
                    {
                        sRemind  = itemFound.vMessage,
                        kStaffId = itemFound.kOwnerId.Value
                    };
                    RemindHistoryManager.Create(remind);

                    var clientName = User.Identity.Name;
                    Task.Factory.StartNew(() =>
                    {
                        var clients = Hub.GetClients <RealTimeJTableDemoHub>();
                        clients.RecordUpdated(clientName, itemFound);
                    });
                }

                return(Json(new { Result = "OK", Records = itemFound }));
            }
            catch (Exception ex)
            {
                return(Json(new { Result = "ERROR", Message = ex.Message }));
            }
        }
コード例 #30
0
        public ActionResult Create(BookingClaimViewModel model, FormCollection collection)
        {
            try
            {
                //initial working status
                var workingStatusId = WorkingStatusManager.GetAll().Where(m => m.iDefault == (int)Working.Claiming).SingleOrDefault();

                if (model.Product != null)
                {
                    model.Product.Brand = BrandManager.GetById(model.Product.kBrandId);
                }
                model.Product.ProductType = ProductTypeManager.GetById(model.Product.kProductTypeId);

                #region SAVE CUSTOMER
                var insCount = InsuranceManager.GetCountDuplicate(model.Insurance.sInsuranceName.Trim());
                if (insCount.Count <= 0)
                {
                    Insurance insurance = new Insurance
                    {
                        kInsuranceId   = Guid.NewGuid(),
                        sInsuranceName = model.Insurance.sInsuranceName,
                        sAddress1      = model.Insurance.sAddress1,
                        sCity          = model.Insurance.sCity,
                        sZip           = model.Insurance.sZip,
                        sPhone         = model.Insurance.sPhone,
                        sMobile        = model.Insurance.sMobile,
                        sFax           = model.Insurance.sFax,
                        sEmailAddress  = model.Insurance.sEmailAddress
                    };
                    InsuranceManager.Create(insurance);
                    model.Claim.Insurance = insurance;
                }
                else
                {
                    model.Claim.Insurance = insCount[0];
                }
                #endregion

                #region SAVE Brand
                var brandCount = BrandManager.GetCountDuplicate(model.Product.Brand.sBrandName.Trim());
                if (brandCount.Count <= 0)
                {
                    Brand brand = new Brand
                    {
                        kBrandId   = Guid.NewGuid(),
                        sBrandName = model.Product.Brand.sBrandName
                    };
                    BrandManager.Create(brand);
                    model.Product.Brand = brand;
                }
                else
                {
                    model.Product.Brand = brandCount[0];
                }
                #endregion

                #region SAVE Product Type
                var productTypeCount = ProductTypeManager.GetCountDuplicate(model.Product.ProductType.sDescription.Trim());
                if (productTypeCount.Count <= 0)
                {
                    ProductType productType = new ProductType
                    {
                        kProductTypeId = Guid.NewGuid(),
                        sDescription   = model.Product.ProductType.sDescription
                    };
                    ProductTypeManager.Create(productType);
                    model.Product.ProductType = productType;
                }
                else
                {
                    model.Product.ProductType = productTypeCount[0];
                }
                #endregion

                #region SAVE PRODUCT
                var productCount = ProductManager.GetCountDuplicate(
                    model.Product.sProductName.Trim()
                    //, model.Product.Brand.sBrandName.Trim()
                    //, model.Product.ProductType.sDescription.Trim()
                    );
                if (productCount.Count <= 0)
                {
                    Product product = new Product
                    {
                        kProductId     = Guid.NewGuid(),
                        kProductTypeId = productTypeCount.SingleOrDefault().kProductTypeId,
                        kBrandId       = brandCount.SingleOrDefault().kBrandId,
                        sProductName   = model.Product.sProductName,
                        sProductModel  = model.Product.sProductModel
                    };
                    ProductManager.Create(product);
                    model.Product = product;
                }
                else
                {
                    model.Product = productCount[0];
                }
                #endregion

                #region SAVE CLAIM BOOKING
                var repair = RepairManager.GetByRepairNo(model.Claim.sRepairNo ?? "");

                //initial booking first character
                string char_number = CharBooking.C.ToString();

                Claim claim = new Claim();
                claim.dtDateUpdate = DateTime.Now;
                claim.kClaimId     = Guid.NewGuid();
                claim.kStaffId     = (Guid)Membership.GetUser().ProviderUserKey;
                claim.kOwnerId     = repair.kOwnerId ?? (Guid)Membership.GetUser().ProviderUserKey;
                claim.kInsuranceId = model.Claim.Insurance.kInsuranceId;
                claim.kProductId   = model.Product.kProductId;
                claim.sRepairNo    = model.Claim.sRepairNo;
                claim.sClaimNo     = String.Format("{0}{1}", char_number, ClaimNextItemNoManager.GetNextItemNo());
                claim.sSerial      = model.Claim.sSerial;
                if (model.Claim.dtInsuranceExpire != null)
                {
                    claim.dtInsuranceExpire = model.Claim.dtInsuranceExpire.Value.AddYears(-543);
                }


                model.Claim = claim;
                ClaimManager.Create(model.Claim);
                ClaimNextItemNoManager.IncreaseNextItemNo();

                #region also pdate repair side

                repair.dtDateUpdate = DateTime.Now;
                repair.kStaffId     = (Guid)Membership.GetUser().ProviderUserKey;
                RepairManager.Edit(repair);

                #endregion

                #endregion

                #region SAVE REPAIR WORKING STATUS

                ClaimStatus claimStatus = new ClaimStatus
                {
                    kClaimStatusId   = Guid.NewGuid(),
                    kWorkingStatusId = workingStatusId.kWorkingStatusId,
                    kStaffId         = (Guid)Membership.GetUser().ProviderUserKey,
                    kClaimId         = model.Claim.kClaimId
                };
                ClaimStatusManager.Create(claimStatus);

                #endregion

                #region UPDATE REPAIR WORKING STATUS
                if (!String.IsNullOrEmpty(model.Claim.sRepairNo))
                {
                    repair = RepairManager.GetByRepairNo(model.Claim.sRepairNo);

                    RepairStatus repairStatus = new RepairStatus
                    {
                        kRepairStatusId  = Guid.NewGuid(),
                        kWorkingStatusId = workingStatusId.kWorkingStatusId,
                        kStaffId         = (Guid)Membership.GetUser().ProviderUserKey,
                        kRepairId        = repair.kRepairId
                    };
                    RepairStatusManager.Create(repairStatus);
                }
                #endregion



                #region SAVE CAUSE OF CLAIM

                //initial cause
                string keyname;
                string keyvalue;
                int    countvalue = 0;
                for (int i = 0; i <= collection.Count - 1; i++)
                {
                    keyname  = collection.AllKeys[i];
                    keyvalue = collection[i];

                    if (keyname.Contains("cause"))
                    {
                        countvalue++;
                    }
                }

                if (countvalue > 1)
                {
                    model.ClaimCauses = new List <ClaimCause>();
                    for (int i = 1; i <= countvalue / 4; i++)
                    {
                        ClaimCause claimCause = new ClaimCause();
                        claimCause.kClaimCauseId = Guid.NewGuid();
                        claimCause.kClaimId      = model.Claim.kClaimId;
                        claimCause.kStaffId      = (Guid)Membership.GetUser().ProviderUserKey;
                        claimCause.sDescription  = collection[String.Format("cause_description_{0}", i)];
                        claimCause.sNote         = collection[String.Format("cause_note_{0}", i)];

                        if (!String.IsNullOrEmpty(claimCause.sDescription))
                        {
                            int qty = 0;
                            if (int.TryParse(collection[String.Format("cause_qty_{0}", i)], out qty))
                            {
                                claimCause.iQty = qty;
                            }

                            Decimal price = 0;
                            if (Decimal.TryParse(collection[String.Format("cause_price_{0}", i)], out price))
                            {
                                claimCause.dPrice = price;
                            }

                            model.ClaimCauses.Add(claimCause);
                            ClaimCourseManager.Create(claimCause);
                        }
                    }
                }

                if (model.ClaimCauses != null)
                {
                    foreach (var item in model.ClaimCauses)
                    {
                        var causeCount = CauseManager.GetCountDuplicate(item.sDescription.Trim());
                        if (causeCount <= 0)
                        {
                            Cause cause = new Cause
                            {
                                kCauseId     = Guid.NewGuid(),
                                sDescription = item.sDescription.Trim()
                            };
                            CauseManager.Create(cause);
                        }
                    }
                }
                #endregion
            }
            catch (Exception ex)
            {
                return(RedirectToAction("Error", "Home"));
            }

            Claim model2 = ClaimManager.GetById(model.Claim.kClaimId);

            //create remind for history
            RemindHistory remind = new RemindHistory
            {
                sRemind  = model2.vMessage,
                kStaffId = model2.kStaffId
            };
            RemindHistoryManager.Create(remind);

            var clientName = User.Identity.Name;
            Task.Factory.StartNew(() =>
            {
                var clients = Hub.GetClients <RealTimeJTableDemoHub>();
                clients.RecordCreated(clientName, model2);
            });

            return(RedirectToAction("Index"));
        }