本文整理汇总了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();
}
示例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);
}