本文整理汇总了C#中Voodoo.Basement.DataEntities.AddToInfo方法的典型用法代码示例。如果您正苦于以下问题:C# DataEntities.AddToInfo方法的具体用法?C# DataEntities.AddToInfo怎么用?C# DataEntities.AddToInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Voodoo.Basement.DataEntities
的用法示例。
在下文中一共展示了DataEntities.AddToInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SaveData
/// <summary>
/// 保存数据
/// </summary>
protected void SaveData()
{
DataEntities ent = new DataEntities();
int id = WS.RequestInt("id");
var i = (from l in ent.Info where l.id == id select l).FirstOrDefault();
i.Address = WS.RequestString("address");
i.bit1 = WS.RequestString("bit1").ToBoolean();
i.bit2 = WS.RequestString("bit2").ToBoolean();
i.bit3 = WS.RequestString("bit3").ToBoolean();
i.bit4 = WS.RequestString("bit4").ToBoolean();
i.bit5 = WS.RequestString("bit5").ToBoolean();
var cls = NewsAction.NewsClass.Where(p => p.ID == WS.RequestInt("class")).First();
i.ClassID = cls.ID;
i.ClassName = cls.ClassName;
i.ClickCount = WS.RequestInt("clickcount",0);
i.Contact = WS.RequestString("contact");
i.ContactType = WS.RequestString("contacttype", "个人");
i.decimal1 = WS.RequestString("decimal1").ToDecimal(0);
i.decimal2 = WS.RequestString("decimal2").ToDecimal(0);
i.decimal3 = WS.RequestString("decimal3").ToDecimal(0);
i.decimal4 = WS.RequestString("decimal4").ToDecimal(0);
i.decimal5 = WS.RequestString("decimal5").ToDecimal(0);
i.ImageCount = WS.RequestInt("imagecount",0);
i.InfoTypeID = TypeID.ToS();
i.Intro = WS.RequestString("intro");
i.IsSetTop = WS.RequestString("issettop").ToBoolean();
i.num1 = WS.RequestInt("num1",0);
i.num2 = WS.RequestInt("num2", 0);
i.num3 = WS.RequestInt("num3", 0);
i.num4 = WS.RequestInt("num4", 0);
i.num5 = WS.RequestInt("num5", 0);
i.num6 = WS.RequestInt("num6", 0);
i.num7 = WS.RequestInt("num7", 0);
i.num8 = WS.RequestInt("num8", 0);
i.num9 = WS.RequestInt("num9", 0);
i.num10 = WS.RequestInt("num10", 0);
i.nvarchar1 = WS.RequestString("nvarchar1");
i.nvarchar2 = WS.RequestString("nvarchar2");
i.nvarchar3 = WS.RequestString("nvarchar3");
i.nvarchar4 = WS.RequestString("nvarchar4");
i.nvarchar5 = WS.RequestString("nvarchar5");
i.nvarchar6 = WS.RequestString("nvarchar6");
i.nvarchar7 = WS.RequestString("nvarchar7");
i.nvarchar8 = WS.RequestString("nvarchar8");
i.nvarchar9 = WS.RequestString("nvarchar9");
i.nvarchar10 = WS.RequestString("nvarchar10");
i.nvarchar11 = WS.RequestString("nvarchar11");
i.nvarchar12 = WS.RequestString("nvarchar12");
i.nvarchar13 = WS.RequestString("nvarchar13");
i.nvarchar14 = WS.RequestString("nvarchar14");
i.nvarchar15 = WS.RequestString("nvarchar15");
i.OutTime = WS.RequestString("outtime").ToDateTime();
i.PostTime = WS.RequestString("posttime").ToDateTime();
i.ReplyCount = WS.RequestInt("replycount",0);
i.Tel = WS.RequestString("tel");
i.TelLocation = WS.RequestString("tellocation");
i.text1 = WS.RequestString("text1");
i.text2 = WS.RequestString("text2");
i.text3 = WS.RequestString("text3");
i.text4 = WS.RequestString("text4");
i.text5 = WS.RequestString("text5");
i.Title = WS.RequestString("title");
i.UserID = SysUserAction.LocalUser.ID;
i.UserName = SysUserAction.LocalUser.UserName;
i.ZtID = 0;
i.ZtName = "";
if (id <=0)
{
ent.AddToInfo(i);
}
ent.SaveChanges();
ent.Dispose();
Response.Redirect("InfoList.aspx?type=" + TypeID);
}