Пример #1
0
        public static int Update(ZhaopinGw zpgw)
        {
            String sqlstr = "update zpgw set zpbm=@zpbm,zppos=@zppos";
            List <MySqlParameter> para_list = new List <MySqlParameter>();

            para_list.Add(new MySqlParameter("@zpbm", zpgw.ZpDepart));
            para_list.Add(new MySqlParameter("@zppos", zpgw.ZpPosition));
            para_list.Add(new MySqlParameter("@id", zpgw.Id));

            return(MySqlDBHelper.ExecuteCommand(sqlstr, para_list.ToArray()));
        }
Пример #2
0
        public static int Add(ZhaopinGw zpgw)
        {
            String sqlstr = "insert into zpgw(zpbm,zppos) values(@zpbm,@zppos)";
            List <MySqlParameter> para_list = new List <MySqlParameter>();

            para_list.Add(new MySqlParameter("@zpbm", zpgw.ZpDepart));
            para_list.Add(new MySqlParameter("@zppos", zpgw.ZpPosition));

            if (GetZhaopinGwID(zpgw.ZpDepart, zpgw.ZpPosition) == -1)
            {
                return(MySqlDBHelper.ExecuteCommand(sqlstr, para_list.ToArray()));
            }
            return(-1);
        }
Пример #3
0
        public static List <ZhaopinGw> GetAllZhaopinGwList(int dep = -1, string pos = "")
        {
            DataTable        dt = GetAllZhaopinGw(dep, pos);
            List <ZhaopinGw> ls = new List <ZhaopinGw>();

            foreach (DataRow dr in dt.Rows)
            {
                ZhaopinGw zg = new ZhaopinGw();
                zg.Id         = Convert.ToInt32(dr["Id"]);
                zg.ZpDepart   = Convert.ToInt32(dr["ZpBmID"].ToString());
                zg.ZpPosition = dr["Zppos"].ToString();

                zg.ZpBmName = dr["Zpbm"].ToString();
                ls.Add(zg);
            }
            return(ls);
        }
Пример #4
0
        public static ZhaopinGw GetZhaopinGwByid(int id)
        {
            string sqlstr = "select zpgw.id as Id,zpgw.zpbm,department.departname,zpgw.zppos " +
                            " from zpgw,department where zpgw.zpbm=department.id and department.bmstate=1 and zpgw.id =" + id;

            ZhaopinGw zg = new ZhaopinGw();
            DataTable dt = MySqlDBHelper.GetDataSet(sqlstr);

            if (dt.Rows.Count > 0)
            {
                DataRow dr = dt.Rows[0];
                zg.Id       = Convert.ToInt32(dr["Id"].ToString());
                zg.ZpDepart = (int)dr["zpbm"];

                zg.ZpBmName = dr["departname"].ToString();

                zg.ZpPosition = dr["zppos"].ToString();

                return(zg);
            }
            return(null);
        }
Пример #5
0
        protected void BindData(bool isfirst = true)
        {
            DataProcess.DepartmentBind(department);

            if (gwId != -1)
            {
                DataProcess.KaotiBind(Sumti, gwId);
                ZhaopinGw zg = FTInterviewBLL.ZhaopinGwManage.GetZhaopinGwByid(gwId);

                DataProcess.PositionBind(Position, zg.ZpDepart);
                department.SelectedValue = zg.ZpDepart + "";
                Position.SelectedValue   = zg.ZpPosition;
                department.Enabled       = false;
                Position.Enabled         = false;

                int t_temp = Convert.ToInt32(Sumti.SelectedValue);


                List <Shiti> ls;
                if (t_temp != -1)
                {
                    ls = FTInterviewBLL.ShitiManage.GetAllShitiByKaotiId(t_temp);
                }
                else
                {
                    ls = new List <Shiti>();
                }
                MsttGridview.DataSource          = ls;
                AspNetPagerAskAnswer.RecordCount = ls.Count;
                MsttGridview.DataBind();
                int sum_test = 0;
                if (isfirst)
                {
                    foreach (Shiti sstt in ls)
                    {
                        sum_test += sstt.Weight;
                    }
                    if (sum_test < 100)
                    {
                        Response.Write("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>");
                        Response.Write("<script language=javascript>alert('权重和不为1!')</script>");
                    }
                    if (sum_test > 100)
                    {
                        Response.Write("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>");
                        Response.Write("<script language=javascript>alert('权重大于1,请合理分配!')</script>");
                    }
                }
            }
            else
            {
                if (ktid != -1)
                {
                    Kaoti kt = FTInterviewBLL.KaotiManage.GetKaotiByID(ktid);
                    DataProcess.KaotiBind(Sumti, kt.ZpgwId);
                    ZhaopinGw zg = FTInterviewBLL.ZhaopinGwManage.GetZhaopinGwByid(kt.ZpgwId);

                    department.SelectedValue = zg.ZpDepart + "";

                    DataProcess.PositionBind(Position, Convert.ToInt32(department.SelectedValue));
                    Position.SelectedValue = zg.ZpPosition;
                    Sumti.SelectedValue    = kt.Id + "";

                    TTime.Value        = kt.CreateTime;
                    department.Enabled = false;
                    Position.Enabled   = false;
                    Sumti.Enabled      = false;

                    int t_temp = kt.Id;


                    List <Shiti> ls;
                    if (t_temp != -1)
                    {
                        ls = FTInterviewBLL.ShitiManage.GetAllShitiByKaotiId(t_temp);
                    }
                    else
                    {
                        ls = new List <Shiti>();
                    }

                    MsttGridview.DataSource          = ls;
                    AspNetPagerAskAnswer.RecordCount = ls.Count;
                    MsttGridview.DataBind();
                    Sumti_SelectedIndexChanged();
                    if (isfirst)
                    {
                        int sum_test = 0;
                        foreach (Shiti sstt in ls)
                        {
                            sum_test += sstt.Weight;
                        }
                        if (sum_test < 100)
                        {
                            Response.Write("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>");
                            Response.Write("<script language=javascript>alert('权重和不为1!')</script>");
                        }
                        if (sum_test > 100)
                        {
                            Response.Write("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>");
                            Response.Write("<script language=javascript>alert('权重大于1,请合理分配!')</script>");
                        }
                    }
                }
                else
                {
                    DataProcess.KaotiBind(Sumti, -2);
                    List <Shiti> ls = new List <Shiti>();
                    AspNetPagerAskAnswer.RecordCount = ls.Count;
                    MsttGridview.DataBind();
                }
            }
        }
Пример #6
0
        //save
        protected void Add_btnClick(object sender, EventArgs e)
        {
            if (zpfbid == -1)//add new
            {
                int tid = Convert.ToInt32(department.SelectedValue.ToString());
                if (tid == -1)
                {
                    Response.Write("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>");
                    Response.Write("<script language=javascript>alert('请选择部门!')</script>");
                }
                else
                {
                    int    bmid = tid;//Convert.ToInt32(department.SelectedValue);
                    string zpgw = ZpgwName.Value;
                    int    num  = Convert.ToInt32(ZpSum.Value);


                    int zpgwid = FTInterviewBLL.ZhaopinGwManage.GetZhaopinGwID(tid, zpgw);
                    if (zpgwid == -1)
                    {
                        ZhaopinGw zg = new ZhaopinGw();
                        zg.ZpDepart   = tid;
                        zg.ZpPosition = zpgw;
                        FTInterviewBLL.ZhaopinGwManage.Add(zg);
                        zpgwid = FTInterviewBLL.ZhaopinGwManage.GetZhaopinGwID(tid, zpgw);
                    }

                    if (zpgwid != -1)
                    {
                        ZhaopinFb zf = new ZhaopinFb();
                        zf.ZpGwID   = zpgwid;
                        zf.ZpSums   = num;
                        zf.ZpFbTime = DateTime.Now.ToString();
                        zf.FbState  = 1;
                        zf.ZpitmId  = zpitmid;
                        FTInterviewBLL.ZhaopinFbManage.Add(zf);

                        Response.Write("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>");
                        Response.Write("<script language=javascript>alert('添加成功!')</script>");
                    }
                    else
                    {
                        Response.Write("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>");
                        Response.Write("<script language=javascript>alert('添加失败!')</script>");
                    }
                }
            }
            else
            {
                int tid = Convert.ToInt32(department.SelectedValue.ToString());
                if (tid == -1)
                {
                    Response.Write("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>");
                    Response.Write("<script language=javascript>alert('请选择部门!')</script>");
                }
                else
                {
                    string zpgw = ZpgwName.Value;
                    int    num  = Convert.ToInt32(ZpSum.Value);

                    int zpgwid = FTInterviewBLL.ZhaopinGwManage.GetZhaopinGwID(tid, zpgw);
                    if (zpgwid == -1)
                    {
                        ZhaopinGw zg = new ZhaopinGw();
                        zg.ZpDepart   = tid;
                        zg.ZpPosition = zpgw;
                        FTInterviewBLL.ZhaopinGwManage.Add(zg);
                        zpgwid = FTInterviewBLL.ZhaopinGwManage.GetZhaopinGwID(tid, zpgw);
                    }

                    if (zpgwid != -1)
                    {
                        ZhaopinFb zf = new ZhaopinFb();
                        zf.Id       = zpfbid;
                        zf.ZpGwID   = zpgwid;
                        zf.ZpSums   = num;
                        zf.ZpFbTime = DateTime.Now.ToString();
                        zf.FbState  = 1;
                        zf.ZpitmId  = zpitmid;
                        FTInterviewBLL.ZhaopinFbManage.Update(zf);

                        Response.Write("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>");
                        Response.Write("<script language=javascript>alert('更新成功!')</script>");
                    }
                    else
                    {
                        Response.Write("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>");
                        Response.Write("<script language=javascript>alert('更新失败!')</script>");
                    }
                }
            }
        }
Пример #7
0
 public static int Update(ZhaopinGw zp)
 {
     return(FTInterviewDAL.ZhaopinGwService.Update(zp));
 }
Пример #8
0
 public static int Add(ZhaopinGw zpgw)
 {
     return(FTInterviewDAL.ZhaopinGwService.Add(zpgw));
 }