Example #1
0
 void Update()
 {
     if (canEsc && (Input.GetKeyDown(KeyCode.Escape)))
     {
         GameObject map = GameObject.Find("Canvas/layer_0/MapModule");
         if (map != null)
         {
             canEsc = false;
             ConfirmInfo confirmInfo = new ConfirmInfo(LanguageUtil.GetTxt(11604), LanguageUtil.GetTxt(11603), ExitGame, NotExit, false);
             ConfirmModel.Instance.AddConfirm(confirmInfo);
         }
         else
         {
             GameObject fight = GameObject.Find("Canvas/layer_0/FightModule");
             if (fight != null)
             {
                 GameObject pause = GameObject.Find("Canvas/layer_8/PauseModule");
                 if (pause == null)
                 {
                     GameMgr.moduleMgr.AddUIModule(ModuleEnum.PAUSE);
                 }
             }
             else
             {
                 GameMgr.moduleMgr.AddUIModule(ModuleEnum.MAP);
             }
         }
     }
 }
Example #2
0
    private void InitView()
    {
        crtConfirm = ConfirmModel.Instance.crtConfirm;

        contentTrans.GetComponentInChildren <Text>().text = crtConfirm.content;

        if (crtConfirm.title == "")
        {
            titleTrans.gameObject.SetActive(false);
        }
        else
        {
            titleTrans.GetComponentInChildren <Text>().text = crtConfirm.title;
        }

        if (crtConfirm.noEvent == null)
        {
            noBtn.gameObject.SetActive(false);
            okBtn.GetComponentInChildren <Text>().text = LanguageUtil.GetTxt(11605);
        }
        else
        {
            noBtn.GetComponentInChildren <Text>().text = LanguageUtil.GetTxt(11607);
            okBtn.GetComponentInChildren <Text>().text = LanguageUtil.GetTxt(11606);
        }

        closeBtn.gameObject.SetActive(crtConfirm.canClose);
    }
Example #3
0
 public void RemoveConfirm()
 {
     crtConfirm = null;
     ModuleModel.Instance.RemoveUIModule((int)ModuleEnum.CONFIRM);
     ScreenSlider.SlideOpen = true;
     ShowConfirm();
 }
Example #4
0
        public InterfaceRet CommitConfirm(string data)
        {
            _ret.Clear();
            ConfirmInfo input  = Newtonsoft.Json.JsonConvert.DeserializeObject <ConfirmInfo>(data);
            string      strSql = @"insert into TAB_Plan_WorkFlow_Confirm (strUserNumber,strUserName,dtConfirmTime,strTrainmanNumber,
                strTrainmanName,dtChuqinTime,strTrainNo,strPlanID,strFlowType,strConfirmBrief,strWorkShopGUID,strWorkShopName) values (@strUserNumber,@strUserName,@dtConfirmTime,@strTrainmanNumber,
                @strTrainmanName,@dtChuqinTime,@strTrainNo,@strPlanID,@strFlowType,@strConfirmBrief,@strWorkShopID,@strWorkShopName)";

            SqlParameter[] sqlParams = new SqlParameter[] {
                new SqlParameter("strUserNumber", input.userNumber),
                new SqlParameter("strUserName", input.userName),
                new SqlParameter("dtConfirmTime", input.confirmTime),
                new SqlParameter("strTrainmanNumber", input.trainmanNumber),
                new SqlParameter("strTrainmanName", input.trainmanName),
                new SqlParameter("dtChuqinTime", input.chuqinTime),
                new SqlParameter("strTrainNo", input.trainNo),
                new SqlParameter("strPlanID", input.planID),
                new SqlParameter("strFlowType", input.flowType),
                new SqlParameter("strConfirmBrief", input.confirmBrief),
                new SqlParameter("strWorkShopID", input.workShopID),
                new SqlParameter("strWorkShopName", input.workShopName)
            };
            SqlHelper.ExecuteNonQuery(SqlHelper.ConnString, CommandType.Text, strSql, sqlParams);
            return(_ret);
        }
Example #5
0
 public void RemoveConfirm()
 {
     crtConfirm = null;
     GameMgr.moduleMgr.RemoveUIModule(ModuleEnum.CONFIRM);
     ScreenSlider.SlideOpen = true;
     ShowConfirm();
 }
Example #6
0
    public void RefreshCell()
    {
        safeCount++;
        if (safeCount > 1000)
        {
            safeCount = 0;
            ConfirmInfo confirmInfo = new ConfirmInfo(LanguageUtil.GetTxt(11602), LanguageUtil.GetTxt(11601), ExitFight, null, false);
            ConfirmModel.Instance.AddConfirm(confirmInfo);
            return;
        }

        CellModel.Instance.anims = new List <List <CellAnimInfo> > ();

        List <CellInfo> allElments = new List <CellInfo> ();

        for (int i = 0; i < BattleModel.Instance.crtBattle.ShowHeight(); i++)
        {
            List <CellInfo> xCells = CellModel.Instance.allCells[i];
            for (int j = 0; j < xCells.Count; j++)
            {
                CellInfo cellInfo = xCells[j];
                if (cellInfo.isBlank == false && cellInfo.isMonsterHold == false && cellInfo.config.cell_type == (int)CellType.five)
                {
                    CoverInfo coverInfo = CoverModel.Instance.GetCoverByPos(cellInfo.posY, cellInfo.posX);
                    if (coverInfo.IsNull())
                    {
                        allElments.Add(cellInfo);
                    }
                }
            }
        }

        int switchTimes = 0;

        while (allElments.Count > 1)
        {
            int      randomA = UnityEngine.Random.Range(0, allElments.Count);
            CellInfo cellA   = allElments[randomA];
            allElments.RemoveAt(randomA);

            int      randomB = UnityEngine.Random.Range(0, allElments.Count);
            CellInfo cellB   = allElments[randomB];
            allElments.RemoveAt(randomB);

            switchTimes++;
            CellModel.Instance.SwitchPos(cellA, cellB);
            cellA.SwitchPos(cellB);
        }

        if (FuncCheckDead.IsDead())
        {
            RefreshCell();
        }
        else
        {
            safeCount = 0;
        }
    }
Example #7
0
 private void OnOk(GameObject go)
 {
     if (crtConfirm.okEvent != null)
     {
         crtConfirm.okEvent();
     }
     crtConfirm = null;
     ConfirmModel.Instance.RemoveConfirm();
 }
Example #8
0
 private void ShowConfirm()
 {
     if (confirmInfos.Count > 0 && crtConfirm == null)
     {
         crtConfirm = confirmInfos[0];
         confirmInfos.RemoveAt(0);
         if (crtConfirm != null)
         {
             ModuleModel.Instance.AddUIModule((int)ModuleEnum.CONFIRM);
         }
     }
 }
Example #9
0
 private void ShowConfirm()
 {
     if (confirmInfos.Count > 0 && crtConfirm == null)
     {
         crtConfirm = confirmInfos[0];
         confirmInfos.RemoveAt(0);
         if (crtConfirm != null)
         {
             GameMgr.moduleMgr.AddUIModule(ModuleEnum.CONFIRM);
         }
     }
 }
Example #10
0
        public void CreateConfirm(ConfirmInfo value)
        {
            SqlConnectionFactory sqlConnection = new SqlConnectionFactory();
            PracticeInfo         record        = new PracticeInfo();

            using (SqlConnection connection = sqlConnection.GetConnection())
            {
                //string applicationId = EncryptionUtils.GetApplicationId();
                //string applicationName = EncryptionUtils.GetApplicationName();

                PracticeDataLayer.GetInstance().CreateConfirm(connection, value);
            }
        }
Example #11
0
        // POST api/Confirm
        public ActionMessage Post([FromBody] ConfirmInfo item)
        {
            ActionMessage ret = new ActionMessage();

            ret.isSuccess = true;
            try
            {
                PracticeService.GetInstance().CreateConfirm(item);
            }
            catch (Exception ex)
            {
                ret.isSuccess     = false;
                ret.err.msgCode   = "Internal Error !!!";
                ret.err.msgString = ex.ToString();
            }
            return(ret);
        }
Example #12
0
 public void CreateConfirm(SqlConnection connection, ConfirmInfo value)
 {
     using (var command = new SqlCommand(" INSERT INTO [dbo].[tbl_Confirm] " +
                                         " (AnalyzerCode,AnalyzerName,EmployeeID,Name,DepartmentID,DepartmentName) " +
                                         " VALUES(@AnalyzerCode,(select AnalyzerName from tbl_Analyzer where AnalyzerCode=@AnalyzerCode), " +
                                         " @EmployeeID,@Name,@DepartmentID,(select DepartmentName from tbl_Department where DepartmentID=@DepartmentID)) ", connection))
     {
         AddSqlParameter(command, "@AnalyzerCode", value.AnalyzerCode, System.Data.SqlDbType.NVarChar);
         //AddSqlParameter(command, "@AnalyzerName", value.AnalyzerName, System.Data.SqlDbType.NVarChar);
         AddSqlParameter(command, "@EmployeeID", value.EmployeeID, System.Data.SqlDbType.Int);
         AddSqlParameter(command, "@Name", value.Name, System.Data.SqlDbType.NVarChar);
         AddSqlParameter(command, "@DepartmentID", value.DepartmentID, System.Data.SqlDbType.Int);
         //AddSqlParameter(command, "@DepartmentName", value.DepartmentName, System.Data.SqlDbType.NVarChar);
         WriteLogExecutingCommand(command);
         command.ExecuteScalar();
     }
 }
Example #13
0
    public void ConnectConfirm()
    {
        client.CloseSocket();
        client.OnConnectedToServer("192.168.0.192", 8809);
        Thread.Sleep(3000);
        ConfirmInfo confirmInfo = new ConfirmInfo();

        confirmInfo.type   = 1;
        confirmInfo.token  = this.token;
        confirmInfo.userId = this.userId;
        confirmInfo.roleId = this.roleId;
        string             json    = JsonConvert.SerializeObject(confirmInfo);
        GateMessageRequest request = new GateMessageRequest();

        request.message = json;
        client.SendGameMessage(request);
    }
Example #14
0
 private void OnClose(GameObject go)
 {
     crtConfirm = null;
     ConfirmModel.Instance.RemoveConfirm();
 }
Example #15
0
 public void AddConfirm(ConfirmInfo confirmInfo)
 {
     confirmInfos.Add(confirmInfo);
     ShowConfirm();
 }