本文整理汇总了C#中TimeOfDay.LitePopulate方法的典型用法代码示例。如果您正苦于以下问题:C# TimeOfDay.LitePopulate方法的具体用法?C# TimeOfDay.LitePopulate怎么用?C# TimeOfDay.LitePopulate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TimeOfDay
的用法示例。
在下文中一共展示了TimeOfDay.LitePopulate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
HtmlGenericControl _nc = (HtmlGenericControl)Master.FindControl("navThemes");
_nc.Attributes.Add("class", "active");
dd_Status.DataSource = this.LogedInUser.GetAllStatuses();
dd_Status.DataTextField = "Description";
dd_Status.DataValueField = "ID";
dd_Status.DataBind();
dd_Status.Items.FindByValue("3").Selected = true;
String _Id = Request.QueryString["Id"];
if (!String.IsNullOrEmpty(_Id))
{
ViewState.Add("Id", _Id);
TimeOfDay _time = new TimeOfDay(this.ConnectionString);
_time.LitePopulate(_Id, false);
lbl_Header.Text = String.Format("Edit {0}", _time.Description);
txt_Desc.Text = _time.Description;
if (dd_Status.Items.FindByValue(_time.Status.ToString()) != null)
{
dd_Status.ClearSelection();
dd_Status.Items.FindByValue(_time.Status.ToString()).Selected = true;
}
val_File.Enabled = false;
}
else
{
lbl_Header.Text = "Add New Time of Day";
}
}
}
示例2: 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();
}
示例3: 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;
}
}
}