Пример #1
0
Файл: BmDao.cs Проект: pjjwpc/T
        public int Save(Model.BM_COMMON t,Trans trans)
        {
            DBHelper db = new DBHelper();
            DbCommand cmd = db.GetStoredProcCommand("p_BM_COMMON_insert");//返回主键
            db.AddInParameter(cmd, "@bg_lx", DbType.String, t.bg_lx);
            db.AddInParameter(cmd, "@bg_lxmc", DbType.String, t.bg_lxmc);
            db.AddInParameter(cmd, "@bg_bm", DbType.String, t.bg_bm);
            db.AddInParameter(cmd, "@bg_mc", DbType.String, t.bg_mc);
            db.AddInParameter(cmd, "@bg_pysx", DbType.String, t.bg_pysx);
            db.AddInParameter(cmd, "@bg_xh", DbType.Int32, t.bg_xh);
            db.AddInParameter(cmd, "@bg_bz", DbType.String, t.bg_bz);

            object res = db.ExecuteScalar(cmd,trans);

            return res == null ? -1 : Convert.ToInt32(res);
        }
Пример #2
0
Файл: BmDao.cs Проект: pjjwpc/T
        public int SelectCOMMONBeanPageCount(string searchCondition)
        {
            DBHelper db = new DBHelper();
            DbCommand cmd = db.GetSqlStringCommand("select count(*) from BM_COMMON where " + searchCondition);

            return Convert.ToInt32(db.ExecuteScalar(cmd));
        }
Пример #3
0
        public int Save(Role Role)
        {
            DBHelper db = new DBHelper();
            DbCommand cmd = db.GetStoredProcCommand("p_Role_insert");//返回主键
            db.AddInParameter(cmd, "@Role_Name", DbType.String, Role.Role_Name);
            db.AddInParameter(cmd, "@DES", DbType.String, Role.DES);

            object res = db.ExecuteScalar(cmd);

            return res == null ? -1 :1;
        }