Ejemplo n.º 1
0
 private void BindData()
 {
     if (bzid != -1)
     {
         Pingjiabiaozhun pjz = FTInterviewBLL.PingjiabiaozhunManage.GetPXBZbyId(bzid);
         myEditor.Value = pjz.Content;
     }
 }
Ejemplo n.º 2
0
        public static int Update(Pingjiabiaozhun pjbz)
        {
            String sql = "update pingjiabiaozhun set content=@content,ckscore=@ckscore where id=@id";
            List <MySqlParameter> para_list = new List <MySqlParameter>();

            para_list.Add(new MySqlParameter("@id", pjbz.Id));
            para_list.Add(new MySqlParameter("@content", pjbz.Content));
            para_list.Add(new MySqlParameter("@score", pjbz.CkScore));

            return(MySqlDBHelper.ExecuteCommand(sql, para_list.ToArray()));
        }
Ejemplo n.º 3
0
        public static int Add(Pingjiabiaozhun pjbz)
        {
            String sql = "insert into pingjiabiaozhun(content,pjxdid,ckscore) values(@content,@pjxdid,@ckscore)";
            List <MySqlParameter> para_list = new List <MySqlParameter>();

            para_list.Add(new MySqlParameter("@content", pjbz.Content));
            para_list.Add(new MySqlParameter("@pjxdid", pjbz.PjxdID));
            para_list.Add(new MySqlParameter("@ckscore", pjbz.CkScore));

            return(MySqlDBHelper.ExecuteCommand(sql, para_list.ToArray()));
        }
Ejemplo n.º 4
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.º 5
0
        public static List <Pingjiabiaozhun> GetAll()
        {
            String    sql = "select * from pingjiabiaozhun ";
            DataTable dt  = MySqlDBHelper.GetDataSet(sql);
            List <Pingjiabiaozhun> list = new List <Pingjiabiaozhun>();

            foreach (DataRow dr in dt.Rows)
            {
                Pingjiabiaozhun st = new Pingjiabiaozhun();
                st.Id      = Convert.ToInt32(dr["id"].ToString());
                st.Content = dr["content"].ToString();
                st.CkScore = Convert.ToInt32(dr["ckscore"].ToString());
                st.PjxdID  = Convert.ToInt32(dr["pjxdid"].ToString());
                list.Add(st);
            }
            return(list);
        }
Ejemplo n.º 6
0
        protected void Save_Click(object sender, EventArgs e)
        {
            Pingjiabiaozhun pbz = new Pingjiabiaozhun();

            pbz.Content = myEditor.Value;
            pbz.PjxdID  = 1;
            pbz.CkScore = 100;
            if (bzid != -1)
            {
                // if (ScoreValue.Value != null && ScoreValue.Value != "")
                {
                    try
                    {
                        pbz.Id = bzid;
                        FTInterviewBLL.PingjiabiaozhunManage.Update(pbz);
                        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>");
                    }
                    catch (System.Exception ex)
                    {
                        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
            {
                // if (ScoreValue.Value != null && ScoreValue.Value != "")
                {
                    try
                    {
                        FTInterviewBLL.PingjiabiaozhunManage.Add(pbz);
                        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>");
                    }
                    catch (System.Exception ex)
                    {
                        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>");
                    }
                }
            }
        }
 public static int Update(Pingjiabiaozhun pjbz)
 {
     return(FTInterviewDAL.PingjiabiaozhunService.Update(pjbz));
 }
 public static int Add(Pingjiabiaozhun pz)
 {
     return(FTInterviewDAL.PingjiabiaozhunService.Add(pz));
 }