Beispiel #1
0
    void ShowTalk(TalkInfo info)
    {
        PlayerManager.Lock();
        WillTool.GetChildInDepth <Text>("Name", transform).text    = info.name;
        WillTool.GetChildInDepth <Text>("Content", transform).text = info.content;
        WillTool.GetChildInDepth <TypewriterEffect>("Content", transform).OnStart();

        GameObject imageTarget  = null;
        GameObject imageTarget1 = WillTool.GetChildInDepth("Image1", this.gameObject);
        GameObject imageTarget2 = WillTool.GetChildInDepth("Image2", this.gameObject);

        imageTarget1.SetActive(false);
        imageTarget2.SetActive(false);
        if (info.bShowLeft)
        {
            imageTarget = imageTarget1;
        }
        else
        {
            imageTarget = imageTarget2;
        }
        if (string.IsNullOrEmpty(info.imageSource))
        {
        }
        else
        {
            imageTarget.SetActive(true);
            imageTarget.GetComponent <Image>().sprite = Resources.Load <Sprite>(info.imageSource);
        }
    }
Beispiel #2
0
        /// <summary>
        /// 获取正在通话的集合
        /// </summary>
        /// <returns></returns>
        public static void GeTalkInfos(ref List <TalkInfo> list)
        {
            //list = new List<TalkInfo>();
            string sql = "SELECT * FROM ipvt_talkinginfotable";

            MySqlDataReader reader = null;

            try
            {
                reader = CustomMySqlHelper.ExecuteDataReader(sql);
                if (reader != null)
                {
                    while (reader.Read())
                    {
                        var info = new TalkInfo();
                        info.From = reader["caller"].ToString();
                        info.To   = reader["callee"].ToString();

                        list.Add(info);
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.MainLog("error in GeTalkInfos()!ex:" + ex);
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
            }
        }
Beispiel #3
0
 private void FillData(TalkInfo entity)
 {
     entity.Title = txtTitle.Value;
     entity.Tag = txtTag.Value;
     entity.Content = GetString("txtContent");
     entity.CorporationID = GetInt("corpid");
     entity.Realname = Admin.Realname;
 }
Beispiel #4
0
 private void FillData(TalkInfo entity)
 {
     entity.Title         = txtTitle.Value;
     entity.Tag           = txtTag.Value;
     entity.Content       = GetString("txtContent");
     entity.CorporationID = GetInt("corpid");
     entity.Realname      = Admin.Realname;
 }
Beispiel #5
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            TalkInfo entity = new TalkInfo();
            int id = GetInt("id");
            if (id > 0) entity = Talks.Instance.GetModel(id, true);
            FillData(entity);

            if (id > 0) Talks.Instance.Update(entity);
            else Talks.Instance.Add(entity);

            Talks.Instance.ReloadTalkListCache();

            Response.Redirect(string.IsNullOrEmpty(FromUrl) ? "talkmg.aspx" : FromUrl);
        }
Beispiel #6
0
        private void LoadData()
        {
            int id = GetInt("id");
            if (id > 0)
            {
                CurrentTalk = Talks.Instance.GetModel(id);
                if (CurrentTalk == null)
                    WriteMessage("/message.aspx", "系统提示", "无效话术信息!", "", "/index.aspx");
                else
                {
                    if (!Admin.Administrator && Admin.CorporationID != CurrentTalk.CorporationID)
                        WriteMessage("/message.aspx", "系统提示", "没有权限!", "", "/index.aspx");

                    txtTitle.Value = CurrentTalk.Title;
                    txtTag.Value = CurrentTalk.Tag;
                }
            }
        }
Beispiel #7
0
        private void LoadData()
        {
            int id = GetInt("id");

            if (id > 0)
            {
                CurrentTalk = Talks.Instance.GetModel(id);
                if (CurrentTalk == null)
                {
                    WriteMessage("/message.aspx", "系统提示", "无效话术信息!", "", "/index.aspx");
                }
                else
                {
                    if (!Admin.Administrator && Admin.CorporationID != CurrentTalk.CorporationID)
                    {
                        WriteMessage("/message.aspx", "系统提示", "没有权限!", "", "/index.aspx");
                    }

                    txtTitle.Value = CurrentTalk.Title;
                    txtTag.Value   = CurrentTalk.Tag;
                }
            }
        }
Beispiel #8
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            TalkInfo entity = new TalkInfo();
            int      id     = GetInt("id");

            if (id > 0)
            {
                entity = Talks.Instance.GetModel(id, true);
            }
            FillData(entity);

            if (id > 0)
            {
                Talks.Instance.Update(entity);
            }
            else
            {
                Talks.Instance.Add(entity);
            }

            Talks.Instance.ReloadTalkListCache();

            Response.Redirect(string.IsNullOrEmpty(FromUrl) ? "talkmg.aspx" : FromUrl);
        }
Beispiel #9
0
 public void Update(TalkInfo entity)
 {
     CommonDataProvider.Instance().UpdateTalk(entity);
 }
Beispiel #10
0
 public void Add(TalkInfo entity)
 {
     CommonDataProvider.Instance().AddTalk(entity);
 }
Beispiel #11
0
    void LoadData()
    {
        // 독스가 생기면 추가해 줘야됨.
        WWWData.RequestReadFromGoogleDrive((int)DocsDown.DocsNumber.Sound, (WWWData docs) =>
        {
            SoundSCV[] infos = Utils.GetInstance_Docs <SoundSCV[]>(docs.Lines);
            if (infos.Length > 0)
            {
                //m_tutorialTable = SetTutorialData(infos);

                for (int i = 0; i < infos.Length; i++)
                {
                    SoundInfo data = new SoundInfo(infos[i]);
                    m_SoundTable.Add(data);
                }
                // GameDefine.IsLoadAssetBundleOK = true;
            }
        });

        WWWData.RequestReadFromGoogleDrive((int)DocsDown.DocsNumber.StoryUIDesine, (WWWData docs) =>
        {
            StoryUIDesineCSV[] infos = Utils.GetInstance_Docs <StoryUIDesineCSV[]>(docs.Lines);
            if (infos.Length > 0)
            {
                for (int i = 0; i < infos.Length; i++)
                {
                    StoryUIDesineInfo data = new StoryUIDesineInfo(infos[i]);
                    m_StoryUIDesineTable.Add(data);
                }
                //  GameDefine.IsLoadDataDocs = true;
            }
        });

        WWWData.RequestReadFromGoogleDrive((int)DocsDown.DocsNumber.Talk, (WWWData docs) =>
        {
            TalkCSV[] infos = Utils.GetInstance_Docs <TalkCSV[]>(docs.Lines);
            if (infos.Length > 0)
            {
                for (int i = 0; i < infos.Length; i++)
                {
                    TalkInfo data = new TalkInfo(infos[i]);
                    m_TalkTable.Add(data);
                }
                // GameDefine.IsLoadDataDocs = true;
            }
        });

        WWWData.RequestReadFromGoogleDrive((int)DocsDown.DocsNumber.StageMapSetting, (WWWData docs) =>
        {
            StageMapSettingCSV[] infos = Utils.GetInstance_Docs <StageMapSettingCSV[]>(docs.Lines);
            if (infos.Length > 0)
            {
                for (int i = 0; i < infos.Length; i++)
                {
                    StageMapSettingInfo data = new StageMapSettingInfo(infos[i]);
                    m_StageMapSettingTable.Add(data);
                }
                GameDefine.IsLoadDataDocs = true;
            }
        });
    }
 public override void AddTalk(TalkInfo entity)
 {
     string sql = @"INSERT INTO ComOpp_Talk(
         [Title]
         ,[Content]
         ,[Tag]
         ,[Realname]
         ,[PublicUserID]
         ,[CorporationID]
     )VALUES(
         @Title
         ,@Content
         ,@Tag
         ,@Realname
         ,@PublicUserID
         ,@CorporationID
     )";
     SqlParameter[] p =
     {
         new SqlParameter("@Title",entity.Title),
         new SqlParameter("@Content",entity.Content),
         new SqlParameter("@Tag",entity.Tag),
         new SqlParameter("@Realname",entity.Realname),
         new SqlParameter("@PublicUserID",entity.PublicUserID),
         new SqlParameter("@CorporationID",entity.CorporationID)
     };
     SqlHelper.ExecuteNonQuery(_con, CommandType.Text, sql, p);
 }
 public override void UpdateTalk(TalkInfo entity)
 {
     string sql = @"
     UPDATE ComOpp_Talk set
         Title = @Title
         ,Content = @Content
         ,Tag = @Tag
     WHERE ID=@ID";
     SqlParameter[] parameters =
     {
         new SqlParameter("@ID", entity.ID),
         new SqlParameter("@Title", entity.Title),
         new SqlParameter("@Content", entity.Content),
         new SqlParameter("@Tag", entity.Tag)
     };
     SqlHelper.ExecuteNonQuery(_con, CommandType.Text, sql, parameters);
 }
Beispiel #14
0
 public abstract void UpdateTalk(TalkInfo entity);
Beispiel #15
0
 public abstract void AddTalk(TalkInfo entity);
Beispiel #16
0
        public static TalkInfo PopulateTalkInfo(IDataReader reader)
        {
            TalkInfo entity = new TalkInfo()
            {
                ID = (int)reader["ID"],
                Title = reader["Title"] as string,
                Content = reader["Content"] as string,
                Tag = reader["Tag"] as string,
                Realname = reader["Realname"] as string,
                PublicUserID = (int)reader["PublicUserID"],
                AddTime = DataConvert.SafeDate(reader["AddTime"]),
                CorporationID = (int)reader["CorporationID"]
            };

            return entity;
        }