Ejemplo n.º 1
0
        public static ZhaopinFb GetZhaopinFbByid(int id)
        {
            string sqlstr = "select zpfb.id as Id," +
                            "zpfb.zpgwid as ZpgwId," +
                            "zpgw.zpbm as ZpBmID," +
                            "department.departname as ZpBm," +
                            "zpgw.zppos as Zppos," +
                            "zpfb.sums as ZpSums," +
                            "zpfb.fbtime as FbTime, " +
                            "zpfb.zpitmid as ZpItmId " +
                            "from zpfb,zpgw,department " +
                            " where zpfb.fbstate=1 and zpfb.zpgwid=zpgw.id and zpgw.zpbm=department.id and department.bmstate=1 and zpfb.id=" + id;
            DataTable dt = MySqlDBHelper.GetDataSet(sqlstr);

            if (dt.Rows.Count > 0)
            {
                DataRow   dr = dt.Rows[0];
                ZhaopinFb zf = new ZhaopinFb();
                zf.Id       = Convert.ToInt32(dr["Id"].ToString());
                zf.ZpGwID   = Convert.ToInt32(dr["ZpgwId"].ToString());
                zf.ZpSums   = Convert.ToInt32(dr["ZpSums"].ToString());
                zf.ZpFbTime = dr["FbTime"].ToString();
                zf.ZpitmId  = Convert.ToInt32(dr["ZpItmId"]);

                zf.ZpBmName  = dr["ZpBm"].ToString();
                zf.ZpPosName = dr["Zppos"].ToString();
                zf.FbBmId    = Convert.ToInt32(dr["ZpBmID"].ToString());
                return(zf);
            }
            return(null);
        }
Ejemplo n.º 2
0
        public static List <Department> GetDepartmentByName(string depname)
        {
            String sqlstr = "select * from department where bmstate=1 ";

            if (depname != "" && depname != null)
            {
                sqlstr += " and departname Like '%" + depname + "%'";
            }
            //String sqlstr = "select * from department where bmstate=1 and departname='"+depname+"'";
            DataTable dt = MySqlDBHelper.GetDataSet(sqlstr);

            List <Department> list = new List <Department>();

            if (dt.Rows.Count < 1)
            {
                return(list);
            }

            foreach (DataRow dr in dt.Rows)
            {
                Department department = new Department();
                department.Id      = (int)dr["id"];
                department.Name    = dr["departname"].ToString();
                department.Info    = dr["info"].ToString();
                department.Bmstate = Convert.ToInt32(dr["bmstate"].ToString());
                list.Add(department);
            }
            return(list);
        }
Ejemplo n.º 3
0
        public static DataTable GetAllZhaopinFbInItem(int dep = -1, string pos = "", int itmid = -1)
        {
            string sqlstr = "select zpfb.id as Id," +
                            "zpfb.zpgwid as ZpgwId," +
                            "zpgw.zpbm as ZpBmID," +
                            "department.departname as ZpBm," +
                            "zpgw.zppos as Zppos," +
                            "zpfb.sums as ZpSums," +
                            "zpfb.fbtime as FbTime, " +
                            "zpfb.zpitmid as ZpItmId " +
                            "from zpfb,zpgw,department " +
                            " where zpfb.fbstate=1 and zpfb.zpgwid=zpgw.id" +
                            " and zpgw.zpbm=department.id and department.bmstate=1 ";

            if (dep != -1)
            {
                sqlstr += " and department.id=" + dep + " ";
            }
            if (pos != "")
            {
                sqlstr += " and zpgw.zppos='" + pos + "' ";
            }
            if (itmid != -1)
            {
                sqlstr += " and zpfb.zpitmid='" + itmid + "' ";
            }

            sqlstr += " order by FbTime desc ";

            DataTable dt = MySqlDBHelper.GetDataSet(sqlstr);

            return(dt);
        }
Ejemplo n.º 4
0
        public static Shiti GetShitiById(int stid = -1)
        {
            String sql = "select shiti.id as Id,question,ktid,ktindex,weight,sttime from shiti,kaoti where shiti.ktid=kaoti.id and kaoti.ktstate=1 ";

            if (stid != -1)
            {
                sql += " and shiti.id=" + stid + "";
            }
            else
            {
                return(null);
            }
            DataTable dt = MySqlDBHelper.GetDataSet(sql);
            Shiti     st = new Shiti();

            foreach (DataRow dr in dt.Rows)
            {
                // Shiti st = new Shiti();
                st.Id         = Convert.ToInt32(dr["Id"].ToString());
                st.Question   = dr["question"].ToString();
                st.KaotiID    = Convert.ToInt32(dr["ktid"].ToString());
                st.KaotiIndex = Convert.ToInt32(dr["ktindex"].ToString());
                st.Weight     = Convert.ToInt32(dr["weight"]);
                st.StTime     = Convert.ToInt32(dr["sttime"]);
                return(st);
            }
            return(null);
        }
        public static List <ZhaopinItem> GetAllZhaopinItemListByTitle(string titlename = "")
        {
            string sqlstr = "select zhaopinitem.id as Id," +
                            "zhaopinitem.title as Title," +
                            "zhaopinitem.pubtime as PubTime  from zhaopinitem " +
                            " where zhaopinitem.zpitemstate=1 ";//+

            //"order by PubTime desc";
            if (titlename != "")
            {
                sqlstr += " and zhaopinitem.title Like '%" + titlename + "%'";
            }
            sqlstr += " order by PubTime desc";

            DataTable          dt = MySqlDBHelper.GetDataSet(sqlstr);
            List <ZhaopinItem> ls = new List <ZhaopinItem>();

            foreach (DataRow dr in dt.Rows)
            {
                ZhaopinItem zpitem = new ZhaopinItem();
                zpitem.Id      = Convert.ToInt32(dr["Id"]);
                zpitem.Title   = dr["Title"].ToString();
                zpitem.PubTime = dr["PubTime"].ToString();
                ls.Add(zpitem);
            }
            return(ls);
        }
Ejemplo n.º 6
0
        public static Pingfen GetPfByParameter(int kgzpid, int ypzzpid, int stid, int xdbzid)
        {
            String sqlstr = "select pingfen.id as Id,pingfen.ypzzpid,pingfen.kgzpid,pingfen.shitiid,pingfen.xdbzid,pingfen.chengji," +
                            "pingfen.pfstate from pingfen,yingpingzhezhaopin,yingpinzhe,kaoguanzhaopin,kaoguan " +
                            "where pingfen.pfstate=1 and kgzpid=@kgzpid and ypzzpid=@ypzzpid and shitiid=@stid and xdbzid=@xdbzid " +
                            " and pingfen.ypzzpid=yingpingzhezhaopin.id and pingfen.kgzpid=kaoguanzhaopin.id " +
                            " and yingpingzhezhaopin.ypzid=yingpinzhe.id and yingpinzhe.ypzstate=1 " +
                            " and kaoguanzhaopin.kgid=kaoguan.id and kaoguan.kgstate=1 ";
            List <MySqlParameter> para_list = new List <MySqlParameter>();

            para_list.Add(new MySqlParameter("@kgzpid", kgzpid));
            para_list.Add(new MySqlParameter("@ypzzpid", ypzzpid));
            para_list.Add(new MySqlParameter("@stid", stid));
            para_list.Add(new MySqlParameter("@xdbzid", xdbzid));

            DataTable dt = MySqlDBHelper.GetDataSet(sqlstr, para_list.ToArray());

            if (dt.Rows.Count > 0)
            {
                DataRow dr = dt.Rows[0];
                Pingfen pf = new Pingfen();
                pf.Id      = Convert.ToInt32(dr["Id"].ToString());
                pf.KgzpID  = Convert.ToInt32(dr["kgzpid"].ToString());
                pf.ShitiID = Convert.ToInt32(dr["shitiid"].ToString());
                pf.YpzzpID = Convert.ToInt32(dr["ypzzpid"].ToString());
                pf.XdbzID  = Convert.ToInt32(dr["xdbzid"].ToString());

                pf.State = Convert.ToInt32(dr["pfstate"].ToString());

                pf.Score = Convert.ToInt32(dr["chengji"].ToString());
                return(pf);
            }
            return(null);
        }
Ejemplo n.º 7
0
        public static DataTable GetAllZhaopin(int dep = -1, string pos = "")
        {
            string sqlstr = "select zhaopin.id as Id," +
                            "zhaopin.title as Title," +
                            "zhaopin.zpfbid," +
                            "zhaopin.interviewtime as InterviewTime," +
                            "department.departname as ZpbmName," +
                            "zpgw.zppos as ZpgwName," +
                            "zpfb.sums as ZpSums," +
                            "zhaopin.hege as HegeLine, " +
                            "zhaopin.ktid as KTID " +
                            "from zhaopin,zpfb,zpgw,department" +
                            " where zhaopin.zpfbid=zpfb.id and zpfb.zpgwid=zpgw.id and zpgw.zpbm=department.id and zpfb.fbstate=1 and zhaopin.zpstate=1 and department.bmstate=1 ";

            if (dep != -1)
            {
                sqlstr += " and department.id=" + dep + " ";
            }
            if (pos != "")
            {
                sqlstr += " and zpgw.zppos='" + pos + "' ";
            }
            sqlstr += " order by InterviewTime desc ";
            DataTable dt = MySqlDBHelper.GetDataSet(sqlstr);

            return(dt);
        }
        public static KaoguanZhaopin GetKgZPbyId(int id)
        {
            String sql = "select kaoguanzhaopin.id as Id, " +
                         "kgid," +
                         "zpid," +
                         "weight " +
                         " from kaoguanzhaopin,kaoguan,zhaopin,department " +
                         " where kaoguanzhaopin.kgid=kaoguan.id and kaoguan.kgstate=1 " +
                         " and kaoguanzhaopin.zpid= zhaopin.id " +
                         " and zhaopin.id in (select zhaopin.id from zhaopin,zpfb,zpgw,department " +
                         "  where zhaopin.zpfbid=zpfb.id and zpfb.fbstate=1 and zhaopin.zpstate=1 " +
                         " and zpfb.zpgwid=zpgw.id and zpgw.zpbm=department.id and department.bmstate=1 ) " +
                         " and department.id=kaoguan.depart and department.bmstate=1 " +
                         " and kaoguanzhaopin.id=" + id;
            DataTable dt = MySqlDBHelper.GetDataSet(sql);


            KaoguanZhaopin kgzp = new KaoguanZhaopin();

            foreach (DataRow dr in dt.Rows)
            {
                kgzp.Id        = (int)dr["Id"];
                kgzp.KaoguanID = Convert.ToInt32(dr["kgid"].ToString());
                kgzp.ZhaopinID = Convert.ToInt32(dr["zpid"].ToString());
                kgzp.Weight    = Convert.ToInt32(dr["weight"].ToString());
                return(kgzp);
            }
            return(null);
        }
Ejemplo n.º 9
0
        public static List <Shiti> GetAllShitiByKaotiId(int ktid = -1)
        {
            String sql = "select shiti.id as Id,question,ktid,ktindex,weight,sttime " +
                         " from shiti,kaoti,zpgw,department " +
                         " where kaoti.ktstate=1 and shiti.ktid=kaoti.id " +
                         " and kaoti.zpgwid=zpgw.id and zpgw.zpbm=department.id and department.bmstate=1 ";

            //if(ktid !=-1)
            {
                sql += " and shiti.ktid=" + ktid + " ";
            }
            sql += " order by Id asc";

            DataTable    dt   = MySqlDBHelper.GetDataSet(sql);
            List <Shiti> list = new List <Shiti>();

            foreach (DataRow dr in dt.Rows)
            {
                Shiti st = new Shiti();
                st.Id         = Convert.ToInt32(dr["Id"].ToString());
                st.Question   = dr["question"].ToString();
                st.KaotiID    = Convert.ToInt32(dr["ktid"].ToString());
                st.KaotiIndex = Convert.ToInt32(dr["ktindex"].ToString());
                st.Weight     = Convert.ToInt32(dr["weight"]);
                st.StTime     = Convert.ToInt32(dr["sttime"]);
                list.Add(st);
            }
            return(list);
        }
Ejemplo n.º 10
0
        public static List <Zhaopin> GetAllZhaopinListByparameters(int dep = -1, string pos = "", string st = "", string et = "")
        {
            string sqlstr = "select zhaopin.id as Id," +
                            "zhaopin.title as Title," +
                            "zhaopin.zpfbid as ZPfbId," +
                            "zhaopin.interviewtime as PubTime," +
                            "department.departname as Bm," +
                            "zpgw.zppos as Position," +
                            "zpfb.sums as ZpSum," +
                            "zhaopin.hege as HegeLine, " +
                            "zhaopin.ktid as KTID " +
                            "from zhaopin,zpfb,zpgw,department" +
                            " where zhaopin.zpfbid=zpfb.id and zpfb.zpgwid=zpgw.id and zpgw.zpbm=department.id and zpfb.fbstate=1 and zhaopin.zpstate=1 and department.bmstate=1 ";

            if (dep != -1)
            {
                sqlstr += " and department.id=" + dep + " ";
                if (pos != "")
                {
                    sqlstr += " and zpgw.zppos='" + pos + "' ";
                }
            }

            if (st != "")
            {
                sqlstr += " and zhaopin.interviewtime >='" + st + "' ";
            }
            if (et != "")
            {
                sqlstr += " and zhaopin.interviewtime<='" + et + "' ";
            }
            sqlstr += " order by zhaopin.interviewtime DESC";

            DataTable      dt = MySqlDBHelper.GetDataSet(sqlstr);
            List <Zhaopin> ls = new List <Zhaopin>();

            foreach (DataRow dr in dt.Rows)
            {
                Zhaopin zp = new Zhaopin();
                zp.Id    = Convert.ToInt32(dr["Id"].ToString());
                zp.Title = dr["Title"].ToString();

                // DateTime date = (DateTime)dr["PubTime"];
                //zp.InterviewTime = date.ToShortDateString();
                zp.InterviewTime = dr["PubTime"].ToString();
                zp.ZpfbId        = Convert.ToInt32(dr["ZPfbId"].ToString());

                zp.KaotiID  = dr["KTID"].ToString() == "" ? 0 : Convert.ToInt32(dr["KTID"].ToString());
                zp.HegeLine = Convert.ToInt32(dr["HegeLine"].ToString());

                zp.ZpbmName = dr["Bm"].ToString();
                zp.ZpgwName = dr["Position"].ToString();
                zp.ZpSums   = Convert.ToInt32(dr["ZpSum"].ToString());


                ls.Add(zp);
            }

            return(ls);
        }
Ejemplo n.º 11
0
        public static List <Kaoguan> GetAllKaoguan()
        {
            String sql = "select kaoguan.*,department.departname from kaoguan,department" +
                         " where kaoguan.depart=department.id and kaoguan.kgstate=1" +
                         " and department.bmstate=1 " + " order by department.id asc";
            DataTable      dt   = MySqlDBHelper.GetDataSet(sql);
            List <Kaoguan> list = new List <Kaoguan>();

            if (dt.Rows.Count < 1)
            {
                return(list);
            }
            foreach (DataRow dr in dt.Rows)
            {
                Kaoguan kg = new Kaoguan();
                kg.Id           = (int)dr["id"];
                kg.WorkID       = dr["workid"].ToString();
                kg.Name         = dr["name"].ToString();
                kg.DepID        = Convert.ToInt32(dr["depart"].ToString());
                kg.PositionName = dr["position"].ToString();
                kg.Company      = dr["company"].ToString();
                kg.Pwd          = dr["password"].ToString();

                kg.DepName = dr["departname"].ToString();
                list.Add(kg);
            }
            return(list);
        }
        public static List <ZhaopinItem> GetAllZhaopinItemListWithKgaoguan(int kgid, string name)
        {
            string sqlstr = "select zhaopinitem.id as Id," +
                            "zhaopinitem.title as Title," +
                            "zhaopinitem.pubtime as PubTime from zhaopinitem " +
                            " where zhaopinitem.zpitemstate=1 " +
                            " and zhaopinitem.id in(select zhaopinitem.id from zhaopinitem,zpfb,zhaopin,kaoguanzhaopin,kaoguan " +
                            " where zhaopinitem.id= zpfb.zpitmid and zhaopin.id= kaoguanzhaopin.zpid and zhaopin.zpfbid=zpfb.id and kaoguanzhaopin.kgid=kaoguan.id " +
                            " and zhaopinitem.zpitemstate=1 and zpfb.fbstate=1 and zhaopin.zpstate=1 and kaoguan.kgstate=1 " +
                            " and kaoguan.id=" + kgid + ") "; //+

            ;                                                 // " order by PubTime desc";
            if (name != "")
            {
                sqlstr += " and zhaopinitem.title Like '%" + name + "%'";
            }
            DataTable dt = MySqlDBHelper.GetDataSet(sqlstr);

            List <ZhaopinItem> ls = new List <ZhaopinItem>();

            foreach (DataRow dr in dt.Rows)
            {
                ZhaopinItem zpitem = new ZhaopinItem();
                zpitem.Id      = Convert.ToInt32(dr["Id"]);
                zpitem.Title   = dr["Title"].ToString();
                zpitem.PubTime = dr["PubTime"].ToString();
                ls.Add(zpitem);
            }

            return(ls);
        }
Ejemplo n.º 13
0
        public static Kaoguan GetKaoguanByID(int id)
        {
            String    sql = "select kaoguan.*,department.departname from kaoguan,department where kaoguan.depart=department.id and kaoguan.kgstate=1 and kaoguan.id=" + id;
            DataTable dt  = MySqlDBHelper.GetDataSet(sql);

            if (dt.Rows.Count < 1)
            {
                return(null);
            }

            Kaoguan kg   = new Kaoguan();
            bool    falg = false;

            foreach (DataRow dr in dt.Rows)
            {
                kg.Id           = (int)dr["id"];
                kg.WorkID       = dr["workid"].ToString();
                kg.Name         = dr["name"].ToString();
                kg.DepID        = Convert.ToInt32(dr["depart"].ToString());
                kg.PositionName = dr["position"].ToString();
                kg.Company      = dr["company"].ToString();
                kg.Pwd          = dr["password"].ToString();

                kg.DepName = dr["departname"].ToString();
                falg       = true;
                break;
            }
            if (falg)
            {
                return(kg);
            }
            return(null);
        }
Ejemplo n.º 14
0
        //hhy
        public static DataTable GetAllZhaopinListInItemIdByKaoguan(int zpitmid, int kgid, int dep = -1, string pos = "")
        {
            string sqlstr = "select zhaopin.id as Id," +
                            "zhaopin.title as Title," +
                            "zhaopin.zpfbid," +
                            "zhaopin.interviewtime as InterviewTime," +
                            "department.departname as ZpbmName," +
                            "zpgw.zppos as ZpgwName," +
                            "zpfb.sums as ZpSums," +
                            "zhaopin.hege as HegeLine, " +
                            "zhaopin.ktid as KTID " +
                            "from zhaopin,zpfb,zpgw,department" +
                            " where zhaopin.zpfbid=zpfb.id and zpfb.zpgwid=zpgw.id and zpgw.zpbm=department.id and zpfb.fbstate=1 and zhaopin.zpstate=1 and department.bmstate=1 " +
                            " and zhaopin.id in (select distinct zpid from kaoguanzhaopin,kaoguan,department where kaoguanzhaopin.kgid=kaoguan.id and kaoguan .kgstate=1 and kaoguan.depart=department.id and department.bmstate=1 and kaoguanzhaopin.kgid= " + kgid + " )";

            if (zpitmid != -1)
            {
                sqlstr += " and zpfb.zpitmid=" + zpitmid + " ";
            }
            if (dep != -1)
            {
                sqlstr += " and department.id=" + dep + " ";
            }
            if (pos != "")
            {
                sqlstr += " and zpgw.zppos='" + pos + "' ";
            }
            sqlstr += " and zhaopin.id in (select distinct zpid from kaoguanzhaopin where kgid= " + kgid + " )";

            sqlstr += " order by InterviewTime desc ";
            DataTable dt = MySqlDBHelper.GetDataSet(sqlstr);

            return(dt);
        }
Ejemplo n.º 15
0
        public static List <Kaoti> GetKaotiByZpID(int zpid = -1)
        {
            String sql = "select kaoti.id as Id," +
                         "kaoti.title as Title," +
                         "kaoti.zpgwid as ZpgwId " +
                         " from kaoti,zpfb,zpgw,zhaopin " +
                         " where kaoti.ktstate=1 and zhaopin.zpfbid=zpfb.id and zhaopin.zpstate=1 " +
                         " and zpfb.zpgwid=zpgw.id and zpfb.fbstate=1 and zpgw.id=kaoti.zpgwid ";

            //  if (zpid != -1)
            {
                sql += " and zhaopin.id=" + zpid + " ";
            }

            DataTable dt = MySqlDBHelper.GetDataSet(sql);

            List <Kaoti> list = new List <Kaoti>();

            foreach (DataRow dr in dt.Rows)
            {
                Kaoti kt = new Kaoti();
                kt.Id     = (int)dr["Id"];
                kt.Title  = dr["title"].ToString();
                kt.ZpgwId = Convert.ToInt32(dr["ZpgwId"].ToString());
                list.Add(kt);
            }
            return(list);
        }
Ejemplo n.º 16
0
        public static bool FindUser(string username, string password)
        {
            String    sql = "select * from userinfo where uname='" + username + "' and pwd='" + password + "'";
            DataTable dt  = MySqlDBHelper.GetDataSet(sql);

            return(dt.Rows.Count > 0 ? true:false);
        }
Ejemplo n.º 17
0
        public static int getShitiWeightsInkaoti(int ktid = -1, int seceptid = -1)
        {
            String sql = "select SUM(weight) from kaoti,shiti where kaoti.ktstate=1 and shiti.ktid=kaoti.id ";

            int weight_sum = 0;

            if (ktid != -1)
            {
                sql += " and shiti.ktid=" + ktid + " ";
            }
            if (seceptid != -1)
            {
                sql += " and shiti.id <> " + seceptid;
            }

            DataTable dt = MySqlDBHelper.GetDataSet(sql);

            if (dt.Rows.Count > 0)
            {
                if (dt.Rows[0][0].ToString() != "")
                {
                    weight_sum = Convert.ToInt32(dt.Rows[0][0]);
                }
            }
            return(weight_sum);
        }
Ejemplo n.º 18
0
        public static int GetKaotiSumsInGw(int gwid)
        {
            int       res = 0;
            string    sql = "select * from kaoti where ktstate=1 and zpgwid=" + gwid + " ";
            DataTable dt  = MySqlDBHelper.GetDataSet(sql);

            res = dt.Rows.Count;
            return(res);
        }
        public static DataTable GetAllZhaopinItem()
        {
            string sqlstr = "select zhaopinitem.id as Id," +
                            "zhaopinitem.title as Title," +
                            "zhaopinitem.pubtime as PubTime  from zhaopinitem " +
                            " where zhaopinitem.zpitemstate=1 order by PubTime desc";
            DataTable dt = MySqlDBHelper.GetDataSet(sqlstr);

            return(dt);
        }
        public static int GetPingjiaxiangdianScoreSum()
        {
            String    sql      = "select * from pingjiaxiangdian ";
            DataTable dt       = MySqlDBHelper.GetDataSet(sql);
            int       scoresum = 0;

            foreach (DataRow dr in dt.Rows)
            {
                scoresum += Convert.ToInt32(dr["score"].ToString());
            }
            return(scoresum);
        }
Ejemplo n.º 21
0
        public static int GetPositionIDbyName(string gwname)
        {
            int       positionid = -1;
            String    sqlstr     = "select id from gwposition where positionname='" + gwname + "'";
            DataTable dt         = MySqlDBHelper.GetDataSet(sqlstr);

            if (dt.Rows.Count > 0)
            {
                DataRow dr = dt.Rows[0];
                positionid = Convert.ToInt32(dr["id"].ToString());
            }
            return(positionid);
        }
Ejemplo n.º 22
0
        public static int GetByypzidkgidNoSubmit(int ypzzpid, int kgzpid)
        {
            String sql = "select ypzkgsubmit.id as Id," +
                         "ypzkgsubmit.ypzzpid as YpzzpID," +
                         "ypzkgsubmit.kgzpid as KgzpID," +
                         "ypzkgsubmit.submitstate as SubmitState " +
                         " from ypzkgsubmit  " +
                         " where ypzkgsubmit.submitstate=0 and ypzkgsubmit.ypzzpid= " + ypzzpid +
                         "   and  ypzkgsubmit.kgzpid= " + kgzpid;
            DataTable dt = MySqlDBHelper.GetDataSet(sql);

            return(dt.Rows.Count);
        }
Ejemplo n.º 23
0
        public static List <Kaoti> GetKaotiByParameters(int depid = -1, string zppos = "")
        {
            String sql = "select kaoti.id as Id," +
                         "kaoti.title as Title," +
                         "kaoti.zpgwid as ZpgwId," +
                         "zpgw.zpbm as DepId," +
                         "department.departname as ZpDepName," +
                         "zpgw.zppos as ZpPosName," +
                         " kaoti.ktstate, " +
                         " kaoti.createtime " +
                         " from kaoti,zpgw,department" +
                         " where zpgw.zpbm=department.id and kaoti.zpgwid=zpgw.id and " +
                         " kaoti.ktstate=1 and department.bmstate=1 ";

            if (depid != -1)
            {
                sql += " and department.id=" + depid + " ";
            }
            if (zppos != "" && zppos != null)
            {
                sql += " and zpgw.zppos='" + zppos + "' ";
            }

            DataTable dt = MySqlDBHelper.GetDataSet(sql);

            List <Kaoti> list = new List <Kaoti>();

            foreach (DataRow dr in dt.Rows)
            {
                Kaoti kt = new Kaoti();
                kt.Id      = (int)dr["Id"];
                kt.Title   = dr["title"].ToString();
                kt.ZpgwId  = Convert.ToInt32(dr["ZpgwId"].ToString());
                kt.KtState = Convert.ToInt32(dr["ktstate"].ToString());
                if (dr["createtime"].ToString() != null && dr["createtime"].ToString() != "")
                {
                    DateTime date = (DateTime)dr["createtime"];
                    kt.CreateTime = date.ToShortDateString();
                }
                else
                {
                    kt.CreateTime = "";
                }

                kt.ZpBmName = dr["ZpDepName"].ToString();
                kt.ZpGmName = dr["ZpPosName"].ToString();
                list.Add(kt);
            }
            return(list);
        }
Ejemplo n.º 24
0
        public static List <Politic> GetAllPolitic()
        {
            String         sql  = "select * from politic";
            DataTable      dt   = MySqlDBHelper.GetDataSet(sql);
            List <Politic> list = new List <Politic>();

            foreach (DataRow dr in dt.Rows)
            {
                Politic pic = new Politic();
                pic.ID          = Convert.ToInt32(dr["id"]);
                pic.PoliticName = dr["politicname"].ToString();
                list.Add(pic);
            }
            return(list);
        }
        public static SystemManage GetSystemManage()
        {
            String    sql = "select * from systemmanage ";
            DataTable dt  = MySqlDBHelper.GetDataSet(sql);

            foreach (DataRow dr in dt.Rows)
            {
                SystemManage sm = new SystemManage();
                sm.ID           = Convert.ToInt32(dr["id"]);
                sm.TikuPwd      = dr["tkpwd"].ToString();
                sm.KaochangJilv = dr["kcjl"].ToString();
                return(sm);
            }
            return(null);
        }
Ejemplo n.º 26
0
        public static Pingjiabiaozhun GetPXBZbyId(int bzid)
        {
            String          sql = "select * from pingjiabiaozhun where id=" + bzid;
            DataTable       dt  = MySqlDBHelper.GetDataSet(sql);
            Pingjiabiaozhun st  = new Pingjiabiaozhun();

            foreach (DataRow dr in dt.Rows)
            {
                st.Id      = Convert.ToInt32(dr["id"].ToString());
                st.Content = dr["content"].ToString();
                st.CkScore = Convert.ToInt32(dr["ckscore"].ToString());
                return(st);
            }
            return(null);
        }
Ejemplo n.º 27
0
        public static List <Position> GetAllPosition()
        {
            String          sql  = "select * from gwposition";
            DataTable       dt   = MySqlDBHelper.GetDataSet(sql);
            List <Position> list = new List <Position>();

            foreach (DataRow dr in dt.Rows)
            {
                Position ps = new Position();
                ps.Id           = (int)dr["id"];
                ps.PositionName = dr["positionname"].ToString();
                list.Add(ps);
            }
            return(list);
        }
Ejemplo n.º 28
0
        public static List <Xueli> GetAll()
        {
            String       sql  = "select * from Xueli";
            DataTable    dt   = MySqlDBHelper.GetDataSet(sql);
            List <Xueli> list = new List <Xueli>();

            foreach (DataRow dr in dt.Rows)
            {
                Xueli xl = new Xueli();
                xl.ID        = Convert.ToInt32(dr["id"]);
                xl.XueliName = dr["degreename"].ToString();
                list.Add(xl);
            }
            return(list);
        }
Ejemplo n.º 29
0
        //hhy
        public static List <Yingpinzhe> GetAllYingpinzheByZpAndParameters(int zpid = -1, bool in_zp = true, string ypzname = "", int depid = -1)
        {
            String sql = "select yingpinzhe.id as Id, " +
                         "yingpinzhe.name as Name," +
                         "department.departname as DepName," +
                         "yingpinzhe.dutyname as DutyName, " +
                         "xueli.degreename as DegreeName," +
                         "yingpinzhe.jointime as JinTime," +
                         "politic.politicname as PolName " +
                         "from yingpinzhe,department,xueli,politic,zhaopin,zpfb,zpgw " +
                         "where yingpinzhe.departid=department.id and department.bmstate=1 and yingpinzhe.ypzstate=1 " +
                         " and zhaopin.zpfbid=zpfb.id and zhaopin.zpstate=1 and zhaopin.id= " + zpid + " " +
                         " and zpfb.zpgwid=zpgw.id and zpfb.fbstate=1 " +
                         " and yingpinzhe.zpfbid=zpfb.id " +
                         " and yingpinzhe.xueli= xueli.id and yingpinzhe.politic=politic.id " +
                         " and yingpinzhe.id not in (select distinct ypzid from yingpingzhezhaopin where zpid=" + zpid + ")";

            if (ypzname != "")
            {
                sql += " and yingpinzhe.name='" + ypzname + "' ";
            }
            if (depid != -1)
            {
                sql += " and yingpinzhe.departid=" + depid;
            }
            sql += " order by department.id asc ";

            DataTable         dt   = MySqlDBHelper.GetDataSet(sql);
            List <Yingpinzhe> list = new List <Yingpinzhe>();

            foreach (DataRow dr in dt.Rows)
            {
                Yingpinzhe ypz = new Yingpinzhe();

                ypz.ID   = (int)dr["Id"];
                ypz.Name = dr["Name"].ToString();

                DateTime date = (DateTime)dr["JinTime"];
                ypz.JoinTime = date.ToShortDateString();

                ypz.DepName   = dr["DepName"].ToString();
                ypz.XueliName = dr["DegreeName"].ToString();

                ypz.PolName = dr["PolName"].ToString();
                list.Add(ypz);
            }
            return(list);
        }
Ejemplo n.º 30
0
        public static List <UserInfo> GetAllUserInfo()
        {
            String          sql  = "select * from userinfo";
            DataTable       dt   = MySqlDBHelper.GetDataSet(sql);
            List <UserInfo> list = new List <UserInfo>();

            foreach (DataRow dr in dt.Rows)
            {
                UserInfo uifo = new UserInfo();
                uifo.ID       = Convert.ToInt32(dr["id"]);
                uifo.Username = dr["uname"].ToString();
                uifo.Password = "";
                list.Add(uifo);
            }
            return(list);
        }