本文整理汇总了C#中Events.LitePopulate方法的典型用法代码示例。如果您正苦于以下问题:C# Events.LitePopulate方法的具体用法?C# Events.LitePopulate怎么用?C# Events.LitePopulate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Events
的用法示例。
在下文中一共展示了Events.LitePopulate方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BindData
private void BindData()
{
Events _ev = new Events(this.ConnectionString);
_ev.LitePopulate(ViewState["parentId"], true);
_ev.EventsCollection.Sort("Sort", CoreLibrary.GenericComparer<CoreLibrary.BaseBusinessClass>.SortOrder.Ascending);
dgPhotos.DataSource = _ev.EventsCollection;
dgPhotos.DataBind();
lbl_Header.Text = _ev.Title;
}
示例2: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
HtmlGenericControl _nc = (HtmlGenericControl)Master.FindControl("navEvents");
_nc.Attributes.Add("class", "active");
dd_Status.DataSource = this.LogedInUser.GetAllStatuses();
dd_Status.DataTextField = "Description";
dd_Status.DataValueField = "ID";
dd_Status.DataBind();
String _eventId = Request.QueryString["eventId"];
ViewState.Add("parentId", Request.QueryString["parentId"]);
if (!String.IsNullOrEmpty(_eventId))
{
ViewState.Add("eventId", _eventId);
Events _event = new Events(this.ConnectionString);
_event.LitePopulate(_eventId, false);
txt_Title.Text = HttpUtility.HtmlDecode(_event.Title);
txt_Desc.Text = HttpUtility.HtmlDecode(_event.Description);
if (dd_Status.Items.FindByValue(_event.Status.ToString()) != null)
{
dd_Status.ClearSelection();
dd_Status.Items.FindByValue(_event.Status.ToString()).Selected = true;
}
lbl_Header.Text = HttpUtility.HtmlDecode(_event.Title);
val_BigImg.Enabled = false;
val_SmlImg.Enabled = false;
val_Thumb.Enabled = false;
}
else
{
lbl_Header.Text = "Add Event";
}
}
}
示例3: UpdateSort_OnClick
protected void UpdateSort_OnClick(object sender, EventArgs e)
{
Events _ev = new Events(this.ConnectionString);
_ev.LitePopulate(ViewState["parentId"], true);
foreach (GridViewRow I in dgPhotos.Rows)
{
Label _id = (Label)I.FindControl("lbl_Id");
if (_id != null)
{
TextBox _sort = (TextBox)I.FindControl("txt_Sort");
if (Regex.IsMatch(_sort.Text, @"^\d+$"))
{
Events _nEv = (Events)_ev.EventsCollection.FindByID(_id.Text);
_nEv.Sort = Convert.ToInt32(_sort.Text);
_nEv.Save();
}
}
}
BindData();
}
示例4: Save_OnClick
protected void Save_OnClick(object sender, EventArgs e)
{
if (IsValid)
{
Events _event = new Events(this.ConnectionString);
if (ViewState["eventId"] != null)
{
_event.LitePopulate(ViewState["eventId"], false);
}
if (ViewState["parentId"] != null)
{
_event.ParentId = Convert.ToInt32(ViewState["parentId"]);
}
_event.Title = HttpUtility.HtmlEncode(txt_Title.Text);
_event.Description = HttpUtility.HtmlEncode(txt_Desc.Text);
_event.Status = Convert.ToInt32(dd_Status.SelectedValue);
String _BigImgType = "";
if (fu_BigImg.HasFile)
{
_BigImgType = fu_BigImg.FileName.Split('.')[1];
_event.BigImgType = _BigImgType;
}
String _SmlImgType = "";
if (fu_SmlImg.HasFile)
{
_SmlImgType = fu_SmlImg.FileName.Split('.')[1];
_event.SmlImgType = _SmlImgType;
}
String _ThumImgType = "";
if (fu_Thumb.HasFile)
{
_ThumImgType = fu_Thumb.FileName.Split('.')[1];
_event.ThumbnailImgType = _ThumImgType;
}
if (_event.Save())
{
String _path;
if (fu_BigImg.HasFile)
{
_path = Server.MapPath(String.Format(ConfigurationManager.AppSettings["EventLargeImgPath"], _event.ID.ToString(), _BigImgType));
fu_BigImg.SaveAs(_path);
}
if (fu_SmlImg.HasFile)
{
_path = Server.MapPath(String.Format(ConfigurationManager.AppSettings["EventSmallImgPath"], _event.ID.ToString(), _SmlImgType));
fu_SmlImg.SaveAs(_path);
}
if (fu_Thumb.HasFile)
{
_path = Server.MapPath(String.Format(ConfigurationManager.AppSettings["EventThumbImgPath"], _event.ID.ToString(), _ThumImgType));
fu_Thumb.SaveAs(_path);
}
String _parent = CommonUtility.NullSafeString(ViewState["parentId"], "");
String _url = (String.IsNullOrEmpty(_parent)) ? "Events.aspx" : "EventGallery.aspx?parentId=" + _parent;
this.ClientScript.RegisterClientScriptBlock(this.GetType(), "MyScript", "alert('Record has been updated successfully.');self.location='" + _url + "';", true);
}
else
{
lbl_Error.Text = "An unexpected error has occurred. Please try again.";
lbl_Error.Visible = true;
}
}
}