public static int Create(OurGoal param) { using (var db = new MsSql(DbName.Official)) { return(db.One <int>( CommandType.Text, "INSERT INTO [dbo].[OurGoal]([LeftImg],[RightImg])VALUES(@LeftImg,@RightImg);SELECT @@IDENTITY;", new DbParameter[] { new SqlParameter { Value = param.LeftImg ?? "", SqlDbType = SqlDbType.NVarChar, ParameterName = "@LeftImg", Direction = ParameterDirection.Input }, new SqlParameter { Value = param.RightImg ?? "", SqlDbType = SqlDbType.NVarChar, ParameterName = "@RightImg", Direction = ParameterDirection.Input }, new SqlParameter { Value = param.OurGoalId, SqlDbType = SqlDbType.Int, ParameterName = "@OurGoalId", Direction = ParameterDirection.Input } })); } }
public static int NextPriority(FunctionParameter param) { using (var db = new MsSql(DbName.Official)) { return (Convert.ToInt32( db.One( CommandType.StoredProcedure, "[dbo].[sp_FunctionNextPriority_Sel]", new DbParameter[] { new SqlParameter { Value = param.Function.FunctionId, SqlDbType = SqlDbType.Int, ParameterName = "@argIntFunctionId", Direction = ParameterDirection.Input } }))); } }
public static int Create(Partner param) { using (var db = new MsSql(DbName.Official)) { return(db.One <int>( CommandType.Text, "INSERT INTO [dbo].[Partner]([ImgPath])VALUES(@ImgPath);SELECT @@IDENTITY;", new DbParameter[] { new SqlParameter { Value = param.ImgPath ?? "", SqlDbType = SqlDbType.NVarChar, ParameterName = "@ImgPath", Direction = ParameterDirection.Input }, new SqlParameter { Value = param.PartnerId, SqlDbType = SqlDbType.Int, ParameterName = "@PartnerId", Direction = ParameterDirection.Input } })); } }