本文整理汇总了C#中Voodoo.Basement.DataEntities.AddToJobPost方法的典型用法代码示例。如果您正苦于以下问题:C# DataEntities.AddToJobPost方法的具体用法?C# DataEntities.AddToJobPost怎么用?C# DataEntities.AddToJobPost使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Voodoo.Basement.DataEntities
的用法示例。
在下文中一共展示了DataEntities.AddToJobPost方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btn_Save_Click
protected void btn_Save_Click(object sender, EventArgs e)
{
DataEntities ent = new DataEntities();
int id = WS.RequestInt("id");
JobPost p = new JobPost();
if (id > 0)
{
p = (from l in ent.JobPost where l.ID == id select l).FirstOrDefault();
}
p.CompanyID = ddl_Company.SelectedValue.ToInt32();
p.Title = txt_Title.Text;
p.Province = ddl_Province.SelectedValue.ToInt32();
p.City = ddl_City.SelectedValue.ToInt32();
p.Salary = ddl_Salary.SelectedValue.ToInt32();
p.Expressions = ddl_Expressions.SelectedValue.ToInt32();
p.Edu = ddl_Edu.SelectedValue.ToInt32();
p.EmployNumber = txt_EmployNumber.Text.ToInt32();
p.Intro = txt_Intro.Text;
p.PostTime = DateTime.Now;
p.IsSetTop = chk_Settop.Checked;
p.SetTopTime = DateTime.Now;
p.ExpireTime = txt_ExpireTime.Text.ToDateTime();
//绑定教育
List<JobPostEduAndEmployeeCount> edus = new List<JobPostEduAndEmployeeCount>();
foreach (var ed in JobAction.Edu)
{
edus.Add(new JobPostEduAndEmployeeCount() { Checked = false, key = ed.Key, Number = 0, Text = ed.Value });
}
string[] chk = WS.RequestString("chk").Split(',');
string[] nums = WS.RequestString("number").Split(',');
for (int i = 0; i < chk.Length; i++)
{
edus[i].Checked = chk[i].ToBoolean();
edus[i].Number = nums[i].ToInt32();
}
p.Ext1 = Voodoo.IO.XML.Serialize(edus);
if (p.ID <= 0)
{
//处理城市热度
try
{
var ct = (from l in ent.City where l.id == p.City select l).FirstOrDefault();
ct.Hot += 1;
}
catch { }
ent.AddToJobPost(p);
}
ent.SaveChanges();
ent.Dispose();
Js.AlertAndChangUrl("保存成功!", refer);
}