private void ModifyItem(int id) { ResumeInfoDataContext db = new ResumeInfoDataContext(); Jiaoybj item = db.Jiaoybj.Single(p => p.PKID == id); WebHelper.BindControlsToObject(item, PanField); db.SubmitChanges(); }
private bool DeleteItem() { ResumeInfoDataContext db = new ResumeInfoDataContext(); IQueryable <BaseInfo> item = db.BaseInfo.Where(o => ObjGrid.SelectedRows.Contains(o.UserID)); db.BaseInfo.DeleteAllOnSubmit(item); db.SubmitChanges(); return(true); }
private void CreateItem() { ResumeInfoDataContext db = new ResumeInfoDataContext(); Jiaoybj item = new Jiaoybj(); WebHelper.BindControlsToObject(item, PanField); item.UserID = int.Parse(Session["UserID"].ToString()); db.Jiaoybj.InsertOnSubmit(item); db.SubmitChanges(); }
private void CreateItem() { ResumeInfoDataContext db = new ResumeInfoDataContext(); BaseInfo item = new BaseInfo(); item.PID = PID.Text; item.PName = PName.Text; item.pwd = pwd.Text; item.CreateTime = DateTime.Now; db.BaseInfo.InsertOnSubmit(item); db.SubmitChanges(); }
private void DeleteItem(string id) { try { ResumeInfoDataContext db = new ResumeInfoDataContext(); Jiaoybj item = db.Jiaoybj.Single(o => o.PKID == int.Parse(id)); db.Jiaoybj.DeleteOnSubmit(item); db.SubmitChanges(); WebHelper.AlertMsg("你选择的记录已经被删除!", ClientScript); } catch (Exception ex) { WebHelper.AlertMsg(ex.Message, ClientScript); } }
private void applyJob(string job) { ResumeInfoDataContext db = new ResumeInfoDataContext(); int cid = int.Parse(job); int uid = int.Parse(Session["UserID"].ToString()); if (db.Application.Count(p => p.acid == cid && p.auid == uid) > 0) { WebHelper.AlertMsg("已申请该岗位,无法重复申请!", ClientScript); } else { Application app = new Application(); app.acid = cid; app.auid = uid; db.Application.InsertOnSubmit(app); db.SubmitChanges(); WebHelper.AlertMsg("您已申请成功,请至已申请岗位查看", ClientScript); IQueryable <BaseInfo> items = db.BaseInfo.Where(o => o.UserID == uid).Take(1); IQueryable <Career> careers = db.Career.Where(o => o.cid == cid).Take(1); string from = "*****@*****.**"; string title = "上海市政工程设计研究总院(集团)有限公司岗位申请"; SmtpClient sc = new SmtpClient("smedi-server04.smedi.com"); MailMessage me; try { foreach (BaseInfo user in items) { string body = " 用户(" + user.PID + ")已申请 "; foreach (Career career in careers) { if (career.ctransfer == true && !career.cmail.Equals("")) { string body1 = body + career.enuCtype.Name + "中的" + career.cname + "岗位,请及时审核。"; me = new MailMessage(from, career.cmail, title, body1); sc.Send(me); } else { break; } } } } catch { } } }
private void DeleteItem(string id) { try { ResumeInfoDataContext db = new ResumeInfoDataContext(); FileInfo item = db.FileInfo.Single(o => o.FileID == int.Parse(id)); db.FileInfo.DeleteOnSubmit(item); db.SubmitChanges(); File.Delete(WebHelper.GetAttachUpDir() + id + ".xmx"); WebHelper.AlertMsg("你选择的记录已经被删除!", ClientScript); } catch (Exception ex) { WebHelper.AlertMsg(ex.Message, ClientScript); } }
private void CreateItem() { ResumeInfoDataContext db = new ResumeInfoDataContext(); FileInfo item = new FileInfo(); WebHelper.BindControlsToObject(item, PanField); item.UserID = int.Parse(Session["UserID"].ToString()); item.UpTime = DateTime.Now; item.FName = FileUp.FileName; item.FLength = FileUp.FileContent.Length; db.FileInfo.InsertOnSubmit(item); db.SubmitChanges(); UpLoadFile(item.FileID); }
private void ModifyItem(int id) { ResumeInfoDataContext db = new ResumeInfoDataContext(); FileInfo item = db.FileInfo.Single(p => p.FileID == id); WebHelper.BindControlsToObject(item, PanField); if (FileUp.HasFile) { item.UpTime = DateTime.Now; item.FName = FileUp.FileName; item.FLength = FileUp.FileContent.Length; UpLoadFile(item.FileID); } db.SubmitChanges(); }
protected void btnOK_Click(object sender, EventArgs e) { try { int id = int.Parse(ViewState["userid"].ToString()); CheckJybj(id); ResumeInfoDataContext db = new ResumeInfoDataContext(); BaseInfo item = db.BaseInfo.Single(p => p.UserID == id); item.ModifyTime = DateTime.Now; db.SubmitChanges(); WebHelper.AlertMsg("您的简历信息提交成功!", ClientScript); } catch (Exception ex) { WebHelper.AlertMsg(ex.Message, ClientScript); } }
private bool DeleteItem() { ResumeInfoDataContext db = new ResumeInfoDataContext(); string cond = ""; foreach (int id in ObjGrid.SelectedRows) { cond += "PKID == " + id + " || "; } cond = cond.Substring(0, cond.Length - 4); var item = db.GetTable((Type)ViewState["enuType"]).Where(cond); db.GetTable((Type)ViewState["enuType"]).DeleteAllOnSubmit(item); db.SubmitChanges(); return(true); }
private void CreateItem() { ResumeInfoDataContext db = new ResumeInfoDataContext(); BaseInfo item = new BaseInfo(); item.PID = txtPID.Text; item.pwd = txtPwd.Text; item.email = txtMail.Text; item.CreateTime = DateTime.Now; db.BaseInfo.InsertOnSubmit(item); db.SubmitChanges(); BaseInfo rlt = db.BaseInfo.Single(p => p.PID == txtPID.Text); Session["UserID"] = rlt.UserID; Session["UserType"] = 2; Session["UserPID"] = rlt.PID; Server.Transfer("FrmMain.aspx"); }