public int GetInsert(M_ExAnswer exAnswer) { string sqlStr = "INSERT INTO [dbo].[ZL_ExAnswer] ([ExaID],[Stuid],[Answer],[AnswerTime],[Fraction],[Scores],[Examiners],[RoomID],[StuName]) VALUES (@ExaID,@Stuid,@Answer,@AnswerTime,@Fraction,@Scores,@Examiners,@RoomID,@StuName),SET @AnswerID = SCOPE_IDENTITY()"; SqlParameter[] cmdParams = initmod.GetParameters(exAnswer); return(SqlHelper.ObjectToInt32(SqlHelper.ExecuteScalar(CommandType.Text, sqlStr, cmdParams))); }
public int insert(M_ExAnswer model) { return(Sql.insert(strTableName, model.GetParameters(model), model.GetParas(), model.GetFields())); }
public bool GetUpdate(M_ExAnswer model) { return(Sql.UpdateByIDs(strTableName, PK, model.AnswerID.ToString(), model.GetFieldAndPara(), model.GetParameters(model))); }