Example #1
0
        public static int updateYctMode(YctMode m)
        {
            LogMode l = new LogMode(m.getModeStr());
            int     i = -1;

            try
            {
                conn = DbUtil.getConn();
                conn.Open();

                string sql = "update yct set [shop] = '" + m.shop
                             + "', [phone] = '" + m.phone + "', [money] = '" + m.money
                             + "', [time] = '" + m.time + "', [mark] = '" + m.mark
                             + "' where id = " + m.id;
                l          = new LogMode(sql);
                cmd        = new OleDbCommand(sql, conn);
                i          = cmd.ExecuteNonQuery();
                Const.info = "更新:" + i;
                l.act      = "ok\t" + l.act;
            }
            catch (Exception e)
            {
                Const.info = e.Message;
                l.act      = "fail:" + e.Message + "\t" + l.act;
            }
            finally
            {
                if (conn != null)
                {
                    conn.Close();
                }
            }
            insertLogMode(l);
            return(i);
        }
Example #2
0
        public static int insertYctMode(YctMode m)
        {
            LogMode l = new LogMode(m.getModeStr());
            int     i = -1;

            try
            {
                conn = DbUtil.getConn();
                conn.Open();

                string sql = "insert into yct([shop], [phone], [money], [time], [mark]) values('" + m.shop
                             + "','" + m.phone + "','" + m.money + "','" + m.time + "','" + m.mark + "')";
                l          = new LogMode(sql);
                cmd        = new OleDbCommand(sql, conn);
                i          = cmd.ExecuteNonQuery();
                Const.info = "插入:1";
                l.act      = "ok\t" + l.act;
            }
            catch (Exception e)
            {
                Const.info = e.Message;
                l.act      = "fail:" + e.Message + "\t" + l.act;
            }
            finally
            {
                if (conn != null)
                {
                    conn.Close();
                }
            }
            insertLogMode(l);
            return(i);
        }
Example #3
0
        public static int updateYctMode(YctMode m)
        {
            LogMode l = new LogMode(m.getModeStr());
            int i = -1;
            try
            {
                conn = DbUtil.getConn();
                conn.Open();

                string sql = "update yct set [shop] = '" + m.shop
                    + "', [phone] = '" + m.phone + "', [money] = '" + m.money
                    + "', [time] = '" + m.time + "', [mark] = '" + m.mark
                    + "' where id = " + m.id;
                l = new LogMode(sql);
                cmd = new OleDbCommand(sql, conn);
                i = cmd.ExecuteNonQuery();
                Const.info = "更新:" + i;
                l.act = "ok\t" + l.act;
            }
            catch (Exception e)
            {
                Const.info = e.Message;
                l.act = "fail:" + e.Message + "\t" + l.act;
            }
            finally
            {
                if (conn != null)
                {
                    conn.Close();
                }
            }
            insertLogMode(l);
            return i;
        }
Example #4
0
        public static int insertYctMode(YctMode m)
        {
            LogMode l = new LogMode(m.getModeStr());
            int i = -1;
            try
            {
                conn = DbUtil.getConn();
                conn.Open();

                string sql = "insert into yct([shop], [phone], [money], [time], [mark]) values('" + m.shop
                    + "','" + m.phone + "','" + m.money + "','" + m.time + "','" + m.mark + "')";
                l = new LogMode(sql);
                cmd = new OleDbCommand(sql, conn);
                i = cmd.ExecuteNonQuery();
                Const.info = "插入:1";
                l.act = "ok\t" + l.act;
            }
            catch (Exception e)
            {
                Const.info = e.Message;
                l.act = "fail:" + e.Message + "\t" + l.act;
            }
            finally
            {
                if (conn != null)
                {
                    conn.Close();
                }
            }
            insertLogMode(l);
            return i;
        }