本文整理汇总了C#中Voodoo.Basement.DataEntities.AddToJobApplicationRecord方法的典型用法代码示例。如果您正苦于以下问题:C# DataEntities.AddToJobApplicationRecord方法的具体用法?C# DataEntities.AddToJobApplicationRecord怎么用?C# DataEntities.AddToJobApplicationRecord使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Voodoo.Basement.DataEntities
的用法示例。
在下文中一共展示了DataEntities.AddToJobApplicationRecord方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
string[] ids = WS.RequestString("id").Split(',');
var user = UserAction.opuser;
var resume = user.DefaultResume();
if (user.ID < 0)
{
(new Result { Success = false, Text = "对不起,您还没有登录,请登录或注册后投递简历!" }).ResponseJson();
return;
}
if (resume == null)
{
(new Result { Success = false, Text = "您还没有创建简历,请创建简历之后进行投递!" }).ResponseJson();
return;
}
if (user.DefaultResumeFile() == null)
{
(new Result { Success = false, Text = "您还没有上传简历,请上传简历之后进行投递!" }).ResponseJson();
return;
}
DataEntities ent = new DataEntities();
foreach (var str_id in ids)
{
long postID = str_id.ToInt64();
JobApplicationRecord r = new JobApplicationRecord();
r.ApplicationTime = DateTime.Now;
r.CompanyID = JobExtend.GetCompanyIDByPost(postID);
r.Message = "";
r.PostID = postID;
r.ResumeID = resume.ID;
r.Status = 0;
r.UserID = user.ID;
ent.AddToJobApplicationRecord(r);
#region 发送邮件
var s = Voodoo.Basement.Model.JobSetting.Get();
//获取公司邮箱
var company = (from l in ent.JobCompany
from p in ent.JobPost
where l.ID == p.CompanyID
&& p.ID == postID
select l).FirstOrDefault();
if (s.SendMail&&company.MailAddress.IsNullOrEmpty()==false)
{
List<string> str_atts = new List<string>();
var atts = (from l in ent.JobResumeFile where l.UserID == user.ID select l).ToList();
foreach (var att in atts)
{
str_atts.Add(Server.MapPath(att.FilePath));
}
Voodoo.Net.Mail.SMTP.SentMail(s.From,
s.LoginName,
s.Password,
company.MailAddress,//user to
s.FromText,
s.Subject,
s.MailBody,
s.SmtpHost,
"",
str_atts);
}
#endregion
}
try
{
ent.SaveChanges();
ent.Dispose();
(new Result { Success = true, Text = "简历投递成功!" }).ResponseJson();
return;
}
catch (Exception ex)
{
(new Result { Success = false, Text =ex.Message }).ResponseJson();
return;
}
}