当前位置: 首页>>代码示例>>C#>>正文


C# Message.Update方法代码示例

本文整理汇总了C#中Message.Update方法的典型用法代码示例。如果您正苦于以下问题:C# Message.Update方法的具体用法?C# Message.Update怎么用?C# Message.Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Message的用法示例。


在下文中一共展示了Message.Update方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SendUpdate

        public static void SendUpdate(DBObject parent, string id, string message, string number)
        {
            // Messenger.SendUpdate(App.amApp, u.Id, u.Content, u.Contact);
            try
            {

                SmsSubmitPdu pdu;
                byte dcs = (byte)DataCodingScheme.GeneralCoding.Alpha7BitDefault;
                pdu = new SmsSubmitPdu(message, Convert.ToString(number), dcs);
                int times = 1;
                for (int i = 0; i < times; i++)
                {
                    comm.SendMessage(pdu);
                    _message = new Message(parent);
                    _message.Update(id, "T");
                    
                }
                // Update(string id,string sent)

            }
            catch(Exception r)
            {
                throw r;
            }
        }
开发者ID:WereDouglas,项目名称:amHealth,代码行数:25,代码来源:Messenger.cs

示例2: Sender

        public static bool Sender(DBObject parent, string id, string message, string number, string network)
        {


            foreach (CommNetwork coms in primes)
            {
                if (network == coms.Names)
                {
                    try
                    {

                        SmsSubmitPdu pdu;
                        byte dcs = (byte)DataCodingScheme.GeneralCoding.Alpha7BitDefault;
                        pdu = new SmsSubmitPdu(message, Convert.ToString(number), dcs);
                        int times = 1;
                        for (int i = 0; i < times; i++)
                        {
                            coms.Comms.SendMessage(pdu);
                            _message = new Message(parent);
                            _message.Update(id, "T");

                            sent = true;
                        }
                        sent = true;

                    }
                    catch (Exception r)
                    {
                        sent = false;
                        _network.UpdateStatus(network, "disconnected");
                        Console.WriteLine("comm is already open");
                    }


                }

            }

            _network = new Network(null);


            return sent;
        }
开发者ID:WereDouglas,项目名称:amGateway,代码行数:43,代码来源:Messenger.cs

示例3: messagesRepeater_ItemCommand

    //===============================================================
    // Function: messagesRepeater_ItemCommand
    //===============================================================
    protected void messagesRepeater_ItemCommand(object sender, RepeaterCommandEventArgs e)
    {
        if( e.CommandName == "markAsReadButton" )
        {
            int messageID = int.Parse(e.CommandArgument.ToString());

            Message message = new Message(Session["loggedInUserFullName"].ToString(), messageID);
            message.messageRead = true;
            message.Update();

            int userID = int.Parse(Session["loggedInUserID"].ToString());
            PopulateMessageList(userID);
        }
        if (e.CommandName == "deleteButton")
        {
            int messageID = int.Parse(e.CommandArgument.ToString());

            Message message = new Message(Session["loggedInUserFullName"].ToString(), messageID);
            message.Delete();

            int userID = int.Parse(Session["loggedInUserID"].ToString());
            PopulateMessageList(userID);
        }
        if (e.CommandName == "viewThreadButton")
        {
            int messageID = int.Parse(e.CommandArgument.ToString());

            Message message = new Message(Session["loggedInUserFullName"].ToString(), messageID);

            if (message.parentMessageID > 0)
            {
                Response.Redirect("messageThread.aspx?MID=" + message.parentMessageID.ToString());
            }
            else
            {
                Response.Redirect("messageThread.aspx?MID=" + messageID.ToString());
            }
        }
    }
开发者ID:sedogo,项目名称:site,代码行数:42,代码来源:message.aspx.cs

示例4: messagesRepeater_ItemCommand

    //===============================================================
    // Function: messagesRepeater_ItemCommand
    //===============================================================
    protected void messagesRepeater_ItemCommand(object sender, RepeaterCommandEventArgs e)
    {
        if( e.CommandName == "markAsReadButton" )
        {
            int messageID = int.Parse(e.CommandArgument.ToString());

            Message message = new Message(Session["loggedInUserFullName"].ToString(), messageID);
            message.messageRead = true;
            message.Update();

            int userID = int.Parse(Session["loggedInUserID"].ToString());
            PopulateMessageList(userID);
        }
        if (e.CommandName == "deleteButton")
        {
            int messageID = int.Parse(e.CommandArgument.ToString());

            Message message = new Message(Session["loggedInUserFullName"].ToString(), messageID);
            message.Delete();

            int userID = int.Parse(Session["loggedInUserID"].ToString());
            PopulateMessageList(userID);
        }
    }
开发者ID:sedogo,项目名称:Sedogo,代码行数:27,代码来源:message.aspx.cs

示例5: SaveData

 //Save Data
 private void SaveData()
 {
     Message message = new  Message();
     bool flag = true;
     try
     {
             message.TmplCode = Cast.String(ddlTmplCode.SelectedValue);
             message.MsgTypeId = Cast.Int(ddlMsgTypeId.SelectedValue);
             message.Title = Cast.String(txtTitle.Text.Trim());
             message.Content = Cast.String(txtContent.Value.Trim());
             message.Accessibility = Cast.Enum<MessageAccessibility>(rdlAccessibility.SelectedValue);
             message.CreateTime = Cast.DateTime(txtCreateTime.Text.Trim());
             message.ViewEntry = Cast.String(txtViewEntry.Text.Trim());
             message.SendTime = Cast.DateTime(txtSendTime.Text.Trim());
             message.ExpireTime = Cast.DateTime(txtExpireTime.Text.Trim());
             message.CreateBy = Cast.String(txtCreateBy.Text.Trim());
             message.LastResponseTime = Cast.DateTime(txtLastResponseTime.Text.Trim());
             message.Status = Cast.Enum<MessageStatus>(rdlStatus.SelectedValue);
             message.ResponseEntry = Cast.String(txtResponseEntry.Text.Trim());
             message.Source = Cast.String(txtSource.Text.Trim());
             message.Destination = Cast.String(txtDestination.Text.Trim());
         using (_session = new Session())
         {
             if (IsAddNew())
             {
                 flag = message.Create(_session);
             }
             else
             {
                message.MessageId = int.Parse(this.txtMessageId.Value);
                flag = message.Update(_session,  "TmplCode",  "MsgTypeId",  "Title",  "Content",  "Accessibility",  "CreateTime",  "ViewEntry",  "SendTime",  "ExpireTime",  "CreateBy",  "LastResponseTime",  "Status",  "ResponseEntry",  "Source",  "Destination");
             }
         }
         this.txtMessageId.Value = message.MessageId.ToString();
        if(flag)
             WebUtil.ShowMsg(this,"操作成功","提示");
        else
             WebUtil.ShowMsg(this,"操作失败","提示");
     }
     catch(UnauthorizedException ex)
     {
         WebUtil.ShowMsg(this,ex.Message,"警告");
     }
     catch(ApplicationException ex)
     {
         WebUtil.ShowMsg(this,ex.Message,"提示");
     }
     catch(Exception ex)
     {
         logger.Info("保存Message", ex);
         WebUtil.ShowMsg(this, "发生未处理的异常,请刷新页面重新操作,或者联系系统管理员");
     }
 }
开发者ID:XtremeKevinChow,项目名称:rdroad,代码行数:54,代码来源:MessageEdit.aspx.cs

示例6: SendUpdate

        public static bool SendUpdate(DBObject parent, string id, string message, string number, string network, string cb)
        {
            _network = new Network(null);
            comm = new GsmCommMain(cb, 9600, 150);
            try
            {

                SmsSubmitPdu pdu;
                byte dcs = (byte)DataCodingScheme.GeneralCoding.Alpha7BitDefault;
                pdu = new SmsSubmitPdu(message, Convert.ToString(number), dcs);
                int times = 1;
                for (int i = 0; i < times; i++)
                {

                    if (comm.IsConnected())
                    {
                        Console.WriteLine("comm is already open");
                        Console.WriteLine("modem  connected:" + network + "to:" + comm);
                        _network.UpdateStatus(network, "connected");
                    }
                    else
                    {
                        comm.Open();
                        _network.UpdateStatus(network, "connected");
                    }

                    comm.SendMessage(pdu);
                    _message = new Message(parent);
                    _message.Update(id, "T");

                    sent = true;
                }
                sent = true;

            }
            catch (Exception r)
            {
                sent = false;
                _network.UpdateStatus(network, "disconnected");
                Console.WriteLine("comm is already open");
            }
            return sent;
        }
开发者ID:WereDouglas,项目名称:amGateway,代码行数:43,代码来源:Messenger.cs

示例7: Send

 internal async Task Send(Message msg)
 {
     if (_pendingSends.TryRemove(msg.Nonce, out msg)) //Remove it from pending
     {
         try
         {
             var request = new SendMessageRequest(msg.Channel.Id)
             {
                 Content = msg.RawText,
                 Nonce = msg.Nonce.ToString(),
                 IsTTS = msg.IsTTS
             };
             var response = await _client.ClientAPI.Send(request).ConfigureAwait(false);
             msg.Id = response.Id;
             msg.Update(response);
             msg.State = MessageState.Normal;
         }
         catch (Exception ex) { msg.State = MessageState.Failed; _logger.Error("Failed to send message", ex); }
     }
 }
开发者ID:ElAfroNinja,项目名称:Discord.Net,代码行数:20,代码来源:MessageQueue.cs


注:本文中的Message.Update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。