Esempio n. 1
0
        public int Add(T_MailAddress modelIn)
        {
            string         cmdStr = "insert into T_MailAddress(MAILADDRESS) values(@MAILADDRESS)";
            OleDbParameter parm   = new OleDbParameter("MAILADDRESS", modelIn.MAILADDRESS);

            SQLHelpler.ExecuteNonQuery(cmdStr, parm);
            return((int)SQLHelpler.ExecuteSclary("select max(ID) from T_MailAddress"));
        }
Esempio n. 2
0
        public int Add(T_PingObj modelIn)
        {
            string cmdStr = "insert into T_PingObj(OBJNAME,ADDRESS,MONITORSPEED,MONITORNET) values(@OBJNAME,@ADDRESS,@MONITORSPEED,@MONITORNET)";

            OleDbParameter[] parms =
            {
                new OleDbParameter("OBJNAME",      modelIn.OBJNAME == null?"":modelIn.OBJNAME),
                new OleDbParameter("ADDRESS",      modelIn.ADDRESS == null?"":modelIn.ADDRESS),
                new OleDbParameter("MONITORSPEED", modelIn.MONITORSPEED),
                new OleDbParameter("MONITORNET",   modelIn.MONITORNET)
            };
            SQLHelpler.ExecuteNonQuery(cmdStr, parms);
            return((int)SQLHelpler.ExecuteSclary("select max(ID) from T_PingObj"));
        }