Beispiel #1
0
        //[DllImport("winmm.dll",CharSet = CharSet.Ansi)]
        //public static extern long mciSendString(string command, StringBuilder retString, int returnPath, IntPtr callBack);

        //public ContactStudents()
        //{
        //    mciSendString("open new Type waveaudio alias recsound ", null, 0, IntPtr.Zero);
        //    //mciSendString("set capture samplespersec 11025", null, 0, IntPtr.Zero);//11025,22050,44100
        //    //mciSendString("set capture channels 1", null, 0, IntPtr.Zero);
        //}
        //[System.Web.Services.WebMethod]
        //public static void RecordVoice()//(string userID, string idOnChat, string idGrp, Object msg, int idMsgReplayed)
        //{
        //    mciSendString("record recsound", null, 0, IntPtr.Zero);

        //}
        //[System.Web.Services.WebMethod]
        //public static string SaveVoice(string userID, string idOnChat, string idGrp, string msg, int idMsgReplayed)
        //{
        //    const int flagVoice = 2;
        //    var voice = Functions.MessageJs.InsertMessage(userID, idOnChat, idGrp, msg, idMsgReplayed, flagVoice, ".wav");
        //    JObject jsonVoice = JObject.Parse(voice.Substring(1, voice.Length - 2));
        //    var path = System.Web.Hosting.HostingEnvironment.MapPath("~/Contact/SoundRecorder");
        //    string command = "save recsound \"" + path + "\\" + jsonVoice["ChatID_P"] + ".wav \"";
        //    mciSendString("pause recsound", null, 0, IntPtr.Zero);
        //    mciSendString(command, null, 0, IntPtr.Zero);
        //    mciSendString("close recsound", null, 0, IntPtr.Zero);

        //    return voice;
        //}
        public void RfrhDtLstMessage(bool flagGroup)
        {
            DtLstMesages.DataSource = null;
            DtLstMesages.DataBind();
            DataTable dt;

            if (flagGroup == false && TxtIdOnChat.Text.Trim() != "")
            {
                LblNameOnChat.Text = "گفتگو شخصی";
                dt = MessagePersonalBuisnes.GetMessagePersonal(userID_Student, TxtIdOnChat.Text);
            }
            else
            {
                LblNameOnChat.Text = "گفتگو دفاع";
                dt = MesageGroupBuisnes.GetMessageGroup(userID_Student, userID_Student);
            }
            if (dt != null && dt.Rows.Count > 0)
            {
                dt = Functions.AddDefualt.GetDefualt(dt);
                DtLstMesages.DataSource = dt;
                DtLstMesages.DataBind();
                if (dt.Rows[dt.Rows.Count - 1]["ChatID"] != null)
                {
                    LblLastIdChat.Text = dt.Rows[dt.Rows.Count - 1]["ChatID"].ToString();
                }
            }
        }
Beispiel #2
0
        public void RfrhDtLstMessage(bool flagGroup)
        {
            DtLstMesages.DataSource = null;
            DtLstMesages.DataBind();
            DataTable dt;

            if (flagGroup == false && TxtIdOnChat.Text.Trim() != "")
            {
                dt = MessagePersonalBuisnes.GetMessagePersonal(userID_Ostad, TxtIdOnChat.Text);
            }
            else
            {
                dt = null;
                //   dt = MesageGroupBuisnes.GetMessageGroup(userID_Ostad);
            }
            if (dt != null && dt.Rows.Count > 0)
            {
                DtLstMesages.DataSource = dt;
                DtLstMesages.DataBind();
            }
        }
        public void RfrhDtLstMessage(bool flagGroup)
        {
            DtLstMesages.DataSource = null;
            DtLstMesages.DataBind();
            DataTable dt;

            if (flagGroup == false && TxtIdOnChat.Text.Trim() != "")
            {
                LblNameOnChat.Text = "گفتگو شخصی";
                dt = MessagePersonalBuisnes.GetMessagePersonal(txtStCode.Text, TxtIdOnChat.Text);
            }
            else
            {
                LblNameOnChat.Text = "گفتگو دفاع";
                dt = MesageGroupBuisnes.GetMessageGroup(txtStCode.Text, txtStCode.Text);
            }
            if (dt != null && dt.Rows.Count > 0)
            {
                dt = GetDefualt(dt);
                DtLstMesages.DataSource = dt;
                DtLstMesages.DataBind();
            }
        }