本文整理汇总了C#中TimeOfDay.Save方法的典型用法代码示例。如果您正苦于以下问题:C# TimeOfDay.Save方法的具体用法?C# TimeOfDay.Save怎么用?C# TimeOfDay.Save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TimeOfDay
的用法示例。
在下文中一共展示了TimeOfDay.Save方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Updade_Click
protected void Updade_Click(object sender, EventArgs e)
{
TimeOfDay _st = null;
foreach (GridViewRow I in gv_Themes.Rows)
{
Label _id = (Label)I.FindControl("lbl_Id");
if (_id != null)
{
TextBox _sort = (TextBox)I.FindControl("txt_Sort");
if (Regex.IsMatch(_sort.Text, @"\d+", RegexOptions.IgnoreCase))
{
_st = new TimeOfDay(this.ConnectionString);
_st.LitePopulate(_id.Text, false);
_st.Sort = Convert.ToInt32(_sort.Text);
_st.Save();
}
}
}
BindData();
}
示例2: Save_Click
protected void Save_Click(object sender, EventArgs e)
{
if (IsValid)
{
TimeOfDay _time = new TimeOfDay(this.ConnectionString);
if (ViewState["Id"] != null)
{
_time.LitePopulate(ViewState["Id"], false);
}
_time.Description = txt_Desc.Text;
_time.Status = Convert.ToInt32(dd_Status.SelectedValue);
String _imgType = "";
if (fu_File.HasFile)
{
_imgType = fu_File.FileName.Split('.')[1];
_time.ImgType = _imgType;
}
if (_time.Save())
{
if (fu_File.HasFile)
{
String _path = Server.MapPath(String.Format(ConfigurationManager.AppSettings["TimeOfDayImagesPath"], _time.ID.ToString(), _imgType));
fu_File.SaveAs(_path);
}
this.ClientScript.RegisterClientScriptBlock(this.GetType(), "MyScript", "alert('Record has been updated successfully.');self.location = 'Timeofdays.aspx';", true);
PortalCacheFactory.RefreshTimeOfDay();
}
else
{
lbl_Error.Text = "An unexpected error has occurred. Please try again.";
lbl_Error.Visible = true;
}
}
}