Ejemplo n.º 1
0
    private IQueryable getCarrer(string type, int id)
    {
        IQueryable            q;
        ResumeInfoDataContext db = new ResumeInfoDataContext();

        if (type.Equals("1") || type.Equals("2"))
        {
            q = from m in db.Career
                where (m.cid == id)
                select new { dname = m.Department.dname, m.cmail, m.ctransfer, m.cname, m.cpot, m.ccontent, m.cquality };
        }
        else if (type.Equals("3") || type.Equals("4"))
        {
            q = from m in db.Career
                where (m.cid == id)
                select new { m.cname, m.cpot, m.ceducation, m.cnumber };
        }
        else
        {
            q = null;
        }
        return(q);
    }
Ejemplo n.º 2
0
    private void FillNewForm()
    {
        ResumeInfoDataContext db = new ResumeInfoDataContext();

        WebHelper.FillEnuList(Sex.List, db, typeof(enuSex), true, "");
        WebHelper.FillEnuList(zzmm.List, db, typeof(enuZzmm), true, "");
        WebHelper.FillEnuList(hyzk.List, db, typeof(enuHyzk), true, "");

        WebHelper.FillEnuList(qwxc.List, db, typeof(enuQwyx), true, "");

        WebHelper.FillEnuList(zc.List, db, typeof(enuZc), true, "");



        WebHelper.FillEnuList(jyjd.List, db, typeof(enuJyjd), true, "");


        WebHelper.FillEnuList(zg.List, db, typeof(enuZg), true, "");
        WebHelper.FillEnuList(cszy.List, db, typeof(enuZy), true, "");
        WebHelper.FillEnuList(gzdd1.List, db, typeof(enuGzdd), true, "");
        WebHelper.FillEnuList(gzdd2.List, db, typeof(enuGzdd), true, "");
        WebHelper.FillEnuList(gzdd3.List, db, typeof(enuGzdd), true, "");
    }
Ejemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         WebHelper.IsSessionValid(Session, Response);
         if (Request.QueryString["es"] != null)
         {
             pantip.Visible = false;
         }
         int id = 0;
         if (Request.QueryString["id"] != null)
         {
             if (int.Parse(Session["UserType"].ToString()) > 1)
             {
                 Response.Redirect("~/NoUser.htm");
             }
             id = int.Parse(Request.QueryString["id"]);
         }
         else
         {
             id = int.Parse(Session["UserID"].ToString());
         }
         ViewState["userid"] = id;
         imgPhoto.ImageUrl   = "ShowPhoto.aspx?id=" + id;
         ResumeInfoDataContext db = new ResumeInfoDataContext();
         FillForm(db, id);
         gvJybj.FillGrid(JybjQuery(db, id));
         gvZyzg.FillGrid(ZyzgQuery(db, id));
         gvGzsx.FillGrid(GzsxQuery(db, id));
         gvGzsxnr.Attributes.Add("style", "word-break:keep-all;word-wrap:normal");
         gvGzsxnr.Attributes.Add("style", "word-break:break-all;word-wrap:break-word");
         gvGzsxnr.FillGrid(GzsxnrQuery(db, id));
         gvJtshgx.FillGrid(JtshgxQuery(db, id));
         gvFileInfo.FillGrid(FileInfoQuery(db, id));
     }
 }
Ejemplo n.º 4
0
    private int getJobCountOnCondition(string major, string pot)
    {
        ResumeInfoDataContext db = new ResumeInfoDataContext();

        if (major.Equals("") && pot.Equals(""))
        {
            if (Request["type"] == "4")
            {
                return((from m in db.Career
                        where m.ctype == int.Parse((Request["type"])) && m.cvalid == true && m.cdisplay == true
                        select new { m.cid, m.cname, m.cpot }).Count());
            }
            return((from m in db.Career
                    where m.ctype == int.Parse((Request["type"])) && m.cvalid == true
                    select new { m.cid, m.cname, m.cpot }).Count());
        }
        else if (major.Equals("") && !pot.Equals(""))
        {
            if (Request["type"] == "4")
            {
                return((from m in db.Career
                        where m.ctype == int.Parse((Request["type"])) && m.cvalid == true && m.cpot.Contains(pot) && m.cdisplay == true
                        select new { m.cid, m.cname, m.cpot }).Count());
            }
            return((from m in db.Career
                    where m.ctype == int.Parse((Request["type"])) && m.cvalid == true && m.cpot.Contains(pot)
                    select new { m.cid, m.cname, m.cpot }).Count());
        }
        else if (!major.Equals("") && pot.Equals(""))
        {
            if ((Request["type"] == "1") || (Request["type"] == "2"))
            {
                return((from m in db.Career
                        where m.ctype == int.Parse((Request["type"])) && m.cvalid == true && m.cquality.Contains(major)
                        select new { m.cid, m.cname, m.cpot }).Count());
            }
            else if (Request["type"] == "4")
            {
                return((from m in db.Career
                        where m.ctype == int.Parse((Request["type"])) && m.cvalid == true && m.ceducation.Contains(major) && m.cdisplay == true
                        select new { m.cid, m.cname, m.cpot }).Count());
            }
            else
            {
                return((from m in db.Career
                        where m.ctype == int.Parse((Request["type"])) && m.cvalid == true && m.ceducation.Contains(major)
                        select new { m.cid, m.cname, m.cpot }).Count());
            }
        }
        else
        {
            if ((Request["type"] == "1") || (Request["type"] == "2"))
            {
                return((from m in db.Career
                        where m.ctype == int.Parse((Request["type"])) && m.cvalid == true && m.cquality.Contains(major) && m.cpot.Contains(pot)
                        select new { m.cid, m.cname, m.cpot }).Count());
            }
            else if (Request["type"] == "3")
            {
                return((from m in db.Career
                        where m.ctype == int.Parse((Request["type"])) && m.cvalid == true && m.ceducation.Contains(major) && m.cpot.Contains(pot) && m.cdisplay == true
                        select new { m.cid, m.cname, m.cpot }).Count());
            }
            else
            {
                return((from m in db.Career
                        where m.ctype == int.Parse((Request["type"])) && m.cvalid == true && m.ceducation.Contains(major) && m.cpot.Contains(pot)
                        select new { m.cid, m.cname, m.cpot }).Count());
            }
        }
    }
Ejemplo n.º 5
0
    public static void ExportDoc(int id)
    {
        string rootpath = @"E:\project\ResumeInfo\ResumeInfo.Web\";
        string filename = rootpath + "Pages\\ResumeRpt.doc";


        License license = new License();

        license.SetLicense(rootpath + "bin\\Aspose.Word.lic");
        Document doc = new Document(filename);

        string[] fieldNames = doc.MailMerge.GetFieldNames();
        Dictionary <string, object> fvlist = new Dictionary <string, object>();
        ResumeInfoDataContext       db     = new ResumeInfoDataContext();
        var baseinfo = db.BaseInfo.Select(b => new {
            b.UserID,
            b.PName,
            b.PID,
            Sex  = b.enuSex.Label,
            csrq = WebHelper.ShortDateTime(b.csrq),
            zzmm = b.enuZzmm.Label,
            b.jg,
            b.csd,
            b.hkszd,
            b.mz,
            hyzk = b.enuHyzk.Label,
            b.jkzk,
            b.grtc,
            b.sj,
            b.yxdh,
            b.lxdz,
            b.email,
            qwyx = b.enuQwyx.Label,
            b.tz,
            b.sg,
            b.dywy,
            b.dewy,
            b.jsj,
            zc   = b.enuZc.Label,
            jypx = b.jypx.Replace("<br>", "\r\n"),
            xsky = b.xsky.Replace("<br>", "\r\n"),
            stqk = b.stqk.Replace("<br>", "\r\n"),
            jcqk = b.jcqk.Replace("<br>", "\r\n"),
            b.gzdd1,
            b.cszy,
            ModifyTime = GetModifyTime(b.ModifyTime)
        }).Single(b => b.UserID == id);

        foreach (string s in fieldNames)
        {
            if (!s.StartsWith("l_"))
            {
                fvlist.Add(s, DataBinder.Eval(baseinfo, s));
            }
        }
        doc.MailMerge.Execute(fvlist.Keys.ToArray(), fvlist.Values.ToArray());
        fvlist.Clear();

        var Jtshgx = db.Jiatshgx.Select(o => new
        {
            o.UserID,
            o.cw,
            o.xm,
            o.nl,
            zzmm = o.enuZzmm.Label,
            o.gzdw,
            o.bmzw
        }).Where(o => o.UserID == id).Take(3);
        int index = 0;

        string[] arrf = new string[] { "l_cw", "l_xm", "l_nl", "l_zzmm", "l_gzdw", "l_bmzw" };
        foreach (var o in Jtshgx)
        {
            foreach (string f in arrf)
            {
                fvlist.Add(f + index, DataBinder.Eval(o, f.Substring(2)));
            }
            index++;
        }
        doc.MailMerge.Execute(fvlist.Keys.ToArray(), fvlist.Values.ToArray());
        ClearRest(3, index, arrf, fvlist, doc);

        var zyzg = db.Zhiyzg.Select(o => new
        {
            o.UserID,
            zg   = o.enuZg.Label,
            hdsj = WebHelper.ShortDateTime(o.hdsj),
            o.zcd
        }).Where(o => o.UserID == id).Take(3);

        index = 0;
        arrf  = new string[] { "l_zg", "l_hdsj", "l_zcd" };
        foreach (var o in zyzg)
        {
            foreach (string f in arrf)
            {
                fvlist.Add(f + index, DataBinder.Eval(o, f.Substring(2)));
            }
            index++;
        }
        doc.MailMerge.Execute(fvlist.Keys.ToArray(), fvlist.Values.ToArray());
        ClearRest(3, index, arrf, fvlist, doc);

        var gzsx = db.Gongzsx.Select(o => new
        {
            o.UserID,
            qzsj = Getqzsj(o.kssj, o.jssj),
            o.dw,
            o.cszy,
            o.bmjzw,
            o.zmr,
            lb = o.enuGzsxlb.Label
        }).Where(o => o.UserID == id).Take(4);

        index = 0;
        arrf  = new string[] { "l_lb", "l_qzsj", "l_dw", "l_cszy", "l_bmjzw", "l_zmr" };
        foreach (var o in gzsx)
        {
            foreach (string f in arrf)
            {
                fvlist.Add(f + index, DataBinder.Eval(o, f.Substring(2)));
            }
            index++;
        }
        doc.MailMerge.Execute(fvlist.Keys.ToArray(), fvlist.Values.ToArray());
        ClearRest(4, index, arrf, fvlist, doc);

        var jybj = db.Jiaoybj.Select(o => new
        {
            o.UserID,
            jqzsj = Getqzsj(o.kssj, o.jssj),
            o.byyx,
            o.sxzy,
            o.ds,
            o.jyjd
        }).Where(o => o.UserID == id);

        arrf = new string[] { "l_jqzsj", "l_byyx", "l_sxzy", "l_ds" };
        SetJybj(1, 0, jybj, arrf, fvlist, doc);
        SetJybj(2, 1, jybj, arrf, fvlist, doc);
        SetJybj(3, 2, jybj, arrf, fvlist, doc);
        SetJybj(4, 3, jybj, arrf, fvlist, doc);
        SetJybj(5, 4, jybj, arrf, fvlist, doc);

        string picname = WebHelper.GetPhotoUpDir() + id + ".jpg";

        if (File.Exists(picname))
        {
            DocumentBuilder builder = new DocumentBuilder(doc);
            builder.MoveToBookmark("pic");
            builder.InsertImage(picname, 70, 90);
        }

        string pname = GetDocName(baseinfo.PName, id) + ".doc";

        doc.Save(@"E:\project\ResumeInfo\简历导出\" + pname, SaveFormat.Doc);
    }
Ejemplo n.º 6
0
    private void FillNewForm()
    {
        ResumeInfoDataContext db = new ResumeInfoDataContext();

        WebHelper.FillEnuList(jyjd, db, typeof(enuJyjd), false, "");
    }
Ejemplo n.º 7
0
    private void FillNewForm()
    {
        ResumeInfoDataContext db = new ResumeInfoDataContext();

        WebHelper.FillEnuList(zzmm, db, typeof(enuZzmm), true, "");
    }
Ejemplo n.º 8
0
    private IQueryable GetRawQuery()
    {
        IQueryable <int>      Query = null;
        ResumeInfoDataContext db    = new ResumeInfoDataContext();
        //sb = WebHelper.SetSqlLog(db);
        Dictionary <Type, string> querylist = (Dictionary <Type, string>)ViewState["Query"];

        foreach (Type tp in querylist.Keys)
        {
            if (Query == null)
            {
                if (tp == typeof(Jiaoybj))
                {
                    IQueryable p = from m in db.Jiaoybj
                                   group new { m.UserID, m.byyx, m.sxzy, m.jyjd } by m.UserID into g
                    orderby g.FirstOrDefault().jyjd
                    select new
                    {
                        UserID = g.FirstOrDefault().UserID,
                        byyx   = g.FirstOrDefault().byyx,
                        sxzy   = g.FirstOrDefault().sxzy,
                        jyjd   = g.FirstOrDefault().jyjd
                    }
                    ;



                    Query = (IQueryable <int>)p.Where(querylist[tp]).Select("UserID");
                }
                else
                {
                    Query = (IQueryable <int>)db.GetTable(tp).Where(querylist[tp]).Select("UserID");
                }
            }
            else
            {
                if (tp == typeof(Jiaoybj))
                {
                    IQueryable p = from m in db.Jiaoybj
                                   group new { m.UserID, m.byyx, m.sxzy, m.jyjd } by m.UserID into g
                    orderby g.FirstOrDefault().jyjd
                    select new
                    {
                        UserID = g.FirstOrDefault().UserID,
                        byyx   = g.FirstOrDefault().byyx,
                        sxzy   = g.FirstOrDefault().sxzy,
                        jyjd   = g.FirstOrDefault().jyjd
                    }
                    ;

                    Query = Query.Intersect((IQueryable <int>)p.Where(querylist[tp]).Select("UserID"));
                }
                else
                {
                    Query = Query.Intersect((IQueryable <int>)db.GetTable(tp).Where(querylist[tp]).Select("UserID"));
                }
            }
        }
        var q = from b in db.BaseInfo
                where b.ModifyTime.HasValue && (!b.zfflag.Value || !b.zfflag.HasValue)
                select new {
            b.UserID,
            b.PName,
            b.PID,
            b.sj,
            b.ModifyTime,
            SexLabel = b.enuSex.Label,
            byyx     = b.Jiaoybj.Where(o => o.UserID == b.UserID).OrderByDescending(o => o.enuJyjd.DisOrder).First().byyx,
            xl       = b.Jiaoybj.Where(o => o.UserID == b.UserID).OrderByDescending(o => o.enuJyjd.DisOrder).First().enuJyjd.Label,
            zy       = b.Jiaoybj.Where(o => o.UserID == b.UserID).OrderByDescending(o => o.enuJyjd.DisOrder).First().sxzy,
            b.csd,
            ztLabel = b.enuZt.Label,
            ypzly   = b.enuLaiy.Label,
        };

        if (Query != null)
        {
            q = q.Where(o => Query.Contains(o.UserID));
        }
        return(q);
    }