本文整理汇总了C#中Messages.save方法的典型用法代码示例。如果您正苦于以下问题:C# Messages.save方法的具体用法?C# Messages.save怎么用?C# Messages.save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Messages
的用法示例。
在下文中一共展示了Messages.save方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Button1_Click
protected void Button1_Click(object sender, EventArgs e)
{
try
{
int mid = 1, msgid = 1;
//System.Windows.Forms.MessageBox.Show("Before alert " + Request.Params.Get("alert"));
if (Request.Params.Get("alert") != null)
{
//System.Windows.Forms.MessageBox.Show("In alert ");
Mails m;
Messages mg;
Clock c;
bool MailEnabled = (Request.Params.Get("mail") != null);
bool MessageEnabled = Request.Params.Get("message") != null;
if (MailEnabled || MessageEnabled)
{
c = InitializeClock();
c.Save();
if (MailEnabled)
{
Label1.Text += " Mail ";
m = new Mails(-1, TextBox1.Text, TextBox2.Text, TextBox3.Text, c.getId());
m.save();
mid = m.getId();
}
if (MessageEnabled)
{
Label1.Text += " Message";
mg = new Messages(-1, TextBox4.Text, TextBox6.Text, c.getId());
mg.save();
msgid = mg.getId();
}
}
}
// System.Windows.Forms.MessageBox.Show("Before saving");
Label1.Text += " Remainder";
Reminder r = new Reminder(u.getUserName(), Calendar1.SelectedDate.ToString("dd/MMM/yyyy"), DropDownList10.SelectedItem.Text, TextBox7.Text, mid, msgid);
// System.Windows.Forms.MessageBox.Show("After saving");
Label1.Text = r.getQuery();
if (r.save())
{
/*Response.Write("<script language='javascript'>"+
"alert('Reminder added successfully..');"+
"window.open('./RemindersList.aspx');"+
"alert('new Page');"+
"</script>");*/
Response.Redirect("RemindersList.aspx");
}
else
Response.Write("<script language='javascript'>alert('An error occured in saving your reminder , try again after few seconds');</script>");
}
catch (Exception ee) { Response.Write(ee.Message); }
}
示例2: FormView2_ItemUpdated
protected void FormView2_ItemUpdated(object sender, FormViewUpdatedEventArgs e)
{
int MsgId = (int)Session["MSGID"];
if (MsgId == DEFAULT_MSGID) // 114 --> Default MessageId
{
// Creating New Message
Messages Default = Messages.getById(MsgId);
Messages NewMessage = new Messages(-1, Default.getDestNumber(), Default.getMessage(), Default.getClockId());
//Clearing Default Message
Default.setDestNumber("");
Default.setMessage("");
Default.update();
NewMessage.save();
Session.Add("MSGID", NewMessage.getId());
//System.Windows.Forms.MessageBox.Show(NewMessage.getId() + "");
//Updating MessagesId of Reminder
Reminder r = Reminder.getById(((int)Session["RID"]));
r.setMessageId(NewMessage.getId());
r.update();
//System.Windows.Forms.MessageBox.Show("Reminder Updated");
}
}