예제 #1
0
        public int AuthUpdate(tb_authorinfo tb_aut)
        {
            int intResult = 0;

            try
            {
                getConnection getCon = new getConnection();
                oledCon = getCon.OledCon();
                oledCon.Open();

                string strAdd = "update tb_authorinfo  set ";
                strAdd   += "authorName='" + tb_aut.strauthorName + "',authorSex='" + tb_aut.strauthorSex + "',authorbirthday ='" + tb_aut.daauthorbirthday + "',";
                strAdd   += "authorGenre='" + tb_aut.strauthorGenre + "',authorcompany='" + tb_aut.strauthorcompany + "',authorRecma ='" + tb_aut.strauthorRecma + "',";
                strAdd   += "authorzjm='" + tb_aut.strauthorzjm + "',RdateTime='" + tb_aut.daRdateTime + "' where authorId='" + tb_aut.intauthorId + "'";
                oledcmd   = new SqlCommand(strAdd, oledCon);
                intResult = oledcmd.ExecuteNonQuery();
                return(intResult);
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.Message.ToString());
                return(intResult);
            }
        }
예제 #2
0
        public int AuthAdd(tb_authorinfo tb_aut)

        {
            int intResult = 0;

            try
            {
                getConnection getCon = new getConnection();
                oledCon = getCon.OledCon();
                oledCon.Open();
                string strAdd = "insert into tb_authorinfo values( ";
                strAdd   += "'" + tb_aut.intauthorId + "','" + tb_aut.strauthorName + "','" + tb_aut.strauthorSex + "','" + tb_aut.daauthorbirthday + "',";
                strAdd   += "'" + tb_aut.strauthorGenre + "','" + tb_aut.strauthorcompany + "','" + tb_aut.strauthorRecma + "',";
                strAdd   += "'" + tb_aut.strauthorzjm + "','" + tb_aut.daRdateTime + "')";
                oledcmd   = new SqlCommand(strAdd, oledCon);
                intResult = oledcmd.ExecuteNonQuery();
                return(intResult);
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.Message.ToString());
                return(intResult);
            }
        }