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


C# TimeOfDay.LitePopulate方法代码示例

本文整理汇总了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";
            }

        }
    }
开发者ID:noximus,项目名称:TopOfTheRock,代码行数:40,代码来源:EditTimeOfDay.aspx.cs

示例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();
    }
开发者ID:noximus,项目名称:TopOfTheRock,代码行数:22,代码来源:Timeofdays.aspx.cs

示例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;
            }
        }
    }
开发者ID:noximus,项目名称:TopOfTheRock,代码行数:36,代码来源:EditTimeOfDay.aspx.cs


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