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


C# System.Globalization.CultureInfo.GetMonthName方法代码示例

本文整理汇总了C#中System.Globalization.CultureInfo.GetMonthName方法的典型用法代码示例。如果您正苦于以下问题:C# System.Globalization.CultureInfo.GetMonthName方法的具体用法?C# System.Globalization.CultureInfo.GetMonthName怎么用?C# System.Globalization.CultureInfo.GetMonthName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Globalization.CultureInfo的用法示例。


在下文中一共展示了System.Globalization.CultureInfo.GetMonthName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                bioEntities bio = new bioEntities();
                int userid = (int)Session["userid"];
                int cantinc = bio.Incidencia.Where(x => x.usuario == userid).Where(y => y.justificado == false).Count();
                notification_header.Text = cantinc.ToString();
                USERINFO usr = bio.USERINFO.Where(y => y.USERID == userid).Single();
                roles r = bio.roles.Where(x => x.id == usr.privilege).Single();
                HyperLink1.Text = usr.NAME;
                roll.Text = r.descripcion;
                fechaSis.EditFormatString = "dddd dd MMMM, yyyy";
                fechaSis.Date = (DateTime)Session["fechaActual"];
                imgperfil.ImageUrl = string.Format("Handler1.ashx?UserID={0}", Session["userid"]);
                //habilitar el menú justificar según el rol
                mjust.Visible = (r.id > 0 ? true : false);

                //NOtificaciones
                if (cantinc > 0)
                {
                    Incidencia[] tabla = bio.Incidencia.Where(x => x.usuario == userid).Where(y => y.justificado == false).ToArray();
                    foreach (Incidencia item in tabla)
                    {
                        HtmlGenericControl li = new HtmlGenericControl("li");
                        HtmlGenericControl av = new HtmlGenericControl("a");
                        HtmlGenericControl span = new HtmlGenericControl("span");
                        HtmlGenericControl spant = new HtmlGenericControl("span");
                        HtmlGenericControl spanm = new HtmlGenericControl("span");
                        DateTime fecha=Convert.ToDateTime(item.fecha);
                        System.Globalization.DateTimeFormatInfo dtinfo = new System.Globalization.CultureInfo("es-ES", false).DateTimeFormat;
                        dtinfo.GetMonthName(fecha.Month);
                        spant.InnerText = "Fecha: " + fecha.DayOfWeek + " " + fecha.Day + " de " + dtinfo.GetMonthName(fecha.Month) + " del " + fecha.Year;
                        spanm.InnerText = "Tipo de Incidencia: "+item.TipoIncidencia1.descripcion;
                        span.Controls.Add(spant);
                        spanm.Attributes.Add("class", "message");
                        av.Controls.Add(span);
                        av.Controls.Add(spanm);
                        li.Controls.Add(av);
                        menu1.Controls.Add(li);
                    }
                }

            }

            //string username = CurrentUserName;
            //USERINFO user = bio.USERINFO.Where(q => q.TITLE == username).Single();
            //Session["userid"] = user.USERID;
            //Session["fechaActual"] = DateTime.Now;

            //Byte bytes = (Byte)Session["foto"];
            //ASPxBinaryImage1.Response.Buffer = true;
            //ASPxBinaryImage1.Response.Charset = "";
            //ASPxBinaryImage1.Response.Cache.SetCacheability(HttpCacheability.NoCache);
            ////Response.ContentType = dt.Rows[0]["ContentType"].ToString();
            ////Response.AddHeader("content-disposition", "attachment;filename="
            ////+ dt.Rows[0]["Name"].ToString());

            //ASPxBinaryImage1.Response.BinaryWrite(bytes);
            //ASPxBinaryImage1.Response.Flush();
            //ASPxBinaryImage1.Response.End();
        }
开发者ID:yassercf,项目名称:Projects-Visual-Studio-2013,代码行数:62,代码来源:Root.master.cs

示例2: MonthName

 //protected string GetFormatString(object value)
 //{
 //    return value == null ? string.Empty : value.ToString();
 //}
 public static string MonthName(int month)
 {
     System.Globalization.DateTimeFormatInfo dtinfo = new System.Globalization.CultureInfo("es-ES", false).DateTimeFormat;
     return dtinfo.GetMonthName(month);
 }
开发者ID:yassercf,项目名称:Projects-Visual-Studio-2013,代码行数:9,代码来源:Root.master.cs


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