Esempio n. 1
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            var ids = WS.RequestString("id").Split(',').ToList().ToInt64();
            DataEntities ent = new DataEntities();
            foreach (var id in ids)
            {
                var q = (from l in ent.JobResumeInfo where l.ID == id select l).FirstOrDefault();
                var resumeCer=from l in ent.JobResumeCertificate where l.ResumeID==q.ID select l;
                var resumeEdu = from l in ent.JobResumeEdu where l.ResumeID == q.ID select l;
                var resumeExp = from l in ent.JobResumeExperience where l.ResumeID == q.ID select l;
                var resumeFile = from l in ent.JobResumeFile where l.ResumeID == q.ID select l;
                var resumeLan = from l in ent.JobResumeLanguage where l.ResumeID == q.ID select l;
                var resumeTrain = from l in ent.JobResumeTrain where l.ResumeID == q.ID select l;

                ent.DeleteObjects(resumeCer);
                ent.DeleteObjects(resumeEdu);
                ent.DeleteObjects(resumeExp);
                ent.DeleteObjects(resumeFile);
                ent.DeleteObjects(resumeLan);
                ent.DeleteObjects(resumeTrain);

                ent.DeleteObject(q);

            }
            ent.SaveChanges();
            ent.Dispose();
            Js.AlertAndChangUrl("删除成功!", "List.aspx?uid="+WS.RequestInt("uid").ToS());
        }
Esempio n. 2
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            enable = WS.RequestInt("enable", -1);
            group = WS.RequestInt("group", -1);
            url = string.Format("List.aspx?ebable={0}&group={1}", enable.ToString(), group.ToString());

            //删除
            var ids = WS.RequestString("id").Split(',').ToList().ToInt64();
            if (WS.RequestString("id").IsNullOrEmpty())
            {
                Js.AlertAndGoback("您没有选择任何项");
                return;
            }

            DataEntities ent = new DataEntities();

            foreach (var id in ids)
            {
                var q = (from l in ent.User where l.ID == id select l).FirstOrDefault();
                var resumes = from l in ent.JobResumeInfo where l.UserID == q.ID select l;
                var apps = from l in ent.JobApplicationRecord where l.UserID == q.ID select l;

                ent.DeleteObjects(resumes);
                ent.DeleteObjects(apps);
                ent.DeleteObject(q);
            }
            ent.SaveChanges();
            ent.Dispose();

            Js.AlertAndChangUrl("删除成功!", url);
        }